This shows you the differences between two versions of the page.
iothings:laboratoare:lab7 [2022/04/20 19:39] cosmin.chenaru [Exerciții] |
iothings:laboratoare:lab7 [2024/07/15 22:03] (current) cosmin.chenaru Change IP hardcoding |
||
---|---|---|---|
Line 9: | Line 9: | ||
Există o sumedenie de implementări software a protocolului CoAP ([[https://en.wikipedia.org/wiki/Constrained_Application_Protocol#Implementations|Implementations]]), dar în acest laborator vom folosi biblioteca "[[https://github.com/hirotakaster/CoAP-simple-library|CoAP simple library]]" pentru Arduino IDE pentru a rula un server CoAP, și implementarea [[https://github.com/Tanganelli/CoAPthon|CoAPthon]] din Python pentru a rula un client CoAP. | Există o sumedenie de implementări software a protocolului CoAP ([[https://en.wikipedia.org/wiki/Constrained_Application_Protocol#Implementations|Implementations]]), dar în acest laborator vom folosi biblioteca "[[https://github.com/hirotakaster/CoAP-simple-library|CoAP simple library]]" pentru Arduino IDE pentru a rula un server CoAP, și implementarea [[https://github.com/Tanganelli/CoAPthon|CoAPthon]] din Python pentru a rula un client CoAP. | ||
+ | O captură Wireshark arată cum protocolul CoAP rulează peste protocolul UDP: | ||
+ | |||
+ | {{:iothings:laboratoare:lab7-coap-capture.png?600|}} | ||
==== MQTT ==== | ==== MQTT ==== | ||
Line 43: | Line 46: | ||
<code> | <code> | ||
- | /usr/local/bin/coapclient.py -o PUT -p "coap://192.168.1.151/light" -P "1" | + | /usr/local/bin/coapclient.py -o PUT -p "coap://$ESP32_BOARD_IP/light" -P "1" |
</code> | </code> | ||
- | === Ex. 2 - Android "IoT CoAP" application === | + | === Ex. 2 (Opțional) - Android "IoT CoAP" application === |
Instalați aplicația "IoT CoAP" pentru a trimite mesaje către plăcuța ESP32. | Instalați aplicația "IoT CoAP" pentru a trimite mesaje către plăcuța ESP32. | ||
+ | {{:iothings:laboratoare:lab7-iot-coap-app.png|}} | ||
=== Ex. 3 - MQTT === | === Ex. 3 - MQTT === | ||
Line 83: | Line 86: | ||
* https://github.com/hirotakaster/CoAP-simple-library | * https://github.com/hirotakaster/CoAP-simple-library | ||
* https://en.wikipedia.org/wiki/Constrained_Application_Protocol | * https://en.wikipedia.org/wiki/Constrained_Application_Protocol | ||
+ | * https://play.google.com/store/apps/details?id=ch.buedev.iot_coap&hl=en&gl=US | ||
+ | * https://www.digikey.de/en/maker/blogs/2019/how-to-use-mqtt-with-the-raspberry-pi |