• Recent
  • Tags
  • Unsolved
  • Solved
  • MagicMirror² Repository
  • Documentation
  • 3rd-Party-Modules
  • Donate
  • Discord
  • Register
  • Login
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 15.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 @sdetweil
    last edited by Sep 17, 2020, 1:12 PM

    @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 Sep 17, 2020, 1:14 PM Reply Quote 0
    • S Away
      sdetweil @Shinji0912
      last edited by Sep 17, 2020, 1:14 PM

      @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 Sep 17, 2020, 1:15 PM Reply Quote 0
      • S Offline
        Shinji0912 @sdetweil
        last edited by Sep 17, 2020, 1:15 PM

        @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 Sep 17, 2020, 1:17 PM

          @sdetweil alt text

          S 1 Reply Last reply Sep 17, 2020, 1:27 PM Reply Quote 0
          • S Away
            sdetweil @Shinji0912
            last edited by sdetweil Sep 17, 2020, 1:29 PM Sep 17, 2020, 1:27 PM

            @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 Sep 17, 2020, 1:48 PM Reply Quote 0
            • S Offline
              Shinji0912 @sdetweil
              last edited by Sep 17, 2020, 1:48 PM

              @sdetweil Not as far as i can see.

              S 1 Reply Last reply Sep 17, 2020, 1:54 PM Reply Quote 0
              • S Away
                sdetweil @Shinji0912
                last edited by Sep 17, 2020, 1:54 PM

                @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 Sep 17, 2020, 2:29 PM Reply Quote 0
                • S Offline
                  Shinji0912 @sdetweil
                  last edited by Shinji0912 Sep 17, 2020, 2:39 PM Sep 17, 2020, 2:29 PM

                  @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 Sep 17, 2020, 2:42 PM Reply Quote 0
                  • S Away
                    sdetweil @Shinji0912
                    last edited by Sep 17, 2020, 2:42 PM

                    @Shinji0912 Google , there are many examples

                    Sam

                    How to add modules

                    learning how to use browser developers window for css changes

                    S 1 Reply Last reply Sep 17, 2020, 4:37 PM Reply Quote 0
                    • S Offline
                      Shinji0912 @sdetweil
                      last edited by Shinji0912 Sep 17, 2020, 4:44 PM Sep 17, 2020, 4:37 PM

                      @sdetweil , @wishmaster270

                      Ok , so now i got the Arduino to communicate with the PI via usb, (i got the right Portname using NodeRed). This is the current Arduino Script :

                      #include <Wire.h>
                      #include "DHT.h"
                      
                      #define DHTPIN 2
                      #define DHTTYPE 11
                      
                      DHT dht (DHTPIN, DHTTYPE);
                      
                      
                      
                      void setup()
                      {
                        Wire.begin();
                        Serial.begin(9600);
                        dht.begin();
                      }
                        
                      
                      void loop()
                      {
                        delay(2000);
                        float temp = dht.readTemperature();
                        float rel_hum = dht.readHumidity();
                       
                      
                        if (isnan(rel_hum) || isnan(temp)) {
                          Serial.println(F("Daten vom Sensor konnten nicht gelesen werden!"));
                          return;
                        }
                        float hif = dht.computeHeatIndex(rel_hum);
                        float hic = dht.computeHeatIndex(temp, rel_hum, false);
                      
                        Serial.print(F("Luftfeuchtigkeit: "));
                        Serial.print(rel_hum);
                        Serial.print(F("%  Temperatur: "));
                        Serial.print(temp);
                        
                        Serial.print(F("°C "));
                        
                        Serial.println(F(""));
                      }
                      
                      
                      

                      Some things are in german so dont be suprised ^^

                      and via NodeRed i know that it is working and the Pi is currently reading the data.

                      alt text

                      My issue now is that my Config.js isn’t working anymore after installing ArduPorts ??
                      alt text

                      This is the current config :

                      /* Magic Mirror Config Sample
                       *
                       * By Michael Teeuw https://michaelteeuw.nl
                       * MIT Licensed.
                       *
                       * For more information on how you can configure this file
                       * See https://github.com/MichMich/MagicMirror#configuration
                       *
                       */
                      
                      var config = {
                      	address: "localhost", 	// Address to listen on, can be:
                      							// - "localhost", "127.0.0.1", "::1" to listen on loopback interface
                      							// - another specific IPv4/6 to listen on a specific interface
                      							// - "0.0.0.0", "::" to listen on any interface
                      							// Default, when address config is left out or empty, is "localhost"
                      	port: 8080,
                      	basePath: "/", 	// The URL path where MagicMirror is hosted. If you are using a Reverse proxy
                      					// you must set the sub path here. basePath must end with a /
                      	ipWhitelist: ["127.0.0.1", "::ffff:127.0.0.1", "::1"], 	// Set [] to allow all IP addresses
                      															// or add a specific IPv4 of 192.168.1.5 :
                      															// ["127.0.0.1", "::ffff:127.0.0.1", "::1", "::ffff:192.168.1.5"],
                      															// or IPv4 range of 192.168.3.0 --> 192.168.3.15 use CIDR format :
                      															// ["127.0.0.1", "::ffff:127.0.0.1", "::1", "::ffff:192.168.3.0/28"],
                      
                      	useHttps: false, 		// Support HTTPS or not, default "false" will use HTTP
                      	httpsPrivateKey: "", 	// HTTPS private key path, only require when useHttps is true
                      	httpsCertificate: "", 	// HTTPS Certificate path, only require when useHttps is true
                      
                      	language: "de",
                      	logLevel: ["INFO", "LOG", "WARN", "ERROR"],
                      	timeFormat: 24,
                      	units: "metric",
                      	// serverOnly:  true/false/"local" ,
                      	// local for armv6l processors, default
                      	//   starts serveronly and then starts chrome browser
                      	// false, default for all NON-armv6l devices
                      	// true, force serveronly mode, because you want to.. no UI on this device
                      
                      	modules: [
                      
                      
                        
                      {
                      		module: 'MMM-ArduPort',
                      		position: "bottom_right",
                      		config: {
                      			
                      		portname: "/dev/ttyACM0",
                      		updateInterval: 2,
                      		animationSpeed: 1000,
                      		displayIcons: ture,
                      		showDescription: true,
                      		useColors: true,
                      	sensors: [ {
                      	name: "DHT11",
                      	description: "Temperatur",
                      		   }
                      		 ]
                      			
                      		}
                      	},
                      
                      {
                      		module: 'MMM-TelegramBot',
                      		config: {
                      			
                      			telegramAPIKey: '',
                      			allowedUser: [''],
                      			adminChatId: ''
                      			
                      		}
                      	},
                      
                      
                      
                      
                      
                      
                      
                      
                      
                      {
                      			module: "MMM-Online-State",
                      			position: "top_left",
                      
                      		},
                      
                      {
                      			module: "updatenotification",
                      			position: "bottom_bar"
                      		},
                      
                      		{
                      			module: "clock",
                      			position: "top_right"
                      		},
                      		{
                                  module: 'MMM-RBB-Weather',
                                  position: "top_left", // All available positions
                                  config: {
                                               id: "18228265",
                                               days: "0",
                                               updateInterval: "600",
                                               }
                              },
                      {
                      			module: "calendar",
                      			header: "Events",
                      			position: "top_left",
                      			config: {
                      				calendars: [
                      					{
                      						symbol: "calendar-check-o ",
                      						url: "",
                      						maximumEntries: "5",
                      						maximumNumberOfDays: "7"
                      					}
                      				]
                      			}
                      		},
                      
                      
                      {
                        module: "MMM-NowPlayingOnSpotify",
                        position: "bottom_left",
                      
                        config: {
                          showCoverArt: false,
                          clientID: "",
                          clientSecret: "",
                          accessToken: "",
                          refreshToken: ""
                        }
                      },
                      	]
                      };
                      
                      /*************** DO NOT EDIT THE LINE BELOW ***************/
                      if (typeof module !== "undefined") {module.exports = config;}
                      
                      

                      alt text
                      i don’t know what to do now :C i thought i had it working this time finally …

                      EDIT :
                      Found the mistake i’ve written “ture” not “true” fml…

                      EDIT 2 :
                      But it’s still not working as i want it to it still says :“Waiting for Connection” on the Arduport module when launching the MagicMirror.

                      S 1 Reply Last reply Sep 17, 2020, 6:57 PM Reply Quote 0
                      • 1
                      • 2
                      • 3
                      • 4
                      • 5
                      • 6
                      • 1 / 6
                      1 / 6
                      • First post
                        20/55
                        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