First line contains template version. In this case it is „rut955-v0.01“.
When template is updated, version must be updated aswell, otherwise device will use non-updated template version.
The following lines contains requests starting with a number „10“ and responses - starting with a number „11“. Now explanation of request:
Type - 10
Code - 101
Method - POST
URL - /inventory/managedObjects
Content Type - application/json
Accept - application/json
Placeholder - %%
Params - STRING STRING
Template - JSON
Type – requests are identified by a number 10
Code – request code number, each request must contain unique number
Method – HTTP method of request
URL – URL that will be used in request
Content Type – it is Content-Type header field value
Accept – it is Accept header field value, mostly equal to Content Type
Placeholder - string which will be replaced in URL or Template JSON
Params – what kind of params are replaced, JSON template contains two strings
Template – JSON template which will be sent
Explanation of response:
Type - 11
Code - 502
Cond - <none>
Value 1 - $.c8y_Restart
Value 2 - $.id
Value3 - $.deviceId
Type – responses are identified by a number 11
Code – response code, each response must contain unique number
Cond – JSON path base pointing to an object or object list from which values are
extracted
Value… - JSON values
Take a look for more information about templates: https://www.cumulocity.com/guides/reference/smartrest.
Now explanation of logic inside lua script. By default, example application’s lua script location is „/usr/bin/lua/cm“. Application will scan this folder for any *.lua files and load them if they contains „init“ function. Script’s „stream.lua“ content:
By using „c8y:send“ function, first string contains request code, which was defined in the template, earlier. Then comma must appear after each value. The above line shows how we update device name and device type with our own.
For more information about Lua API, download Cumulocity C++ SDK: https://bitbucket.org/m2m/cumulocity-sdk-c/downloads and look up inside „sdk/doc/lua.html“ with a browser.
==External Links==
==External Links==
Revision as of 16:05, 27 November 2019
Telekom Cloud of Things is now compatible with Teltonika RUT routers.
Description
The Cloud of Things is cloud platform for the Internet of Things. It allows you to remotely monitor, manage and control your connected devices and machines – plug-and-play, without extensive installation.
Summary
This example application streams some information from the router device. Once it is enabled you should be able to the following things in Cloud of Things Cockpit the following information from your router:
Device Model, Revision and Serial Number
Mobile Cell ID, ICCID, IMEI, Connection Type, Operator, Signal Strength
WAN Type and IP
Mobile and WAN information are sent from “stream” Lua script, while Device information - from stream application. This information (except Device) is being sent to the main Cumulocity server continuously: at 10 seconds interval.
????????????????????????????????
Creating an account
First of all, you need to create an account. After registration, you will receive free 60 days Cloud of Things trial. Registration form can be found here: https://support.ram.m2m.telekom.com/apps/demotenant/index.html#/ . Below you can see registration form:
After successful registration you will receive an email with your account details (URL, username, password) and after logging in, you will be redirected to Cloud of Things Cockpit portal, see below:
Package installing and device registering
Cloud of Things IoT platform is not included in standart software package. So it order to use it you will need to install it first. Go to System>Package Manager.
There you will find all the available packages. The one you need is called Cloud of Things. In order to install it press Install button.
Then it will ask your confirmation, whether you want to install the package. Press OK to continue.
It will take a moment to install, but when it is done, you will receive a message.
When the package is installed, a new window in Services section will appear, IoT Platforms.
In order to use the feature you will need to enable it, write Server Address and press Save. The server address is the link which was provided by Cloud of Things.
(E.g. example.example.example.telekom.com)
P.S. In order to re-register a device on Cloud of Things platform, you need to press Reset Auth button. If you are registering the device for the first time, pressing the button is not necessary.
Adding devices on Cloud of Things platform
After successfully installing the package and making the required configuration on the router, you now can add the device on Cloud of Things platform. After logging in to the website you are forwarded to Cockpit page. There press Device manager.
Then select Devices and press Registration.
Press Register device.
There are two ways to register your device(s) Bulk and General. Bulk is used when you are registering a lot of devices at once. In this example we will be using the General option.
In Device ID section write the serial number of your router. You can add more than one item by pressing Add another device button. There is a possibility to assign your routers to groups, but we are not doing that in this example.
If everything was done correctly, it will show you that the registration was successful.
Then you will need to Accept the Pending Acceptance.
Finally you will receive a message showing that the device has been accepted.d.
Click „Accept“ button to accept this device.
Now navigate to „All devices“ page:
Here you should be able to see list of all registered devices:
Click on „TLT-RUT955 Router“ name to get into information page:
Notice „Device Data“ widget, it contains information from the router device. By navigating to „Control“ tab, you can restart device by clicking „More → Restart Device“:
You can go back to Cumulocity Cockpit page the same way you entered Device managemant page:
Then navigate to „Home“ page:
And then click „Add widget“:
Select „Asset properties“ widget and type title, then select „TLT-RUT955 Router“ in „Target Assets or Devices“:
To add more information into widget, click „Add property“ and click on „Show“ to add that property.
In example application, these properties are used:
Hardware – Model, Revision, Serial Number
Mobile – Cell ID, Connection Type, Current Operator, ICCID, IMEI and Signal
WAN – IP and Wan Type
Total properties:
Then click „Save“ and you should be able to see widget with properties you have set:
Any of the trademarks, service marks, collective marks, design rights or similar rights that are mentioned, used or cited in the articles are the property of their respective owners.