ESP32 #3 Publish and Subscribe using MQTT on Platformio (Arduino)

Video Statistics and Information

Video
Captions Word Cloud
Reddit Comments
Captions
this time I will show you how to publish and subscribe on amputated Protocol connection using esp 32 module start a new project using SP 32 after that I installed the library for mqtt connection here I installed the pub/sub client library from Nicole Larry ID of the library is 89 [Music] this library include the example that you can use for your project but for this video I will try to make a program step by step before connect to the internet first thing to do is connect the ESB 32 to a hot spot I will make a setup Wi-Fi function for Wi-Fi connection [Music] the Wi-Fi that began will initialize the Wi-Fi connection this is my hotspot info and then I will initialize the Wi-Fi connection and wait for the Wi-Fi connection until the Wi-Fi status is connected [Music] [Music] call the say the Wi-Fi function and upload the code to the module open the serial monitor to see the result and that's it I success connect my ESB 32 module to a hospital next step is connect the years we touch it module to the server or broker here I use free server the DILG why they call you can sign up with your email this is the information that you need to connect to the server there are username password port and topic I will include the pub/sub client library and declare some information for my MQTT connection [Music] [Music] and then I will make a real connection for a server connection [Music] [Music] the Cayenne that connect will initialize the connection to the server containing unique ID username and password this function will return a boolean value for your server connection status [Music] [Music] set the server name and port check the server connection every time in loop and called the reconnect function if connection is down upload the code to the module and see the result and that's it I success connect the module to the server next step is published something to the server for Doom Deb I installed the Android apps the IOT MQTT dashboard or you can choose another free dashboard after installing the apps fill in your server information like eunuch ID username password and port [Music] [Music] and then make a menu for subscribe to receive the data that you publish from ESP 30 to module set the topic for your data and the dashboard is ready add the topic to your code [Music] [Music] here I will publish some string to the server every two seconds it will contain an iteration string [Music] publish your string using trying to publish the contain your topic and your data [Music] and I success publish to the server next I will subscribe the data from the server for doing that I will make a callback function to read the data from the server [Music] [Music] [Music] that client that subscribe with your subscription topic to your code after you successful connect to the server and that is the topic [Music] said the Kobuk function as a callback [Music] after that make a menu on dashboard for publishing something to the module here I will send a string containing word to our files and let's check in the solar monitor for the result [Music] [Music] and that's it I success publish and subscribe data from the module to the server [Music] you
Info
Channel: irtouv
Views: 78,768
Rating: undefined out of 5
Keywords: esp32, espectro32, mqtt, m2m, iot, iot mqtt dashboard, arduino, platformio, esp 32, publish, subscribe, wifi, broker, server, dioty, mqtt.dioty.co, mqtt dasboard, topic, espressif, internet of things, pubsubclient
Id: 5tG3JXFYrUo
Channel Id: undefined
Length: 9min 18sec (558 seconds)
Published: Tue Sep 19 2017
Related Videos
Note
Please note that this website is currently a work in progress! Lots of interesting data and statistics to come.