Line: 1 to 1 | |||||||||||||||||||||||||||||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
Slide 1: Setting up an IoT | |||||||||||||||||||||||||||||||||||||||||
Line: 202 to 202 | |||||||||||||||||||||||||||||||||||||||||
Added: | |||||||||||||||||||||||||||||||||||||||||
> > | Send dummy measurementDummy temperature in CayenneDummy temperature parametersFix widget to dashboardDummy temperature historyCayenne keeps measurement values which can be plotted as a history plot or downloaded for further evaluationA custom widgetA gauge widgetDummy temperature gauge on the dashboardGauge value rangesIt'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 codeDashboard with temperature and humidityOther measurementsWe have seen that we can send temperature with
Measurements implemented in the Cayenne ClientHow to control a device?Cayenne supplies only 2 control widgets:
Cayenne SliderWe can define the range for the slider in the above case: 0..255Slider on the dashboardA Cayenne ButtonDashboard with buttonHow 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 messagePlease compare the command message with our credentials and try to find out to which channel this command has been addressed. Can you find the values as well? Remember: we defined the push button on channel 3 and the slider in channel 2!Exercises!More on how to interpret this message in the next session | ||||||||||||||||||||||||||||||||||||||||
%SLIDESHOWEND% -- Uli Raich - 2019-05-14 | |||||||||||||||||||||||||||||||||||||||||
Line: 237 to 375 | |||||||||||||||||||||||||||||||||||||||||
| |||||||||||||||||||||||||||||||||||||||||
Added: | |||||||||||||||||||||||||||||||||||||||||
> > |
|
Line: 1 to 1 | |||||||||||||||||||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
Slide 1: Setting up an IoT | |||||||||||||||||||||||||||||||
Line: 74 to 74 | |||||||||||||||||||||||||||||||
| |||||||||||||||||||||||||||||||
Added: | |||||||||||||||||||||||||||||||
> > | Changed CallbackMissing functions in IoT
Cayenne functionality
Signing up for CayenneSign up athttps://mydevices.com/cayenne/signup Cayenne StartCayenne DocYou find the documentation at https://mydevices.com/cayenne/docs/intro Contains short introductory video clips, information of Cayenne on Raspberry Pi and Arduino but also how to use Cayenne on any device. Pointers to the Cayenne MQTT Libraries and their APIInstalling Cayenne on the Raspberry PIInstalling Cayenne on the Raspberry Pi manuallyRegister your Controller Single Board ComputersRun Cayenne on the ArduinoBasic Arduino Sketch for the ArduinoCayenne CredentialsCayenne network layersThe Cayenne credentials are integrated into the MQTT topic stringValue 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 CayenneConnecting to CayenneThe empty Cayenne dashboard | ||||||||||||||||||||||||||||||
%SLIDESHOWEND% -- Uli Raich - 2019-05-14 | |||||||||||||||||||||||||||||||
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% -- Uli Raich - 2019-05-14 | ||||||||
Line: 84 to 93 | ||||||||
| ||||||||
Added: | ||||||||
> > |
|
Line: 1 to 1 | ||||||||
---|---|---|---|---|---|---|---|---|
Slide 1: Setting up an IoT | ||||||||
Line: 62 to 62 | ||||||||
Added: | ||||||||
> > | Callback result | |||||||
%SLIDESHOWEND% -- Uli Raich - 2019-05-14 |
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 MicropythonMQTTMQTT (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 DemoThe Micropython libraryA 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-- Uli Raich - 2019-05-14Comments |