Adafruit-IO Meets ESP8266, Arduino & MIT App Inventor 2
Hello World for Adafruit-io & MQTT Protocol — 05 #kidSerie
MQTT & Adafruit-io & IFTT - Part I
Adafruit.io MQTT Arduino ESP8266 A guide step by step till Home Dashboard ! Hi, In this post we'll get you with a…
Dying to know the codes? What you really wanted was “The real thing”? and the likes? so it’s about time to check it out!!!
<iframe src=”https://s3.amazonaws.com/view.bannerpro.co/published/Daa97b99f7f7540cdebba6b8e010b9e18/embed.html" frameborder=”0" style=”margin:0;padding:0;border:none;background-color:transparent” allowtransparency=”true” scrolling=”no” width=”580" height=”400"></iframe>
Step 00-Intranet ES8266 test
Lets see if it works indoors first.
Get all the code sequence from my Github. There are 4 codes. I put _05_ kidSerie_ sketch prefix to better locate them; First ran the code to ESP8266 as the community offers, then I used the code written by Tony DiCola from Adafruit (thank you man!); then mixed the two and viola!! The magic happens…
Step 01-Adafruit w/ dummy data
The code sends an estimated reading and things work. There is only one more step and ready !! Subscribe and publish with MQTT not appears more a problem…
Step 02-MQTT for real
Enjoy this wonderful iot protocol and a kind Dashboard!!!
MQTT is a machine-to-machine (M2M) IoT communication protocol, useful when small footprint is needed.
But lack a piece in this gear: android !! For this I used the fabulous idea of MIT App Inventor 2 that makes it much easier.
The callback message is where everything happens. as soon as it is available the subscription data temp writes the data in the <pre> and that’s it …
Note that we use the jquery and MQTT libs calling them at the beginning of the script.
Now how to connect this code to the MIT App Inventor 2 ?
To understand how it works I think it’s good to run WebViewString.aia.
Here is schematic:
Step 04-MIT App Inventor 2
Here is the code in MIT App Inventor 2:
Here is the ESP8266.ino code (see github if you will):
In the meantime, feel free to contact me and I’ll help you any way I can. I think you’ll know my username j3 by now, so it won’t be that that hard to send a message or comment on my youtube channel.
keep playing with electronics! Thank you for following my posts! See you soon! Bye!!!