Example Embedded Applications
All examples prefixed with
simple_ are minimal examples of the specific subject, omitting all access control and other complexities. For a thorough example demonstrating access control, see the heat pump example or the full Nabto Edge Tunnel app.
Corresponding example clients for all of the above examples are available in the nabto-client-sdk-examples github repo. The embedded application can be used with the Nabto Edge Tunnel CLI client tool.
Hello, World! CoAP Service
This example is a simple Hello, World! style Nabto Edge Embedded SDK application. It is located in examples/simple_coap in the SDK repo. The other
simple_ examples are built an run in a similar way.
The application is a simple CoAP service, that
GET request at the path
/hello-world. It replies with a string payload that says
“Hello, world!” back to the client.
Building and running
Follow the general build instructions on the Embedded SDK intro page to build the Hello, World CoAP service.
To run the application, execute the following in a terminal:
Invoking CoAP service from a Nabto Edge client
You can use the corresponding simple CoAP commandline client:
$ ./simple_coap_get -H https://pr-vcizvpox.clients.nabto.net \ -p <product id (pr-...)> \ -d <device id (de-...)>\ -s <server key (sk-...)\ -r '/hello-world' connecting to pr-udnromc7.de-g9caq9qv Created a new connection Connected to device with fingerprint: 3b7144c34e4e1cd8821e641997110631 Sending CoAP GET request Sending coap get-request:/hello-world Received CoAP response data: Hello world freed connection