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.

    Is it possible to ad an Arduino?

    Scheduled Pinned Locked Moved Troubleshooting
    55 Posts 4 Posters 22.3k Views 4 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.
    • S Offline
      Shinji0912 @wishmaster270
      last edited by

      @wishmaster270 Wow thank you very much , im completly new to this and first of all this helps me out very much and im going to try to make my own module showing an API from our school , is it okay if i ask you questions when i need help?
      and btw. rrealllyy appreciate your help :)

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

        @sdetweil I tried the “Arduports” one but for some reason it didn’t worked for the sensors im using ^^

        S 1 Reply Last reply Reply Quote 0
        • S Do not disturb
          sdetweil @Shinji0912
          last edited by

          @Shinji0912 u have to have code running in the Arduino sending the data, doesn’t just happen

          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
            Shinji0912 @sdetweil
            last edited by

            @sdetweil I know I’ve set it up but it didn’t worked.

            S S 2 Replies Last reply Reply Quote 0
            • S Do not disturb
              sdetweil @Shinji0912
              last edited by sdetweil

              @Shinji0912 seems pretty simple, connect serial port for arduino to serial port for PI…

              arduino send 10
              https://www.arduino.cc/reference/en/language/functions/communication/serial/write/
              pi read 10
              https://www.npmjs.com/package/serialport

              u can test that without MagicMirror

              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
                Shinji0912 @Shinji0912
                last edited by

                This post is deleted!
                1 Reply Last reply Reply Quote 0
                • S Offline
                  Shinji0912 @sdetweil
                  last edited by

                  @sdetweil Thats my Current Arduino code :

                  volatile int32_t m_counter = 0;
                  bool WasStarted = false;
                  
                  static const char *pcDHT11Prefix = "[sensor:DHT11:";
                  static const char *pcPostfix = "]";
                  
                  void setup() {
                    Serial.begin(9600);
                    while(!Serial);
                    
                    Serial.println("[status:setup:starting]");
                    Serial.println("[sensor:DHT11:11]");
                    
                    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(m_counter + 11);
                    Serial.println(pcPostfix);
                  
                    if(m_counter % 3 == 0) {
                      delay(1000);
                      Serial.print(pcDHT11Prefix);
                      Serial.print(m_counter + 11);
                      Serial.println(pcPostfix);
                      delay(2000);
                    }
                    if(m_counter >= 60) m_counter = 0;
                    m_counter++;
                  
                    delay(1000);
                    
                    }
                  

                  and i got the ArduPorts running on the MM itself

                  now it is running but always searching for the module … see Picture.
                  alt text

                  S 1 Reply Last reply Reply Quote 0
                  • S Do not disturb
                    sdetweil @Shinji0912
                    last edited by sdetweil

                    @Shinji0912 and the config for the port ??

                                  config: {
                                    portname: "/dev/ttyUSB0",
                    

                    ls /dev | grep -i usb

                    I don’t see a ttyUSB0 on my pi4…
                    is that the right one on pi?

                    i would guess that is for a USB plugin serial port, not direct serial port…

                    I do have a /dev/serial1 (on all 3 of my pi devices, Pi0, Pi3, and Pi4)

                    Sam

                    How to add modules

                    learning how to use browser developers window for css changes

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

                      I have it plugged in on my Raspberyy Pi3 and the config on the Pi itself is

                      	modules: [
                       {
                      	          module: 'MMM-ArduPort',
                      	          position: 'bottom_right',
                                    header: 'Arduino Sensors',
                                    config: {
                                      portname: "/dev/ttyUSB0",
                                      updateInterval: 1,
                                      animationSpeed: 1000,
                                      displayIcons: true,
                                      showDescription: true,
                                      hideLoading: false,
                                      hideWaiting: false,
                                      useColors: true,
                                      sensors: [
                      {
                                              name: "DHT11",
                                              description: "Temperature",
                                              maxValue: 50,
                                              maxFormat: "({0}°C) VERY HIGH",
                                              highestValue: 30,
                                              highestFormat: "({0}°C) HIGH",
                                              highValue: 15,
                                              highFormat: "({0}°C) NORMAL",
                                              lowValue: 10,
                                              lowFormat: "({0}°C) LOW",
                                              lowestValue: 5,
                                              lowestFormat: "({0}°C) VERY LOW",
                                              minValue: 0,
                                              minFormat: "({0}°C) OK"
                                          },
                      ]
                                  }
                              },
                      

                      and im not pretty sure what u want to tell me (im not an native english speaker) i come from germany

                      S 1 Reply Last reply Reply Quote 0
                      • S Do not disturb
                        sdetweil @Shinji0912
                        last edited by sdetweil

                        @Shinji0912 said in Is it possible to ad an Arduino?:

                                    portname: "/dev/ttyUSB0",
                        

                        I think that is the wrong device name for the serial port on the pi. if you are using the gpio header pins

                        Ich denke, das ist der falsche Gerätename für die serielle Schnittstelle auf dem Pi. wenn Sie die GPIO-Header-Pins verwenden

                        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
                          Shinji0912 @sdetweil
                          last edited by Shinji0912

                          @sdetweil Im not using the Gpio header pins i have the Arduino connected to the Pi using usb?

                          S 1 Reply Last reply Reply Quote 0
                          • S Do not disturb
                            sdetweil @Shinji0912
                            last edited by sdetweil

                            @Shinji0912 i have never seen arduino connected via USB… none of my arduino devices have USB plugs

                            did u check the available device names on your pi?
                            from a terminal window do

                            ls /dev | grep -i usb
                            

                            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
                              Shinji0912 @sdetweil
                              last edited by

                              @sdetweil https://www.conrad.de/de/p/arduino-ag-usb-2-0-anschlusskabel-1x-usb-2-0-stecker-a-1x-usb-2-0-stecker-b-1-80-m-schwarz-95068.html?hk=SEM&WT.srch=1&WT.mc_id=google_pla&s_kwcid=AL!222!3!418522360024!!!g!!&ef_id=CjwKCAjwkoz7BRBPEiwAeKw3qy_SdRSLbXPZvYvpwSlJoKKFL-pjesNMeK_-wcbD8RJ4kJ7A1uo9ghoCmeUQAvD_BwE%3AG%3As&gclid=CjwKCAjwkoz7BRBPEiwAeKw3qy_SdRSLbXPZvYvpwSlJoKKFL-pjesNMeK_-wcbD8RJ4kJ7A1uo9ghoCmeUQAvD_BwE

                              S 1 Reply Last reply Reply Quote 0
                              • S Do not disturb
                                sdetweil @Shinji0912
                                last edited by

                                @Shinji0912 this is my arduino experience
                                https://www.antratek.com/nodemcu-v2-lua-based-esp8266-development-kit

                                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
                                  Shinji0912 @sdetweil
                                  last edited by

                                  @sdetweil Oh ok , the school told us to buy the Uno R3 and it’s the first one i’ve used so far ^^

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

                                    @sdetweil alt text

                                    S 1 Reply Last reply Reply Quote 0
                                    • S Do not disturb
                                      sdetweil @Shinji0912
                                      last edited by sdetweil

                                      @Shinji0912 don’t see ttyUSB0
                                      are there any message on the console where u start mm? npm start? or pm2 logs --lines=???

                                      ??? is a number, default is 15

                                      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
                                        Shinji0912 @sdetweil
                                        last edited by

                                        @sdetweil Not as far as i can see.

                                        S 1 Reply Last reply Reply Quote 0
                                        • S Do not disturb
                                          sdetweil @Shinji0912
                                          last edited by

                                          @Shinji0912 so, I would use the linked examples outside mm to make sure it works

                                          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
                                            Shinji0912 @sdetweil
                                            last edited by Shinji0912

                                            @sdetweil Ok so i have installed Serialport on the Pi and told the arduino to digitalwrite 10 but how to i let the Pi read 10?

                                            S 1 Reply Last reply Reply Quote 0

                                            Hello! It looks like you're interested in this conversation, but you don't have an account yet.

                                            Getting fed up of having to scroll through the same posts each visit? When you register for an account, you'll always come back to exactly where you were before, and choose to be notified of new replies (either via email, or push notification). You'll also be able to save bookmarks and upvote posts to show your appreciation to other community members.

                                            With your input, this post could be even better 💗

                                            Register Login
                                            • 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