It is possible to connect your own eWON device to Databoom through the Data Management functionality (available since firmware 5.6s3).
If the firmware doesn't have this function (old versions), it is still possible to forward data writing a brief Script.
Independently of the choice, you need to follow some steps:
- Create a new device in Databoom choosing the type eWON in Devices -> Add device
- Click on the new device from the list of devices
- The device detail appears, here you can find the token generated for that device
- Note the token to use it in the eWON configuration
- Click on your profile image in the top left
- In your profile look for your API key and copy its last 10 characters with the by clicking the proper button
- Now follow the next instructions
Tag Setup in the eWON
In order for the data to be forwarded correctly, in Configuration -> Tag Setup, ensure yourself that at least a group (Group A/B/C/D) is assigned to the tag and that the Historical Logging is enabled.
Once you have created the device on the platform, simply go to the eWON management page (from the browser, typing the eWON IP address) and go to Configuration -> System Setup -> General -> Net Services -> Data Management.
Form fields must be filled as follows:
- eWON Data Management ID, the token generated by Databoom for the device (visible in the detail page);
- Password, the last 10 characters of the device creator's API key (visible in the user profile);
- Server URL, deedicated Databoom server address is ewon.databoom.com, on port 8080, so we use ewon.databoom.com:8080;
- Upload interval, Databoom uses a minimum interval of 1 minute between one value and the next one, other values will be ignored.
- Select tag group(s), while creating a variable in Tag Setup, it is required to specify one or more groups of belonging. Only the tags belonging to the selected groups will be forwarded to the server.
WARNING! If no group has been selected or the variables have no group of belonging setted, no data will be sent.
If the functionality is active, Databoom automatically detects the NTP settings of the eWON. Data will be stored using the time offset specified, and the parameters stored in the device on the platform. You must set offset according standard time (winter time). For example, if you want your eWON to record data with the Italian timezone, the time offset required is -1.00 (that is UTC+01:00) regardless daylight saving (summer time).
If the functionality is disabled, you can still set an offset in Databoom while creating the device or in the settings in the edit screen of the same device.
WARNING! In order to record data correctly, if NTP is enabled, ensure yourself the time offset used in the eWON configuration to be the one you need; if NTP is disabled, ensure yourself the time offset used in the configuration of the device in Databoom to be the one you need. If no time offset is specified, eWON local time (except of UTC+00:00) cause inconsistency in the recorded data.
WARNING! After enabling NTP setting, is strongly recommended to run the ntpsync command from the script section to first sync the clock.
Through eWON Data Management function, the tags values are sent. You can follow two approaches:
- No signals created ADVISED CHOICE, in this case a new signal is created for each forwarded tag.
- Creation of apposite signals, in Databoom it is possible to create signals rappresenting the tags of the device before the connection. In this case, in order to match data, it's required to edit their token following the model <DEVICE TOKEN>.<ID TAG>.<TAG NAME>. The <DEVICE TOKEN> is available in the device details page, the <TAG NAME> is the name of the tag, viewable in the eWON in the list at Configuration -> System Setup, while <ID_TAG> is available in var_lst.txt or var_lst.csv on the eWON in Files Transfer.
WARNING! Once the signals have been created in Databoom, any edits on the tags in the eWON is not reccomended as the token mismatch leads to the creation of new signals.
Data Forwarding Script
Go to the eWON management page (from the browser, typing the eWON IP address) and go to Configuration -> Script Setup. To forward your device tags you have to perform the following steps:
- Init section, in the "Init" section create a timer for the execution of the "Post" section, that will do the actual data forwarding. We will have:
ONTIMER 1,"goto Post"
- Post, create a new section "Post", that will contain the script part performing the request. The code must follow the model:
b$ = "apikey=<API KEY>"
b$ = b$ + "&device=<DEVICE TOKEN>&date=" + TIME$
b$ = b$ + "&name=<SIGNAL TOKEN 1>&value=" + STR$ <TAG NAME>@
b$ = b$ + "&name=<SIGNAL TOKEN 2>&value=" + STR$ <TAG NAME>@
REM ... altre tag
PUTHTTP "<SERVER DATABOOM>", "/script",b$, "","POST failed"
The example has two tags, you can add more by following the same procedure. REM is a comment, you can remove it or replace it with other tags.
Once the procedure has been completed, Databoom starts to record data from the eWON. To examine your data and have a correct representation, follow the instructions in Edit/validation of a signal.
It is possible to remote control eWON signals from Databoom, follow the instructions in the proper article.