Exercise 1:

Go through the tutorial on

https://mydevices.com/cayenne/docs/cayenne-mqtt-api/#cayenne-mqtt-api-manually-publishing-subscribing

in section "Manually Publishing / Subscribing"

  • Create a connection profile with your Cayenne credentials
  • Connect to Cayenne (you should see the note "offline" go away)
  • Send some dummy temperature measurements to Cayenne
  • Read the push button and send the answer that you successfully received and treated the command

Exercise 2:

Come back to exercise 7 of session 2, where we read out the temperature and relative humidity values from the SHT30 shield.

Now replace the dummy data, in exercise 5 of session 3 with the real data and send them to Cayenne. Instead of sending voltages, send temperature and relative humidity. This exercise therefore combines the 2 previous exercises into a new one.

Observe the values on Cayenne. Create a gauge for the temperature.

Measure for some minutes and then have a look the widget history.

Exercise 3:

Connect the push button to the built-in led. Write a callback function which parses the topic and payload, finds out if the command is meant for the LED (check the channel number) from the topic. Extract the value from the payload and interact with the LED correspondingly.

The response is sent to Cayenne by the Cayenne client without your intervention.

Exercise 4:

Create 3 sliders on Cayenne for each colour component of the WS2812 rgb LED. Find out from the channel transmitted in the topic, which colour component must be acted upon. Set the corresponding LED to the value (0 .. 255) found in the payload.

-- Uli Raich - 2019-05-15

Comments

Edit | Attach | Watch | Print version | History: r2 < r1 | Backlinks | Raw View | Raw edit | More topic actions
Topic revision: r2 - 2019-05-23 - UliRaich
 
This site is powered by the TWiki collaboration platform Powered by PerlCopyright © 2008-2019 by the contributing authors. All material on this collaboration platform is the property of the contributing authors.
Ideas, requests, problems regarding TWiki? Send feedback