User Tools

Site Tools


No ACL setup yet! Denying access to everyone.
en:edu:zmitac:macro:iot:lab

Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Both sides previous revisionPrevious revision
en:edu:zmitac:macro:iot:lab [2024/04/21 16:17] – [Laboratory scenarios] pczekalskien:edu:zmitac:macro:iot:lab [2024/04/21 16:17] (current) – [Laboratory scenarios] pczekalski
Line 240: Line 240:
 </code> </code>
  
-The sensor class returns data (among others) in a float containing temperature (in C) and relative humidity (in percent):+The sensor class returns data (among others) in a float containing temperature (in C) and relative humidity (in per cent):
 <code c> <code c>
 ... ...
Line 258: Line 258:
  
 Report: Report:
-  * When using ESP in STA mode, observe whether the solution's subsequent running attaches a new or the same IP address via the DHCP server.+  * When using ESP in STA mode, observe whether the subsequent running of the solution attaches a new or the same IP address via the DHCP server.
   * Include source code.   * Include source code.
 <pagebreak> <pagebreak>
Line 267: Line 267:
 Use your solution from the last step of Lab4 and also Lab3. Measure temperature and humidity, present them on the screen as in the case of the Lab3 scenario, and parallel, publish them as MQTT messages to the Broker. Use your solution from the last step of Lab4 and also Lab3. Measure temperature and humidity, present them on the screen as in the case of the Lab3 scenario, and parallel, publish them as MQTT messages to the Broker.
 <note important>Mind agreeing with other sections to let you do not overlap with MQTT Message Topics. They should be unique for all teams!</note> <note important>Mind agreeing with other sections to let you do not overlap with MQTT Message Topics. They should be unique for all teams!</note>
-Using any software-based MQTT client, subscribe to the messages using a PRIVATE or PUBLIC network and observe results. You can use a PC computer to develop a solution for this task.+Using any software-based MQTT client, subscribe to the messages using a PRIVATE or PUBLIC network and observe results. You can use a PC to develop a solution for this task.
  
 The simplest starting point is to use the pub-sub MQTT client library: The simplest starting point is to use the pub-sub MQTT client library:
Line 335: Line 335:
 Note that receiving messages requires periodical execution of the ''client.loop();'' function. Add it to your code's ''void loop()...'' function. If you send messages only (publish but do not subscribe), using ''client.loop();'' is not obligatory. Note that receiving messages requires periodical execution of the ''client.loop();'' function. Add it to your code's ''void loop()...'' function. If you send messages only (publish but do not subscribe), using ''client.loop();'' is not obligatory.
  
-Advanced:+**Advanced**:
   * Implement a "last will" informing that the device has lost connection (suddenly, not via disconnect)—present the last available measurements as persistent. Present the device state by changing a persistent message on connect/disconnect to let the subscribers know the state of your device. To implement controlled disconnect, use //select// key from the keypad (you can assume that you may need to restart the device to get it back on the network, but you also may implement a bistable logic: the first click of the //select// triggers MQTT disconnect, the second click connects it back to the Broker).   * Implement a "last will" informing that the device has lost connection (suddenly, not via disconnect)—present the last available measurements as persistent. Present the device state by changing a persistent message on connect/disconnect to let the subscribers know the state of your device. To implement controlled disconnect, use //select// key from the keypad (you can assume that you may need to restart the device to get it back on the network, but you also may implement a bistable logic: the first click of the //select// triggers MQTT disconnect, the second click connects it back to the Broker).
  
Line 352: Line 352:
  
  
-Report:+**Report**:
   * Provide your MQTT message Topics and Payload formats (semantics).   * Provide your MQTT message Topics and Payload formats (semantics).
   * Include source code.   * Include source code.
 <pagebreak> <pagebreak>
  
en/edu/zmitac/macro/iot/lab.1713709029.txt.gz · Last modified: by pczekalski