Differences

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

Link to this comparison view

Both sides previous revisionPrevious revision
en:iot-open:practical:hardware:sut:esp32:iot_6 [2024/05/07 12:50] – [Start] pczekalskien:iot-open:practical:hardware:sut:esp32:iot_6 [2024/05/07 12:58] (current) – [Start] pczekalski
Line 56: Line 56:
 Declare an IP address of the CoAP server endpoint. Adjust ''a, b, c d'' as needed for your context; see node's technical documentation for integration services details: Declare an IP address of the CoAP server endpoint. Adjust ''a, b, c d'' as needed for your context; see node's technical documentation for integration services details:
 <code c> <code c>
 +#define CoAPport 5683
 +#define CoAPpath "<here comes CoAP service path, without header, IP and port>"
 IPAddress coapExtSeviceIP(a,b,c,d); IPAddress coapExtSeviceIP(a,b,c,d);
 </code> </code>
 +<note tip>The ''CoAPpath'' is just a path part of the URI, e.g. if your CoAP service URI is: 
 +<code> 
 +coap://your_coap_server:9876/path_to_the_service/and_another_path 
 +</code> 
 +then your ''CoAPpath'' should be declared as: 
 +<code c> 
 +#define CoAPpath "path_to_the_service/and_another_path" 
 +</code></note>
 === Step 4 === === Step 4 ===
 Declate communication objects: Declate communication objects:
Line 91: Line 100:
  
 === Step 7 === === Step 7 ===
 +Make a call (GET) request to the service. Remember to provide the correct URI part.\\
 +Mind that the last argument of the function is a "path" part of the URI.
 +The laboratory technical documentation provides a list of the services, their URIs (including paths), methods, and IP ports.
 +<code c>
 +int msgid = coap.get(coapExtSeviceIP,CoAPport,CoAPpath);
 +</code>
 +
 +=== Step 8 ===
 Process CoAP services in the ''void loop()'': Process CoAP services in the ''void loop()'':
 <code c> <code c>
en/iot-open/practical/hardware/sut/esp32/iot_6.txt · Last modified: 2024/05/07 12:58 by pczekalski
CC Attribution-Share Alike 4.0 International
www.chimeric.de Valid CSS Driven by DokuWiki do yourself a favour and use a real browser - get firefox!! Recent changes RSS feed Valid XHTML 1.0