Examples

Hello, World! Coap Client

A simple Hello, World! style example using Nabto Edge CoAP is available in artifacts repository. It demonstrates how all necessary plumbing to get started with your own apps.

Building

The below (overly) simple build process assumes you checkout the complete artifacts repository - this is more than 100 MB data, so consider picking the specific libs you need and change the build script accordingly if on a slow connection.

git clone https://github.com/nabto/nabto5-releases.git
mkdir _build
cd _build
cmake ../nabto5-releases/5.1/nabto-client-sdk/
make -j

Running

Start a CoAP Nabto Edge embedded device application to invoke first.

Then invoke the compiled hello world client towards the device as follows. See the Nabto Edge Embedded SDK applications guide for information on how to obtain the necessary configuration data (ids, key, url):

$ ./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

TCP Tunnel Client

A simple example of using the Nabto Edge Tunnels client API is available in the artifacts repository.

Build and run the client as described in the README. Run towards a Nabto Edge Embedded SDK based TCP tunnel, such as TCP Tunnel Device supplied with the Nabto Edge Embedded SDK.