Example Embedded Applications
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 point with this simple application is only to demonstrate the very basic plumbing so access control is omitted for simplicity.
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.
The private key in
simple_coap.c must be replaced with a freshly generated one, e.g. using:
openssl ecparam -genkey -name prime256v1 -out key.pem
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
Or you can try the iOS Hello World CoAP app