MagicMirror² v2.13.0 is available! For more information about this release, check out this topic.

Displaying data from a CSV file saved on my Pi?

  • Hi all,

    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?

  • Project Sponsor Module Developer

    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… 🙂

  • Moderator

    we have ongoing conversation about getting this done in this topic

    @nbrenn are you ok if I lock this topic and we will keep going in the thread mentioned above?

  • @morozgrafix That’s fine with me! Thanks!

Log in to reply