MagicMirror Forum

    • Register
    • Login
    • Search
    • Recent
    • Tags
    • Unsolved
    • Solved
    • MagicMirror² Repository
    • Documentation
    • Donate
    • Discord
    MagicMirror² v2.25.0 is available! For more information about this release, check out this topic.

    MMM-Arduport trouble

    Troubleshooting
    2
    5
    228
    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.
    • G
      glorianneef last edited by

      Hello! So I am simply trying to run this module and I am just making my arduino code send the number “17” just to test. As you can see, when I run my python code, it receives this message correctly. Below is my config file

       {
                  module: "MMM-ArduPort",
                  position: "bottom_right",
                  header: "MMM-ArduPort",
                  config: {
                      portname: "/dev/ttyACM0",
                      displayIcons: true,
                      showDescription: true,
                      hideLoading: true,
                      hideWaiting: true,
                      useColors: true,
                      sensors: 
                          {
                              name: "Timer",
                              description: "LPG, Propane, Hydrogen",
                              maxValue: 19,
                              maxFormat: "({0} cm) TOO FAR",
                              highestValue: 30,
                              highestFormat: "({0} cm) FAR",
                              highValue: 15,
                              highFormat: "({0} cm) NORMAL",
                              lowValue: 10,
                              lowFormat: "({0} cm) CLOSE",
                              lowestValue: 5,
                              lowestFormat: "({0} cm) TOO CLOSE",
                              minValue: 0,
                              minFormat: "({0} cm) OK"
                          }
                  }
              },
      
      

      As you can see when I start

      npm start dev
      

      I get a plethora of errors in which I have no idea how to fix. Any help would be super appreciated.
      2021-02-12-192811_1184x624_scrot[9806].png 2021-02-12-193400_1184x624_scrot[9807].png

      Also here is my arduino code (almost exactly like the one supplied by MMM-arduport git page:

      volatile int32_t m_counter = 0;
      bool WasStarted = false;
      
      static const char *pcMQ2Prefix = "[sensor:Timer:";
      static const char *pcPostfix = "]";
      
      void setup() {
        Serial.begin(9600);
        while(!Serial);
        
        Serial.println("[status:setup:starting]");
        
        int test = 1;
        m_counter = test;
      
        if(test > 1) {
          WasStarted = false;
          Serial.println("[status:setup:failed]");
          return;
        }
        
        delay(3000);
        WasStarted = true;
        Serial.println("[status:setup:started]");
        delay(100);
      }
      
      void loop() {
        //Serial.print(pcMQ2Prefix);
        //Serial.print(m_counter);
        //Serial.println(pcPostfix);
      Serial.println("[sensor:Timer:19]");
        if(m_counter % 3 == 0) {
          delay(1000);
          delay(2000);
        }
      
        if(m_counter >= 60) m_counter = 0;
        m_counter++;
      
        delay(1000);
      }
      
      S 1 Reply Last reply Reply Quote 0
      • S
        sdetweil @glorianneef last edited by sdetweil

        @glorianneef your sensors definition is incorrect

        it should be From
        https://github.com/Dentrax/MMM-ArduPort

        sensors:[
        // for each sensor
        {
             name:"?????",
             description:"???????",
             ...
             ...
        },
        
        ...
        ]
        

        Sam

        Create a working config
        How to add modules

        G 1 Reply Last reply Reply Quote 0
        • G
          glorianneef @sdetweil last edited by

          @sdetweil The only difference I see between that and mine is the extra

            [ .....
          ]
          

          added correct? I added the square brackets and I was still given the same errors

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

            @glorianneef ok can u show the errors there and any in the terminal window where u npm start

            Sam

            Create a working config
            How to add modules

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

              @glorianneef also, there was an error when u ran the python script, to_node not found. did u install all the python dependencies?

              Sam

              Create a working config
              How to add modules

              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 Paul-Vincent Roll and Rodrigo Ramírez Norambuena.
              This forum is using NodeBB as its core | Contributors
              Contact | Privacy Policy