This shows you the differences between two versions of the page.
Both sides previous revisionPrevious revisionNext revision | Previous revision | ||
en:iot-open:practical:hardware:sut:esp32:iot_4 [2024/04/21 19:15] – [Steps] pczekalski | en:iot-open:practical:hardware:sut:esp32:iot_4 [2024/04/21 19:18] (current) – [Steps] pczekalski | ||
---|---|---|---|
Line 73: | Line 73: | ||
void callback(char* topic, byte* payload, unsigned int length) { | void callback(char* topic, byte* payload, unsigned int length) { | ||
//prepare a code to display the message (payload) to the display | //prepare a code to display the message (payload) to the display | ||
- | |||
} | } | ||
</ | </ | ||
Line 122: | Line 121: | ||
</ | </ | ||
+ | === Step 8 === | ||
+ | Run client handling routine in the loop to receive messages: | ||
+ | <code c> | ||
+ | void loop() | ||
+ | { | ||
+ | if (!client.connected()) { | ||
+ | //reconnect the client (and eventually the WiFi if gone) | ||
+ | } | ||
+ | client.loop(); | ||
+ | } | ||
+ | </ | ||
==== Result validation ==== | ==== Result validation ==== | ||
You should be able to connect to the WiFi and MQTT broker (verified by the status present on the selected display) and then subscribe to the message (identified by topic). Depending on whether you're fully remote or able to access our networks with an additional device, you need to implement a publisher on another laboratory node (as present in the scenario [[[en: | You should be able to connect to the WiFi and MQTT broker (verified by the status present on the selected display) and then subscribe to the message (identified by topic). Depending on whether you're fully remote or able to access our networks with an additional device, you need to implement a publisher on another laboratory node (as present in the scenario [[[en: |