{"id":919,"date":"2018-06-13T22:17:10","date_gmt":"2018-06-13T21:17:10","guid":{"rendered":"http:\/\/www.vancura.cz\/?p=919"},"modified":"2024-03-28T11:54:15","modified_gmt":"2024-03-28T10:54:15","slug":"android-app-chargeme-iot-esp8266","status":"publish","type":"post","link":"https:\/\/vancura.cz\/wordpress\/android-app-chargeme-iot-esp8266\/","title":{"rendered":"Android App : ChargeMe IoT ESP8266"},"content":{"rendered":"<p>Android app for clever charging via IoT relay<br \/>\n<!--more--><\/p>\n<p><strong>Description<\/strong><br \/>\nCharge your Android device in clever way &#8211; let it drive its charging process by itself. Charging cable is wired though IoT AC relay. App sends commands to relay wireless via MQTT protocol. Once charged relay gets OFF and vice versa.<\/p>\n<p>video <a href=\"https:\/\/youtu.be\/HDxDjHT5b-M\" target=\"_blank\" rel=\"noopener noreferrer\">https:\/\/youtu.be\/HDxDjHT5b-M<\/a><\/p>\n<p>&nbsp;<\/p>\n<p><a href=\"https:\/\/play.google.com\/store\/apps\/details?id=cz.vancura.android.chargeProtectBottomNavigation&amp;pcampaignid=MKT-Other-global-all-co-prtnr-py-PartBadge-Mar2515-1\"><img decoding=\"async\" src=\"https:\/\/play.google.com\/intl\/en_us\/badges\/images\/generic\/en_badge_web_generic.png\" alt=\"Get it on Google Play\" width=\"300\" \/><\/a><\/p>\n<p><strong>Step 1 : Get your free MQTT server<\/strong><\/p>\n<p>I recommend <a href=\"https:\/\/www.cloudmqtt.com\/\">https:\/\/www.cloudmqtt.com\/<\/a> free service. Register and get your credentials.<\/p>\n<p>Example of such :<br \/>\nserver name : m23.cloudmqtt.com<br \/>\nserver port : 12088<br \/>\nuser name : cpmcluaa (dummy, do not use it)<br \/>\nuser password : VjIpTthcqmb8 (dummy, do not use it)<\/p>\n<p><strong>Step 2 : Configure IoT relay<\/strong><\/p>\n<p>using with Sonnof IoT relay &#8211; recommended<\/p>\n<p>What you need : <a href=\"https:\/\/bit.ly\/2WGTJzl\">Sonnoff IoT relay<\/a> and <a href=\"http:\/\/bit.ly\/2iEFpkH\">FTDI adapter<\/a> for flashing it.<\/p>\n<p>See <a href=\"https:\/\/www.youtube.com\/watch?v=chyVjtYb0EA\">this great tutorial<\/a> to understand how to flash Sonoff FW.<br \/>\nDownload <a href=\"https:\/\/github.com\/arendst\/Sonoff-Tasmota\/wiki\/Arduino-IDE\">custom FW Tahoma here<\/a>.<br \/>\nConfigure file user_config.h &#8211; and insert<br \/>\n<code><br \/>\n\/\/ MQTT topic - refer to Step 2<br \/>\n#define PROJECT       \"sonoff\"  <\/code><\/p>\n<p>\/\/ Your Wifi<br \/>\n#define STA_SSID1 &#8222;your_wifi_ssid&#8220;<br \/>\n#define STA_PASS1 &#8222;your_wifi_password&#8220;<\/p>\n<p>\/\/ MQTT server &#8211; refer to Step 1<br \/>\n#define MQTT_HOST &#8222;m23.cloudmqtt.com&#8220;<br \/>\n#define MQTT_PORT 12088<br \/>\n#define MQTT_USER &#8222;cpmcluaa&#8220;<br \/>\n#define MQTT_PASS &#8222;VjIpTthcqmb8&#8220;<\/p>\n<p><strong>Step 3 : Configure ChargeMe IoT app<\/strong><\/p>\n<p>launch the app, go to Settings and insert<br \/>\n&#8211; MQTT server details &#8211; from Step 1<br \/>\n&#8211; IoT relay payloads &#8211; to control relay &#8211; refer to Tahoma FW<\/p>\n<p><strong>Another option &#8211; using with Raspberry Pi and AC Relay<\/strong><\/p>\n<p>What you need : Raspberry Pi and AC relay &#8211; <a href=\"https:\/\/bit.ly\/2JRZMdi\">example at Aliexpress<\/a><\/p>\n<p>To install MQTT client at Raspberry PI use <a href=\"https:\/\/mosquitto.org\/\">Eclipse Mosquitto<\/a>. See <a href=\"https:\/\/www.youtube.com\/watch?v=AAOW68xz0DQ\">this tutorial<\/a> and <a href=\"http:\/\/www.vancura.cz\/android\/ChargeMe\/pythonChargeProtect.py\">my example of python code<\/a>.<br \/>\nCode subcribes to MQTT and based on payloads (&#8222;ON&#8220; or &#8222;OFF&#8220;) turns GPIO 4 at pin 7 low or high. Connect AC relay to this pin and there you go.<\/p>\n","protected":false},"excerpt":{"rendered":"<p>Android app for clever charging via IoT relay<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[6],"tags":[],"class_list":["post-919","post","type-post","status-publish","format-standard","hentry","category-android"],"_links":{"self":[{"href":"https:\/\/vancura.cz\/wordpress\/wp-json\/wp\/v2\/posts\/919","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/vancura.cz\/wordpress\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/vancura.cz\/wordpress\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/vancura.cz\/wordpress\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/vancura.cz\/wordpress\/wp-json\/wp\/v2\/comments?post=919"}],"version-history":[{"count":29,"href":"https:\/\/vancura.cz\/wordpress\/wp-json\/wp\/v2\/posts\/919\/revisions"}],"predecessor-version":[{"id":17521,"href":"https:\/\/vancura.cz\/wordpress\/wp-json\/wp\/v2\/posts\/919\/revisions\/17521"}],"wp:attachment":[{"href":"https:\/\/vancura.cz\/wordpress\/wp-json\/wp\/v2\/media?parent=919"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/vancura.cz\/wordpress\/wp-json\/wp\/v2\/categories?post=919"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/vancura.cz\/wordpress\/wp-json\/wp\/v2\/tags?post=919"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}