Tags:
view all tags
---+ MQTT and Cayenne ---++ Exercise 1: Install mosquitto on your machine. On Ubuntu Linux this can very easily be accomplished with apt. Try the _mosquitto_ communication: * <p>Start the mosquitto broker</p> * <p>Start mosquitto_sub subscribing to the “DCSIT” topic</p> * <p>Start mosquitto_pub publishing some message to the topic “DCSIT</p> * <p>observe the message being seen in mosquitto_sub</p> ---++ Exercise 2: Write you own MQTT client in Python publishing a message to “DCSIT” every 2 s. Have a look at the <a href="https://github.com/micropython/micropython-lib/tree/master/umqtt.simple" target="_blank">umqtt.simple class<img alt="" border="0" height="12" src="%PUBURL%/TWiki/TWikiDocGraphics/external-link.gif" width="13" /></a> to see how to accomplish this. Write the program and start it with thonny. You must know the IP address of the machine on which your mosquitto broker is running. Use _ifconfig_ to find out. Subscribe to the “DCSIT” topic with mosquitto_sub and observer that the messages are arriving. Write an MQTT client that subscribes to the “DCSIT” topic and that prints messages coming in. Write a program controlling a LED. Use messages “LED on” and “LED off” to control the LED. ---++ Exercise 3: Register a user on <a href="https://mydevices.com/cayenne/signup" target="_blank">https://mydevices.com/cayenne/signup<img alt="" border="0" height="12" src="%PUBURL%/TWiki/TWikiDocGraphics/external-link.gif" width="13" /></a>. Watch the introductory film and have a look at the documentation pages. Add a device by clicking on “Bring Your Own Thing”. Have a look at your Cayenne credentials. ---++ Exercise 4: Write a program connecting to Cayenne. Observe that the dashboard is coming up. ---++ Exercise 5: Write a program that sends dummy temperature values to Cayenne on channel 0. The temperature values should range from 0 to 50°C . Wait for 2 s minimum between each value. Observe the widget coming up on the dashboard. Fix the widget on the dashboard and change the widget parameters (e.g. the name). ---++ Exercise 6: Add a gauge widget with ranges 0 .. 50 °C. Run your program sending the dummy temperatures and observe how the dashboard displays them. ---++ Exercises 7: Create a slider and a push button on your dashboard. ---++ Exercise 8: Create a temperature and a humidity widget on the Cayenne dashboard. Write a program that connects to Cayenne and sends temperature and humidity values read from the SHT30 to Cayenne every 5s. Observe the measurements on the dash board. Add two line charts for temperature and humidity and observe how the plots evolve over time. You may also try to download the measurements saved on the plots. ---++ Exercise 9: Add a push button to the dashboard and connect it to the built-in LED on the ESP32 CPU board. Try to switch the LED on and off using this button. The dashboard should now look like this: <img alt="dashboard.png" height="692" src="%ATTACHURL%/dashboard.png" title="dashboard.png" width="1053" /> As you can see, the LED is currently switched on ---++ Exercise 10: Create 4 sliders on the dashboard. The first one will select one of the 7 LEDs on the WS2812 RGB LED chain while the other 3 will select the red, green and blue component for the LED selected. ---++ Exercise 11: Connect the GPS receiver to the ESP32 and send GPS position information to Cayenne. -- %USERSIG{UliRaich - 2020-09-02}% ---++ Comments %COMMENT%
Attachments
Attachments
Topic attachments
I
Attachment
History
Action
Size
Date
Who
Comment
png
dashboard.png
r1
manage
68.6 K
2020-09-04 - 12:58
UliRaich
Edit
|
Attach
|
Watch
|
P
rint version
|
H
istory
:
r4
<
r3
<
r2
<
r1
|
B
acklinks
|
V
iew topic
|
Raw edit
|
More topic actions...
Topic revision: r2 - 2020-09-04
-
UliRaich
Home
Site map
AFNOG web
Embedded_Systems web
IoT_Course_English web
IoT_Course_French web
Main web
Sandbox web
TWiki web
IoT_Course_English Web
Create New Topic
Index
Search
Changes
Notifications
RSS Feed
Statistics
Preferences
P
View
Raw View
Print version
Find backlinks
History
More topic actions
Edit
Raw edit
Attach file or image
Edit topic preference settings
Set new parent
More topic actions
Account
Log In
Register User
Edit
Attach
Copyright © 2008-2025 by the contributing authors. All material on this collaboration platform is the property of the contributing authors.
Ideas, requests, problems regarding TWiki?
Send feedback