This shows you the differences between two versions of the page.
|
iothings:laboratoare:2025:lab4 [2025/10/21 11:39] dan.tudose [CoAP Server] |
iothings:laboratoare:2025:lab4 [2025/10/28 11:29] (current) dan.tudose [CoAP Server] |
||
|---|---|---|---|
| Line 124: | Line 124: | ||
| [[iothings:laboratoare:2025_code:lab4_2|Click here to get the code example.]] | [[iothings:laboratoare:2025_code:lab4_2|Click here to get the code example.]] | ||
| + | |||
| + | |||
| + | 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> | ||
| <note>**Assignment 1:** | <note>**Assignment 1:** | ||
| Line 130: | Line 147: | ||
| <note>**Assignment 2:** | <note>**Assignment 2:** | ||
| - | Build a web page that acts as a GUI for your coap-client queries (e.g. you can do discovery, get and put/post from the page. | + | Build a web page that acts as a GUI for your coap-client queries (e.g. you can do discovery, get and put/post from the page. You will probably need a proxy to translate coap datagrams to WS or HTTP. |
| </note> | </note> | ||
| + | |||
| <hidden> | <hidden> | ||