Change the unit of temperature in the DustLink Dashboard

The DustLink dashboard shows the temperature of the different motes in C. This recipe shows you how to change this to raw 1/100 C readings.

This howto applies to DustLink REL-1.0.2.


You only need to make 2 changes:

First change

In DataConnector/, line 159, change

temperature_C = float(data['fields']['temperature'])/100.0


temperature_C = data['fields']['temperature'] is the Python module on the server which contains the data to be displayed on the dashboard. The original line turns the raw temperature (an integer in units of 1/100 C) into a floating point value in C.

Second change

In views/web/dustWeb/static/dashboard/dashboard.js, line 492, change




dashboard.js is the Javascript code running on the browser which creates the graphical dashboard. The original line formats the temperature data received from the server as a float with 2 digits following the decimal point, and appends the "C" unit.