Historical data from sensor presented in the app

Developer
Apr 16, 2015 at 6:35 PM
Edited Apr 16, 2015 at 6:41 PM
Hi,

My driver logs temperatures from the Gadgeteer sensor to the CSV file (stored in output\Data folder)...and I wanted to display it and refresh it in the Thermometer app.

Is it possible to access this file from the ThermometerApp code (by writting javascript loading data functionality inside index.html for example) or I have to expose that information from driver api (by adding some HistoricalDataRole, register it to driver that notifies the app and then sends all the historical data from file as a parameter)?

Best regards,
Kamil
Coordinator
Apr 16, 2015 at 8:12 PM

If you are willing to “break the architecture,” anything is possible J Your app can read the file that the driver is writing.

But I would recommend the “proper way,” a role based interaction between the driver and app. In addition to the option you describe, you could simply have the driver stream all data to the app (using notifications) and the app could keep its own history.

Cheers.

Developer
Apr 20, 2015 at 10:54 PM
Edited Apr 20, 2015 at 10:55 PM
Thanks for the response - it is as I thought;)

OK, so a moment ago I commited some changes accordring to displaying the historical temperatures, too. Right now it displays the temperatures gathered at the client side using the ChartJS library (user can turn it on or off by using checkbox). I have commited also the change that the driver can log the data to the CSV file - by default it is disabled, but it works. I started to write (commited) some API for role based interaction to send some data from the file but it is not used right now.

Best regards,
Kamil
Coordinator
Apr 20, 2015 at 11:14 PM

Great J