MagicMirror Forum
    • Recent
    • Tags
    • Unsolved
    • Solved
    • MagicMirror² Repository
    • Documentation
    • 3rd-Party-Modules
    • Donate
    • Discord
    • Register
    • Login
    A New Chapter for MagicMirror: The Community Takes the Lead
    Read the statement by Michael Teeuw here.

    Displaying data from a CSV file saved on my Pi?

    Scheduled Pinned Locked Moved Development
    4 Posts 3 Posters 3.6k Views 3 Watching
    Loading More Posts
    • Oldest to Newest
    • Newest to Oldest
    • Most Votes
    Reply
    • Reply as topic
    Log in to reply
    This topic has been deleted. Only users with topic management privileges can see it.
    • nbrennN Offline
      nbrenn
      last edited by nbrenn

      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?
      https://bl.ocks.org/ndarville/7075823

      1 Reply Last reply Reply Quote 0
      • cowboysdudeC Offline
        cowboysdude Module Developer
        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… :)

        1 Reply Last reply Reply Quote 0
        • morozgrafixM Offline
          morozgrafix Moderator
          last edited by

          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?

          nbrennN 1 Reply Last reply Reply Quote 0
          • nbrennN Offline
            nbrenn @morozgrafix
            last edited by

            @morozgrafix That’s fine with me! Thanks!

            1 Reply Last reply Reply Quote 0
            • 1 / 1
            • First post
              Last post
            Enjoying MagicMirror? Please consider a donation!
            MagicMirror created by Michael Teeuw.
            Forum managed by Sam, technical setup by Karsten.
            This forum is using NodeBB as its core | Contributors
            Contact | Privacy Policy