|
META TOPICPARENT |
name="WorkshopSlides" |
Slide 1: Setting up an IoT |
|
The Network Layers |
|
< < | The WeMos D1 mini has a built-in WiFi interface
In order to communicate with other IoT nodes we must therefore connect to the WiFi network first
On top of WiFi we will run a TCP session
On top of TCP we will run the MQTT protocol
On top of MQTT we have dedicated topics and payloads imposed by Cayenne |
> > | The WeMos D1 mini has a built-in WiFi interface
In order to communicate with other IoT nodes we must therefore
connect to the WiFi network first
On top of WiFi we will run a TCP session
On top of TCP we will run the MQTT protocol
On top of MQTT we have dedicated topics and payloads imposed by Cayenne |
|
Accessing the WiFi network |
|
|
|
> > | Sending dummy temperature data
 |
|
|
|
> > | Receiving commands
Receiving commands is a bit more tricky! We must:
- Write a callback function and register it with the MQTT client
- This function takes 2 arguments:
- The topic
- The payload
- Subscribe to the topic
- Wait forever. The callback function will be executed when a message with the
topic we subscribed to, will arrive
Subscribe a callback
 |
|
%SLIDESHOWEND% |
|
META FILEATTACHMENT |
attachment="mqttExample.png" attr="" comment="" date="1557936755" name="mqttExample.png" path="mqttExample.png" size="74994" user="UliRaich" version="2" |
META FILEATTACHMENT |
attachment="realData.png" attr="" comment="" date="1557940336" name="realData.png" path="realData.png" size="28318" user="UliRaich" version="1" |
META FILEATTACHMENT |
attachment="afnog19-ws-session3.odp" attr="" comment="" date="1557947594" name="afnog19-ws-session3.odp" path="afnog19-ws-session3.odp" size="5370872" user="UliRaich" version="1" |
|
|
> > |
META FILEATTACHMENT |
attachment="mqttDummySensorDemo.png" attr="" comment="" date="1558377647" name="mqttDummySensorDemo.png" path="mqttDummySensorDemo.png" size="76145" user="UliRaich" version="1" |
META FILEATTACHMENT |
attachment="subscribeDemo.png" attr="" comment="" date="1558377918" name="subscribeDemo.png" path="subscribeDemo.png" size="80206" user="UliRaich" version="1" |
|