Difference: MQTTAndCayenne (8 vs. 9)

Revision 92019-05-22 - UliRaich

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

Start Presentation

Slide 1: Setting up an IoT

Line: 202 to 202
  cayenneEmptyDashboard.png
Added:
>
>

Send dummy measurement

cayenneDummyTemp.png

Dummy temperature in Cayenne

dummyTemp.png

Dummy temperature parameters

dummyTempPars.png

Fix widget to dashboard

dummyTempFixed.png

Dummy temperature history

Cayenne keeps measurement values which can be plotted as a history plot

or downloaded for further evaluation

dummyTempHistory.png

A custom widget

cayenneCustonWidget.png

A gauge widget

cayenneTempGauge.png

Dummy temperature gauge on the dashboard

cayenneWarm.png

Gauge value ranges

cayenneGaugeRanges.png

It's hot!

cayenneHot.png

Several dummy measurements

Now 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

cayenneTempHum.png

Dashboard with temperature and humidity

cayenneDashboardTempHum.png

Other measurements

We have seen that we can send temperature with

  • client.celsiusWrite(channel,temp)
And relative humidity with

  • Client.humidityWrite(channel,hum)
Which other types of measurements can we send?

Measurements implemented in the Cayenne Client

cayenneMQTTCalls.png

How to control a device?

Cayenne supplies only 2 control widgets:

  • a push button
  • A slider

Cayenne Slider

cayenneDummySlider.png

We can define the range for the slider in the above case: 0..255

Slider on the dashboard

cayenneDashSlider.png

A Cayenne Button

cayenneDummyButtton.png

Dashboard with button

cayenneDashButton.png

How to receive commands

We must define a callback function, which is called

whenever the user of the Cayenne dashboard

changes a setting on the push button or slider

The callback takes a message parameter which is a tuple of

  • Cayenne topic
  • Cayenne payload

Cayenne command message

cayenneCmdMsg.png

Please 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
 
META FILEATTACHMENT attachment="cayenneConnectCode.png" attr="" comment="" date="1558543962" name="cayenneConnectCode.png" path="cayenneConnectCode.png" size="58160" user="UliRaich" version="1"
META FILEATTACHMENT attachment="cayenneConnect.png" attr="" comment="" date="1558543971" name="cayenneConnect.png" path="cayenneConnect.png" size="141182" user="UliRaich" version="1"
META FILEATTACHMENT attachment="cayenneEmptyDashboard.png" attr="" comment="" date="1558543976" name="cayenneEmptyDashboard.png" path="cayenneEmptyDashboard.png" size="153778" user="UliRaich" version="1"
Added:
>
>
META FILEATTACHMENT attachment="cayenneDummyTemp.png" attr="" comment="" date="1558549946" name="cayenneDummyTemp.png" path="cayenneDummyTemp.png" size="72819" user="UliRaich" version="1"
META FILEATTACHMENT attachment="cayenneHot.png" attr="" comment="" date="1558549948" name="cayenneHot.png" path="cayenneHot.png" size="150698" user="UliRaich" version="1"
META FILEATTACHMENT attachment="dummyTempFixed.png" attr="" comment="" date="1558549949" name="dummyTempFixed.png" path="dummyTempFixed.png" size="129302" user="UliRaich" version="1"
META FILEATTACHMENT attachment="dummyTempHistory.png" attr="" comment="" date="1558549949" name="dummyTempHistory.png" path="dummyTempHistory.png" size="30202" user="UliRaich" version="1"
META FILEATTACHMENT attachment="dummyTemp.png" attr="" comment="" date="1558549950" name="dummyTemp.png" path="dummyTemp.png" size="112872" user="UliRaich" version="1"
META FILEATTACHMENT attachment="dummyTempPars.png" attr="" comment="" date="1558550238" name="dummyTempPars.png" path="dummyTempPars.png" size="141124" user="UliRaich" version="1"
META FILEATTACHMENT attachment="cayenneTempGauge.png" attr="" comment="" date="1558550476" name="cayenneTempGauge.png" path="cayenneTempGauge.png" size="210070" user="UliRaich" version="1"
META FILEATTACHMENT attachment="cayenneWarm.png" attr="" comment="" date="1558550689" name="cayenneWarm.png" path="cayenneWarm.png" size="153237" user="UliRaich" version="1"
META FILEATTACHMENT attachment="cayenneGaugeRanges.png" attr="" comment="" date="1558550915" name="cayenneGaugeRanges.png" path="cayenneGaugeRanges.png" size="158951" user="UliRaich" version="1"
META FILEATTACHMENT attachment="cayenneTempHum.png" attr="" comment="" date="1558551138" name="cayenneTempHum.png" path="cayenneTempHum.png" size="84686" user="UliRaich" version="1"
META FILEATTACHMENT attachment="cayenneMQTTCalls.png" attr="" comment="" date="1558551398" name="cayenneMQTTCalls.png" path="cayenneMQTTCalls.png" size="68591" user="UliRaich" version="1"
META FILEATTACHMENT attachment="cayenneDashboardTempHum.png" attr="" comment="" date="1558551400" name="cayenneDashboardTempHum.png" path="cayenneDashboardTempHum.png" size="122373" user="UliRaich" version="1"
META FILEATTACHMENT attachment="cayenneDashButton.png" attr="" comment="" date="1558551804" name="cayenneDashButton.png" path="cayenneDashButton.png" size="160259" user="UliRaich" version="1"
META FILEATTACHMENT attachment="cayenneDashSlider.png" attr="" comment="" date="1558551805" name="cayenneDashSlider.png" path="cayenneDashSlider.png" size="142904" user="UliRaich" version="1"
META FILEATTACHMENT attachment="cayenneDummySlider.png" attr="" comment="" date="1558551855" name="cayenneDummySlider.png" path="cayenneDummySlider.png" size="182816" user="UliRaich" version="1"
META FILEATTACHMENT attachment="cayenneDummyButtton.png" attr="" comment="" date="1558551858" name="cayenneDummyButtton.png" path="cayenneDummyButtton.png" size="216089" user="UliRaich" version="1"
META FILEATTACHMENT attachment="cayenneCmdMsg2.png" attr="" comment="" date="1558552532" name="cayenneCmdMsg2.png" path="cayenneCmdMsg2.png" size="70285" user="UliRaich" version="1"
META FILEATTACHMENT attachment="cayenneCmdMsg.png" attr="" comment="" date="1558552534" name="cayenneCmdMsg.png" path="cayenneCmdMsg.png" size="194050" user="UliRaich" version="1"
META FILEATTACHMENT attachment="ourCredentials.png" attr="" comment="" date="1558552534" name="ourCredentials.png" path="ourCredentials.png" size="18282" user="UliRaich" version="1"
META FILEATTACHMENT attachment="cayenneCustonWidget.png" attr="" comment="" date="1558553190" name="cayenneCustonWidget.png" path="cayenneCustonWidget.png" size="189279" 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