Line: 1 to 1 | |||||||||||||||||||||||||||||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
![]() Slide 1: Setting up an IoT | |||||||||||||||||||||||||||||||||||||||||
Line: 202 to 202 | |||||||||||||||||||||||||||||||||||||||||
![]() | |||||||||||||||||||||||||||||||||||||||||
Added: | |||||||||||||||||||||||||||||||||||||||||
> > | Send dummy measurement![]() Dummy temperature in Cayenne![]() Dummy temperature parameters![]() Fix widget to dashboard![]() Dummy temperature historyCayenne keeps measurement values which can be plotted as a history plot or downloaded for further evaluation![]() A custom widget![]() A gauge widget![]() Dummy temperature gauge on the dashboard![]() Gauge value ranges![]() It's hot!![]() Several dummy measurementsNow we want to send a dummy temperature and a dummy humidity value.How do we distinguish? They use different communication channels! Sending temperature and humidity: the code![]() Dashboard with temperature and humidity![]() Other measurementsWe have seen that we can send temperature with
Measurements implemented in the Cayenne Client![]() How to control a device?Cayenne supplies only 2 control widgets:
Cayenne Slider![]() Slider on the dashboard![]() A Cayenne Button![]() Dashboard with button![]() How to receive commandsWe must define a callback function, which is called whenever the user of the Cayenne dashboard changes a setting on the push button or sliderThe callback takes a message parameter which is a tuple of
Cayenne command message![]() Exercises!More on how to interpret this message in the next session | ||||||||||||||||||||||||||||||||||||||||
%SLIDESHOWEND%
-- ![]() | |||||||||||||||||||||||||||||||||||||||||
Line: 237 to 375 | |||||||||||||||||||||||||||||||||||||||||
| |||||||||||||||||||||||||||||||||||||||||
Added: | |||||||||||||||||||||||||||||||||||||||||
> > |
|
Line: 1 to 1 | |||||||||||||||||||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
![]() Slide 1: Setting up an IoT | |||||||||||||||||||||||||||||||
Line: 74 to 74 | |||||||||||||||||||||||||||||||
| |||||||||||||||||||||||||||||||
Added: | |||||||||||||||||||||||||||||||
> > | Changed Callback![]() Missing functions in IoT
Cayenne functionality
![]() Signing up for CayenneSign up athttps://mydevices.com/cayenne/signup ![]() ![]() Cayenne Start![]() Cayenne DocYou find the documentation at https://mydevices.com/cayenne/docs/intro![]() ![]() Installing Cayenne on the Raspberry PI![]() Installing Cayenne on the Raspberry Pi manually![]() Register your Controller Single Board Computers![]() Run Cayenne on the Arduino![]() Basic Arduino Sketch for the Arduino![]() Cayenne Credentials![]() Cayenne network layers![]() Value and units are integrated into the payload string Cayenne and PythonThis falls under “bring your own thing” !Having a look at the Arduino sketch you can see that it uses the Arduino Cayenne C++ library. Cayenne MQTT libraries are available in
Cayenne and MicropythonThe Python Cayenne Client library depends on the Eclipse Paho MQTT libraryMicropython uses its own, stripped down “umqtt” (micro mqtt) library such that the standard Cayenne Client does not work on Micropython but … The Python Cayenne Client is Open Source and can be adapted to umqtt, which is what I did for you. The adapted Client library uses the same API as the original one, which means that the example programs work unchanged. The Cayenne ClientWhen creating a Cayenne Client Class it
The code to connect to Cayenne![]() Connecting to Cayenne![]() The empty Cayenne dashboard![]() | ||||||||||||||||||||||||||||||
%SLIDESHOWEND%
-- ![]() | |||||||||||||||||||||||||||||||
Line: 94 to 222 | |||||||||||||||||||||||||||||||
| |||||||||||||||||||||||||||||||
Added: | |||||||||||||||||||||||||||||||
> > |
|
Line: 1 to 1 | ||||||||
---|---|---|---|---|---|---|---|---|
![]() Slide 1: Setting up an IoT | ||||||||
Line: 65 to 65 | ||||||||
Callback result | ||||||||
Added: | ||||||||
> > | ![]() Controlling a LEDIn order to control a LED through MQTT we now simply interpret the payload:
| |||||||
%SLIDESHOWEND%
-- ![]() | ||||||||
Line: 84 to 93 | ||||||||
| ||||||||
Added: | ||||||||
> > |
|
Line: 1 to 1 | ||||||||
---|---|---|---|---|---|---|---|---|
![]() Slide 1: Setting up an IoT | ||||||||
Line: 62 to 62 | ||||||||
![]() | ||||||||
Added: | ||||||||
> > | Callback result | |||||||
%SLIDESHOWEND%
-- ![]() |
Line: 1 to 1 | ||||||||
---|---|---|---|---|---|---|---|---|
![]() Slide 1: Setting up an IoT | ||||||||
Line: 60 to 60 | ||||||||
| ||||||||
Added: | ||||||||
> > |
|
Line: 1 to 1 | ||||||||
---|---|---|---|---|---|---|---|---|
![]() Slide 1: Setting up an IoT | ||||||||
Line: 10 to 10 | ||||||||
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 | ||||||||
Added: | ||||||||
> > | Accessing the WiFi network![]() | |||||||
Accessing the WiFi network from Micropython![]() | ||||||||
Line: 36 to 40 | ||||||||
![]() | ||||||||
Added: | ||||||||
> > | ||||||||
| ||||||||
Line: 52 to 57 | ||||||||
| ||||||||
Added: | ||||||||
> > |
|
Line: 1 to 1 | |||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
![]() | |||||||||||
Changed: | |||||||||||
< < | Title | ||||||||||
> > | Setting up an IoTSession3: MQTT and CayenneUli Raich
The Network LayersThe WeMos D1 mini has a built-in WiFi interfaceIn 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 from Micropython![]() MQTTMQTT (Message Queuing Telemetry Transport: a publish-subscribe basedmessage protocol running of top of TCP. A processor can subscribe to messages of a certain “topic” and/or it can push its results on a certain topic ![]() MQTT Demo![]() The Micropython library![]() A MQTT example using umqtt.simple![]() | ||||||||||
%SLIDESHOWEND% | |||||||||||
Line: 10 to 46 | |||||||||||
Comments\ No newline at end of file | |||||||||||
Added: | |||||||||||
> > |
|
Line: 1 to 1 | ||||||||
---|---|---|---|---|---|---|---|---|
Added: | ||||||||
> > |
![]() Slide 1: Title--![]() Comments |