Measuring the temperature while transporting

At this point, we will simulate temperature measurements during transportation.

We created the following commented code in the IoT application code because we are handling transportation gathering data at two different points in time.

The first is when a FoodBox is transported from the Factory to the Warehouse, which is implemented by the updateFoodBox function, while the updatePallet function is aimed at processing the transportation from the Warehouse to the store:

appClient.on("deviceEvent", function (deviceType, deviceId, eventType, format, payload) {
// update food box
// updateFoodBox(payload.temperature);
// update pallet
// updatePallet(payload.temperature);
});

At this point, we are handling the transportation from the Factory to the Warehouse, so uncomment line 19 of the code—updateFoodBox(payload.temperature);— and then update lines 30, 34, 35, and 36, providing the correct values for the data. 

Ensure that the Composer REST server for the transporter is up and running and that the URLs defined in lines 2 and 3 of the device code are pointing to the correct Composer REST server host.

Start the device application.

..................Content has been hidden....................

You can't read the all page of ebook, please click here login for view all page.
Reset
3.145.64.132