MagicMirror Forum
    • Recent
    • Tags
    • Unsolved
    • Solved
    • MagicMirror² Repository
    • Documentation
    • 3rd-Party-Modules
    • Donate
    • Discord
    • Register
    • Login
    1. Home
    2. 1BlauNitrox
    3. Posts
    A New Chapter for MagicMirror: The Community Takes the Lead
    Read the statement by Michael Teeuw here.
    1
    Offline
    • Profile
    • Following 0
    • Followers 0
    • Topics 5
    • Posts 37
    • Groups 0

    Posts

    Recent Best Controversial
    • RE: Error while starting Magic Mirror

      @sdetweil What do you mean?

      https://github.com/KirAsh4/calendar_monthly/

      posted in Development
      1
      1BlauNitrox
    • RE: Error while starting Magic Mirror

      @sdetweil

      This is my config:

      modules: [
      		{
      			module: "alert",
      		},
      		{
      			module: "updatenotification",
      			position: "top_bar"
      		},
      		{
      			module: "clock",
      			position: "top_left"
      		},
      		{
      			module: "calendar_monthly",
      			position: "top_left",
      			config: {
      
      			}
      		},
      		{
      			module: "weather",
      			position: "top_right",
      			config: {
      				weatherProvider: "openweathermap",
      				type: "current",
      				location: "mycity",
      				locationID: "cityID", //ID from http://bulk.openweathermap.org/sample/city.list.json.gz; unzip the gz file and find your city
      				apiKey: "mykey"
      			}
      		},
      		{
      			module: "weather",
      			position: "top_right",
      			header: "Wettervorhersage",
      			config: {
      				weatherProvider: "openweathermap",
      				type: "forecast",
      				location: "mycity",
      				locationID: "cityID", //ID from http://bulk.openweathermap.org/sample/city.list.json.gz; unzip the gz file and find your city
      				apiKey: "mykey"
      			}
      		},
      		{
                  		 module: "MMM-NowPlayingOnSpotify",
       			 position: "bottom_left",
      			 config: {
         				 clientID: "myid",
          				 clientSecret: "myid",
          				 accessToken: "mytoken",
          				 refreshToken: "mytoken"
       			 }
      		},
      	]
      
      posted in Development
      1
      1BlauNitrox
    • Error while starting Magic Mirror

      Hey guys,
      I am not able to start my Magic Mirror with the command pm2 start MagicMirror.

      There is always this error:

      [21.01.2022 14:17.17.199] [ERROR] Whoops! There was an uncaught exception...
      [21.01.2022 14:17.17.201] [ERROR] TypeError: Cannot read properties of undefined (reading 'on')
          at Object.<anonymous> (/home/pi/MagicMirror/js/electron.js:104:5)
          at Module._compile (node:internal/modules/cjs/loader:1101:14)
          at Object.Module._extensions..js (node:internal/modules/cjs/loader:1153:10)
          at Module.load (node:internal/modules/cjs/loader:981:32)
          at Function.Module._load (node:internal/modules/cjs/loader:822:12)
          at Object.<anonymous> (/usr/lib/node_modules/pm2/lib/ProcessContainerFork.js:33:23)
          at Module._compile (node:internal/modules/cjs/loader:1101:14)
          at Object.Module._extensions..js (node:internal/modules/cjs/loader:1153:10)
          at Module.load (node:internal/modules/cjs/loader:981:32)
          at Function.Module._load (node:internal/modules/cjs/loader:822:12)
      

      I have only installed Spotify and calender_monthly module. Yesterday everythink works fine, now nothing works without changing anything

      posted in Development
      1
      1BlauNitrox
    • RE: Module with HTTP Request

      @jalibu is it possible to change the port in the api?
      In my main.ts file I have

      await app.listen(3000);
      

      Can I change it to 8080?

      posted in Development
      1
      1BlauNitrox
    • Module with HTTP Request

      Hey guys,
      I am creating my own first Magic Mirror 2 Module. The Module is about my substitution plan from school. I developed an API running on my localhost on the raspberry pi 3.

      The module should make a GET request on my localhost and show the result on the mirror.

      I`m new in creating own modules so I am not very experienced. This is my code so far:

      Module.register("MMM-VPlan", {
      	defaults: {
      		text: "Vertretungsplan",
      		updateDelay: 10, //*60 für minuten
      		errorMessage: "Der Plan konnte nicht geladen werden"
      	},
      
      	start: function(){
      		var self = this;
              this.vplan =   "";
              this.completeRquest = false;
              this.errorMessage = "";
      		setInterval(function() {
      			self.updateDom()
      		}, 1000*this.config.updateDelay)
      	},
      
      	getStyles: function() {
              return ["vplan.css"];
      	},
      
      
          	getDom: function() {
      		var wrapper = document.createElement("div");
      		updateRequest();
              if(this.completeRquest) {
                  if(!errorMessage == "") {
                      wrapper.innerHTML = this.errorMessage;
                  } else {
      		        wrapper.innerHTML = this.config.text + " Data: " + this.vplan;
                  }
              } else {
                  wrapper.innerHTML = "Plan läd..."
              }
              this.completeRquest = false;
      		return wrapper;
      	},
      
          updateRequest: function() {
              var self = this;
      
      		var params = {
      			"day":"today",
      		}
      	    
      	    var xhttp = new XMLHttpRequest();
      	    xhttp.open("GET", "localhost:3000/vplan", true);
      	    xhttp.onreadystatechange = function() {
      	        if (this.readyState === 4) {
      	            if (this.status === 200) {
      	                self.vplan = this.responseText;
                          self.completeRquest = true;
      	            } else {
      	                self.errorMessage = this.config.errorMessage;
      	            }
      	    
      	        }
      	    };
      	    xhttp.send(JSON.stringify(params));
          },
      })
        
      

      On the mirror you can see: “UNDEFINED”

      I hope someone can help me.
      LG 1BlauNitrox - Julius

      posted in Development
      1
      1BlauNitrox
    • 1
    • 2
    • 3
    • 4
    • 4 / 4