Go to https://remotemanager.digi.com/ and login with the account you used for the simulation. All the simulated devices are listed and online.
All the operations in this step can be performed using Remote Manager web interface tools or using web service APIs from API Explorer, your own application, or a third party tool, such as curl .
|
Let’s check the features of the simulated devices, as listed in the configuration files:
1. Inspect device location
In the simulation, a route has been provided to the trucks, truck_routes
, so all devices appear as if they were moving.
To check the current location of simulated trucks:
-
Go to the Device Management > Devices tab.
-
Click on a simulated device.
-
The latitude and longitude settings are filled up. Also, you can inspect the geo-location of your device in the map on the right side of that screen.
-
Finally, check the location of all of your devices
-
Go back to Device Management > Devices.
-
Click the Map view button on the top left next to Search text box. A map is displayed with all the devices of your account.
-
2. Access device file system
Another feature in the simulation is the configured file system, file_system_01
.
You can operate with it as you would do with a real device.
To check if the file system contains the expected files:
-
Go to the Device Management > Devices tab.
-
Click on a simulated device.
-
Select the Files option.
You can navigate through the file system and use the upper button bar to upload, download, or remove a file; refresh the view; and go back, forward, home, or to a specific location.
3. Update simulated device firmware
The simulation allows devices to perform remote firmware updates. Our simulated trucks are based on ConnectCore modules, so, to program a new firmware we must:
-
Upload the firmware to Remote Manager firmware repository.
-
Select System > Firmware on the left bar.
-
Go to the Custom Device Firmware tab.
-
Click Add Firmware button to open the wizard.
-
Fill the fields to identify this firmware in the repository. Main parameters are:
-
Select the Vendor ID called Digi ConnectCore (0xFE080003).
-
Choose the Device Type of the devices you are going to update with this firmware,
refrigerated-truck
. -
Enter the Firmware Version of this package,
1.0.0.2
. -
Type the URL of the firmware Release Notes, for example,
https://www.digi.com
.
-
-
Upload to the repository your update package:
-
Download this file (1.0.0.2.swu) to your computer, or use your own
swu
package. -
Click Add files.
-
Browse in your local file system for the update package (
.swu
).
-
-
Finally, click Add to upload the firmware to Remote Manager repository. When the upload process finishes, a new entry is added to the table.
-
-
Update the device:
-
Go to the Device Management > Devices tab.
-
Select the checkbox on the left of one or several simulated devices.
-
Click the Actions drop-down menu on the top-right corner of the list of devices.
-
Scroll down to find Update firmware option and click it.
-
In the Update Firmware wizard, select 1.0.0.2 (custom) from the combo box list.
-
Click Update.
-
You can wait for the update to finish in the wizard, or go to the API Explorer and use
v1/firmware_updates
API to get the progress:-
Get the device ID of one of the devices being updated. It follows the format
000A0003-XXXXXXXX-FF0FF0FF-FF0FF00X
.-
Go to the Device Management > Devices tab.
-
Copy the Device ID of your device from the table by using the Copy Device ID button that appears next to it when you hover over the item.
-
-
Go to the System > API Explorer tab.
-
Click the Examples combo.
-
Select v1/firmware_updates > Get firmware update progress.
-
Modify the request path with your device ID. It should be something similar to:
/ws/v1/firmware_updates/progress/000A0003-XXXXXXXX-FF0FF0FF-FF0FF00X
Where
000A0003-XXXXXXXX-FF0FF0FF-FF0FF00X
is your device ID. -
Click Send. The response indicates the update progress status:
{ "id": 1, "customer_id": XXXX, "device_id": "000A0003-XXXXXXXX-FF0FF0FF-FF0FF00X", "progress": [ { "status": 5, "time": "2023-09-22T12:53:10.139Z", "message": "Sending Data: 4540912 out of 204946944 bytes sent" }, { "status": 0, "time": "2023-09-22T12:51:15.845Z", "message": "Sending Download Request" } ] }
Where
000A0003-XXXXXXXX-FF0FF0FF-FF0FF00X
is your device ID.
-
-
4. Monitor uploaded data
As configured in the simulation, simulated trucks upload outside and inside temperature values as data streams, following what is configured in data_streams/streams.json
:
-
<device_id>/temp_outside
contains random doubles between 20C and 30C starting with 25C. This value is generated by the simulator every 2 minutes. -
<device_id>/temp_inside
contains random doubles generated by custom Python code every 30 seconds.
Data points are stored and uploaded in a batch every 150 seconds as it is configured in the profile profiles/trucks.json
.
To check all this data:
-
Get the device ID of one of your simulated devices. It follows the format
000A0003-XXXXXXXX-FF0FF0FF-FF0FF00X
.-
Go to the Device Management > Devices tab.
-
Copy the Device ID of your device from the table by using the Copy Device ID button that appears next to it when you hover over the item.
-
-
Go to the Insights > Data Streams tab.
-
Paste the copied device ID in the search box and press Enter. The list of all streams associated to that device appears below. There may also be some streams starting with
000A0003-XXXXXXXX-FF0FF0FF-FF0FF00X/management
for maintenance status and device connections and one more000A0003-XXXXXXXX-FF0FF0FF-FF0FF00X/metrics/sys/location
, for the current location of the device as we are simulating a route.
5. Send data to simulated devices
The simulated refrigerated trucks allow to remotely manage their inside temperature with a request with target change_temp
, configured in device_requests/requests.json
.
To set a new temperature, follow these steps:
-
Go to the Device Management > Devices tab.
-
Get the device ID of one of your simulated devices. It follows the format
000A0003-XXXXXXXX-FF0FF0FF-FF0FF00X
.-
Go to the Device Management > Devices tab.
-
Copy the Device ID of your device from the table by using the Copy Device ID button that appears next to it when you hover over the item.
-
-
Go to the System > API Explorer tab.
-
Click the Examples combo.
-
Select SCI > Data Service > Send Request. A request appears inside the Body text box.
-
Modify the request to test:
-
Replace the
device id
value with the copied one. -
Replace the
target_name
value with the target to use,change_temp
. -
Remove the payload of the request, and add a new temperature between 0.0 and 10.0, for example 4.0.
The request should be similar to the following:
<sci_request version="1.0"> <data_service> <targets> <device id="000A0003-XXXXXXXX-FF0FF0FF-FF0FF00X" /> </targets> <requests> <device_request target_name="change_temp">4.5</device_request> </requests> </data_service> </sci_request>
Where
000A0003-XXXXXXXX-FF0FF0FF-FF0FF00X
is the device id of the truck to change its inside temperature.
-
-
Click Send to send the request to your device.
In the Response text box you can review the answer from the device:
<sci_reply version="1.0"> <data_service> <device id="000A0003-XXXXXXXX-FF0FF0FF-FF0FF00X" /> <requests> <device_request target_name="change_temp" status="0">New target temp for '000A0003-XXXXXXXX-FF0FF0FF-FF0FF00X': 4.5C</device_request> </requests> </device> </data_service> </sci_reply>
Where
000A0003-XXXXXXXX-FF0FF0FF-FF0FF00X
is your device id. -
At this moment, the inside temperature of the truck starts to change to get the configured target, 4.5C. You can review it following the steps in Monitor uploaded data. You can review
simulation.py
file ofgs-sample
to check how received request is managed and new values of000A0003-XXXXXXXX-FF0FF0FF-FF0FF00X/temp_inside
generated.
For more information on custom code see Custom code implementation. |