This shows you the differences between two versions of the page.
iothings:laboratoare:2025_code:lab4_2 [2025/10/21 11:38] dan.tudose created |
iothings:laboratoare:2025_code:lab4_2 [2025/10/21 16:59] (current) dan.tudose |
||
---|---|---|---|
Line 7: | Line 7: | ||
// ===== Wi-Fi creds ===== | // ===== Wi-Fi creds ===== | ||
- | //const char* WIFI_SSID = "UPB-Guest"; | + | const char* WIFI_SSID = "UPB-Guest"; |
- | //const char* WIFI_PASS = ""; | + | const char* WIFI_PASS = ""; |
// ===== UDP + CoAP objects ===== | // ===== UDP + CoAP objects ===== | ||
Line 188: | Line 188: | ||
</code> | </code> | ||
- | Test it from your computer with the following commands, where esp-ip is the IP the node prints after connecting in the serial terminal: | ||
- | <code> | ||
- | # discovery | ||
- | coap-client -v9 -m get -A 40 coap://<esp-ip>/.well-known/core | ||
- | |||
- | # other resources | ||
- | coap-client -v9 -m get coap://<esp-ip>/sys/uptime | ||
- | coap-client -v9 -m get coap://<esp-ip>/net/rssi | ||
- | coap-client -v9 -m get coap://<esp-ip>/led | ||
- | coap-client -v9 -m put -e "on" coap://<esp-ip>/led | ||
- | coap-client -v9 -m put -e "off" coap://<esp-ip>/led | ||
- | coap-client -v9 -m post -e "hello" coap://<esp-ip>/echo | ||
- | |||
- | </code> |