Difference: MQTTAndCayenne (4 vs. 5)

Revision 52019-05-20 - UliRaich

Line: 1 to 1
 
META TOPICPARENT name="WorkshopSlides"

Start Presentation

Slide 1: Setting up an IoT

Line: 7 to 7
 

The Network Layers

Changed:
<
<
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

Line: 41 to 43
 umqttDemo.png

Added:
>
>

Sending dummy temperature data

mqttDummySensorDemo.png

 

Added:
>
>

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

subscribeDemo.png

  %SLIDESHOWEND%
Line: 61 to 79
 
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"
Added:
>
>
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"
 
This site is powered by the TWiki collaboration platform Powered by PerlCopyright © 2008-2024 by the contributing authors. All material on this collaboration platform is the property of the contributing authors.
Ideas, requests, problems regarding TWiki? Send feedback