Professional Documents
Culture Documents
This
document is showcases how LWM2M Client(SmartWatchClient or any other
client) that host REST based LWM2M servers can interface with Azure IoT Hub
using Eclipse Leshan. This tutorial uses Leshan version1.0.0-M13.
Iii. Run the project as Java Application LeshanClientDemo . This device object
registers directly with the LwM2M server i.e,. REST Based Spring Boot
application, The device is connected to the server till it gets De-
registered(LeshanClient stops). Same process of registration can be applied for
any number of devices
f. Under the Installed JREs menu, which is the Execution Environment menu, set
the compatible JRE for JavaSE-1.8.
GET http://server_ip_address/devices
This API returns a JSON file describing all the clients registered in the Leshan
POST http://server_ip_address/devices/registrations/push
This API pushes a JSON file describing all the clients registered in the Leshan to
Azure IoT Hub.
GET http://server_ip_address/devices/observe
This API returns a JSON file describing the value of a resource
DELETE http://server_ip_address/devices
This API deletes the resource returns the status.
PUT http://server_ip_address/devices
This API updates the value of a resource.
POST http://server_ip_address/devices/updates/push
This API pushes updated value of a resource to Azure IoT Hub.
Resource - each Object Instance of a given Object supports the same set of
Resources, as defined by the Object definition.
For example, a path /3/4/1 refers to Resource ID=1 in Object Instance ID=4 of
Object ID=3.
The required parameters that needs to be passed for the above API's are
configured in Postman.
d. From the Azure portal create an IoT Hub. Once the IoT Hub is available use
the connection string in ConnectionBroker.java class. This connection string is
Used mainly for managing devices. Format of Connection String:
HostName=<HostName>;SharedAccessKeyName=<Key
Name>;SharedAccessKey=<SAS Key>
f. Alternative to above step, we have developed HTTP based RestClient With the
help of which we can publish the response from Leshan Server to Azure IoT
Hub.