Please read the release notes carefully since this update requires adjustments to your Raspberry Pi configuration!
Displaying data from a CSV file saved on my Pi?
nbrenn last edited by nbrenn
I managed to connect my Raspberry Pi to a MySQL Database to retrieve some data from a database table. The file is then saved on my Raspberry Pi as a .csv, and I would like to display the data on my Mirror.
The data contains time-series data from a remote temperature sensor, and I will try to update the query every few hours. The data has a column for the Time-Stamp and a column for the reading itself. I’d probably just have the output be a sentence like, “The temperature is X degrees” where X is taken from the .csv file.
In my mind, I believe that I need to create an HTML document object that retrieves the data from the file, and then displays it. Is this a method that would be best for my application?
Basically, how do I take the following code and turn it into code for the Magic Mirror?
cowboysdude last edited by
My suggestion and I am not a true programmer is …
What I’ve done is go into the default module directory and find something like the compliments module and see how the structure is built.
This really a nodejs thing…
innerhtml is where you’d put your html
and as for the js itself you could check to see how they are getting their data from the file itself and replicate that but instead using your CSV file instead…
we have ongoing conversation about getting this done in this topic https://forum.magicmirror.builders/topic/1515/how-to-load-a-script-src-script-into-my-mirror
@nbrenn are you ok if I lock this topic and we will keep going in the thread mentioned above?
nbrenn last edited by
@morozgrafix That’s fine with me! Thanks!