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.

    MagicMirror and adruino over ethernet

    Scheduled Pinned Locked Moved General Discussion
    26 Posts 3 Posters 6.9k 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.
    • K Offline
      Kereknjek
      last edited by Kereknjek

      Hello, everyone!
      I’m new here and to java programming. So I’ll have a lot of questions…

      I’m in process of buinding MagicMirror as a door for my electrical cabinet in my house.

      Anyway, I have build my own solar system using store bought solar panels and charge controller. Batteries are pulled from electrical forklift (460 kg) and as inverter, I’m using pure sine wave UPS used for powering servers in company I work at.

      To manage the system I’m using arduino nano wich is measuring panel voltage and current, battery voltage, battery current and current direction, inverter current, inverter temperature, and charge controller temperature.
      Data is transfered to arduino mega via rs485 located at my electrical cabinet. There arduino mega measures power usage and switches devices between solar and mains acording to load so battery doesent fall under 90% and maximum posible power produced by solar panels is used.

      Arduino mega, located at electrical cabinet, is running HTTP server to wich I can connect from my PC or mobile to view current status, statistics and errors.

      Now I want to make module for MagicMirror to display that data.

      Allso, I’m upgrading my natural gas heating system. I’m adding wood furnace and solar collectors. System will use similar management based on arduino and will probably be connected to MagicMirror.

      My problem is that I have no idea how to make javascript connection to arduino, nor how to send requests. But I can make responses from arduino in any format.

      P.S.
      Incidently, my surname is Magic. :smiling_face_with_sunglasses:

      S 2 Replies Last reply Reply Quote 0
      • S Offline
        sdetweil @Kereknjek
        last edited by

        @Kereknjek I would see this module… MMM-ArduPort and how to send data from the arduino to the pi via serial

        I also had added an http server to my arduino ESP8266 NodeMCU and provided apis for data access as another route, which keeps the devices from having to be physically wired together

        Sam

        How to add modules

        learning how to use browser developers window for css changes

        1 Reply Last reply Reply Quote 0
        • S Offline
          sdetweil @Kereknjek
          last edited by

          @Kereknjek said in MagicMirror and adruino over ethernet:

          Arduino mega, located at electrical cabinet, is running HTTP server to wich I can connect from my PC or mobile to view current status, statistics and errors.
          Now I want to make module for MagicMirror to display that data.

          how do you ‘view’ that

          Sam

          How to add modules

          learning how to use browser developers window for css changes

          S 1 Reply Last reply Reply Quote 0
          • S Offline
            sdetweil @sdetweil
            last edited by sdetweil

            @sdetweil if u want to send requests (in code) to the arudino web server, its just a the nodejs request library

            see https://www.npmjs.com/package/request

            you could use my sample module. https://github.com/sdetweil/SampleModule
            there are also modules that will show ae existing page, MMM-IFrame

            Sam

            How to add modules

            learning how to use browser developers window for css changes

            1 Reply Last reply Reply Quote 0
            • K Offline
              Kereknjek
              last edited by

              Arduino sends data formated as simple HTML page. Pure text.

              1 Reply Last reply Reply Quote 0
              • K Offline
                Kereknjek
                last edited by

                Thank you!
                I’ll need some time to digest all the info you have provided. :smiling_face_with_open_mouth_cold_sweat:

                S 1 Reply Last reply Reply Quote 0
                • S Offline
                  sdetweil @Kereknjek
                  last edited by

                  @Kereknjek no problem… come on back, there is all kinds of help around

                  Sam

                  How to add modules

                  learning how to use browser developers window for css changes

                  1 Reply Last reply Reply Quote 0
                  • K Offline
                    Kereknjek
                    last edited by

                    @sdetweil said in MagicMirror and adruino over ethernet:

                    @Kereknjek I would see this module… MMM-ArduPort and how to send data from the arduino to the pi via serial

                    I also had added an http server to my arduino ESP8266 NodeMCU and provided apis for data access as another route, which keeps the devices from having to be physically wired together

                    Your MMM-ArduPort module looks EXACTLY like what I had in mind!
                    I’ll give it a detailed examination. :D

                    1 Reply Last reply Reply Quote 0
                    • K Offline
                      Kereknjek
                      last edited by

                      I think that this is way to extensive for my knowledge. I can’t make heads or tails out of it…

                      S 1 Reply Last reply Reply Quote 0
                      • S Offline
                        sdetweil @Kereknjek
                        last edited by

                        @Kereknjek basically the arduino sends text strings with Serial.println(“[COMMAND:NAME:DATA]”)

                        To transmit a sensor data to the module: `[sensor:SENSOR_NAME:SENSOR_VALUE]**

                        Example:

                        Serial.println(“[sensor:MQ2:19]”);
                        Serial.println(“[sensor:LM35:11]”);
                        Serial.println(“[sensor:HCSR04:64]”);

                        but anyhow, lots of work in the arduino code to make this work

                        Sam

                        How to add modules

                        learning how to use browser developers window for css changes

                        K 1 Reply Last reply Reply Quote 0
                        • 1
                        • 2
                        • 3
                        • 1 / 3
                        • 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