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

    Posts

    Recent Best Controversial
    • RE: PM2 do not start at bootup on my RPI 2? Works fine on my RPI 3.

      @bhepler
      I tried this but somehow the RPI 2 didn’t boot up with pm2. Worked just fine with my RPI 3.

      posted in Troubleshooting
      T
      tomyboy96
    • RE: PM2 do not start at bootup on my RPI 2? Works fine on my RPI 3.

      @Baxer Worked! Thank you!

      posted in Troubleshooting
      T
      tomyboy96
    • RE: PM2 do not start at bootup on my RPI 2? Works fine on my RPI 3.

      When trying to save this error shows up:

      “/tmp/crontab.gpsLPh/crontab”:22: bad time specifier
      errors in crontab file, can’t install.
      Do you want to retry the same edit? (y/n)

      posted in Troubleshooting
      T
      tomyboy96
    • RE: PM2 do not start at bootup on my RPI 2? Works fine on my RPI 3.

      Did not work…

      only way to get PM2 to start is by using:

      pm2 start mm.sh

      posted in Troubleshooting
      T
      tomyboy96
    • PM2 do not start at bootup on my RPI 2? Works fine on my RPI 3.

      Hi!

      I’m having trouble to get my PM2 to work on my RPI 2.
      I’ve installed PM2 through the MM installation:
      “curl -sL https://raw.githubusercontent.com/MichMich/MagicMirror/master/installers/raspberry.sh | bash”
      Everything is installed without any errors.

      Here’s the problem.

      When i do this on my RPI 3 it works just fine! MM starts at bootup and everything works as it should.

      BUT! When i do the exact same thing on my RPI 2 it do not work?
      When i restart the RPI 2 nothing happens… PM2 dosen’t boot.
      I’ve tired to install PM2 afterwards but no difference.

      Do anybody have any ideas?

      posted in Troubleshooting
      T
      tomyboy96
    • RE: Compliments not showing up when edited from default

      0_1499729393014_IMG_7210.JPG

      posted in Troubleshooting
      T
      tomyboy96
    • Compliments not showing up when edited from default

      Hi!

      I’m trying to add some more compliments to the compliments module. Everytime i add some new stuff my MM do not let any compliments show up.
      Any solution?

      /* global Log, Module, moment */
      
      /* Magic Mirror
       * Module: Compliments
       *
       * By Michael Teeuw http://michaelteeuw.nl
       * MIT Licensed.
       */
      Module.register("compliments", {
      
      	// Module config defaults.
      	defaults: {
      		compliments: {
      			anytime: [
      				"Låt mig presentera mig, mitt namn är Svetlana.",
      				"Svetlana till er tjänst!",
      				"Jag vet vad ni tänker. "Han måste ju vara dum i huvudet",
      				"Le, så förgyller du mer än bara min dag!",
      				"Här hänger jag!",
      				"Hörru! Glöm inte vattna dina blommor!",
      				"Svetlana, Svetlana på väggen där...",
      				"Pssst! Bakom dig!",
      				"Vad kallas det när man klonar en pirat? "Piratkopia",
      				"Två iPhone går in på en bar... Resten har jag glömt.",
      				"Meningen med livet? Choklad.",
      				"Svetlana har uppgraderats till en spegel.",
      				"nah nah nah nah nah nah nah nah nah nah nah nah nah nah nah nah BATMAN!",
      				"Ohhhh emmm geee... Vi är så lika",
      				"Nej jag har inte touch! Håll dina äckliga fingrar borta!",
      				"Jag behöver lite tid och reflektera...",
      				"Föremål i spegeln är fulare än dom verkar.",
      				"Nej jag pratar inte. Va glad att jag ens skriver till dig."
      			],
      			morning: [
      				"Godmorgon snygging!",
      				"Ha en grym dag!",
      				"Sovit gott?",
      				"Du ser ut att behöva en kaffe!",
      				"Om du ändå kunde sluta snarka...",
      				"Om jag kunde ge dig en high five... så skulle jag, jag lovar.",
      				"Jag skulle kunna hänga här hela dagen."
      			],
      			afternoon: [
      				"Svetlana till er tjänst!",
      				"Trevligt och se dig hemma.",
      				"Le!",
      				"Jag ser mycket av mig själv i dig."
      			],
      			evening: [
      				"Wow, snygg som alltid!",
      				"Hoppas du har haft en grym dag!",
      				"Fest ikväll?",
      				"Visa mig dina bästa moves!",
      				"HJÄÄÄÄÄÄLP!!!! Jag sitter fast!!!",
      				"Helt sjukt att grannarna aldrig klagar...",
      				"Tyst! Jag försöker sova.",
      				"Jag har superkrafter! Typ...",
      				"Ibland funderar jag på om jag är drottningen över denna lägenhet?",
      				"Håll dig undan! Ditt hår gör mig nervös.",
      				"Du ser glad ut?"
      			]
      		},
      		updateInterval: 30000,
      		remoteFile: null,
      		fadeSpeed: 4000
      	},
      
      	// Set currentweather from module
      	currentWeatherType: "",
      
      	// Define required scripts.
      	getScripts: function() {
      		return ["moment.js"];
      	},
      
      	// Define start sequence.
      	start: function() {
      		Log.info("Starting module: " + this.name);
      
      		this.lastComplimentIndex = -1;
      
      		if (this.config.remoteFile != null) {
      			this.complimentFile((response) => {
      				this.config.compliments = JSON.parse(response);
      			});
      		}
      
      		// Schedule update timer.
      		var self = this;
      		setInterval(function() {
      			self.updateDom(self.config.fadeSpeed);
      		}, this.config.updateInterval);
      	},
      
      	/* randomIndex(compliments)
      	 * Generate a random index for a list of compliments.
      	 *
      	 * argument compliments Array - Array with compliments.
      	 *
      	 * return Number - Random index.
      	 */
      	randomIndex: function(compliments) {
      		if (compliments.length === 1) {
      			return 0;
      		}
      
      		var generate = function() {
      			return Math.floor(Math.random() * compliments.length);
      		};
      
      		var complimentIndex = generate();
      
      		while (complimentIndex === this.lastComplimentIndex) {
      			complimentIndex = generate();
      		}
      
      		this.lastComplimentIndex = complimentIndex;
      
      		return complimentIndex;
      	},
      
      	/* complimentArray()
      	 * Retrieve an array of compliments for the time of the day.
      	 *
      	 * return compliments Array - Array with compliments for the time of the day.
      	 */
      	complimentArray: function() {
      		var hour = moment().hour();
      		var compliments;
      
      		if (hour >= 3 && hour < 12 && this.config.compliments.hasOwnProperty("morning")) {
      			compliments = this.config.compliments.morning.slice(0);
      		} else if (hour >= 12 && hour < 17 && this.config.compliments.hasOwnProperty("afternoon")) {
      			compliments = this.config.compliments.afternoon.slice(0);
      		} else if(this.config.compliments.hasOwnProperty("evening")) {
      			compliments = this.config.compliments.evening.slice(0);
      		}
      
      		if (typeof compliments === "undefined") {
      			compliments = new Array();
      		}
      
      		if (this.currentWeatherType in this.config.compliments) {
      			compliments.push.apply(compliments, this.config.compliments[this.currentWeatherType]);
      		}
      
      		compliments.push.apply(compliments, this.config.compliments.anytime);
      
      		return compliments;
      	},
      
      	/* complimentFile(callback)
      	 * Retrieve a file from the local filesystem
      	 */
      	complimentFile: function(callback) {
      		var xobj = new XMLHttpRequest();
      		xobj.overrideMimeType("application/json");
      		xobj.open("GET", this.file(this.config.remoteFile), true);
      		xobj.onreadystatechange = function() {
      			if (xobj.readyState == 4 && xobj.status == "200") {
      				callback(xobj.responseText);
      			}
      		};
      		xobj.send(null);
      	},
      
      	/* complimentArray()
      	 * Retrieve a random compliment.
      	 *
      	 * return compliment string - A compliment.
      	 */
      	randomCompliment: function() {
      		var compliments = this.complimentArray();
      		var index = this.randomIndex(compliments);
      
      		return compliments[index];
      	},
      
      	// Override dom generator.
      	getDom: function() {
      		var complimentText = this.randomCompliment();
      
      		var compliment = document.createTextNode(complimentText);
      		var wrapper = document.createElement("div");
      		wrapper.className = this.config.classes ? this.config.classes : "thin xlarge bright";
      		wrapper.appendChild(compliment);
      
      		return wrapper;
      	},
      
      
      	// From data currentweather set weather type
      	setCurrentWeatherType: function(data) {
      		var weatherIconTable = {
      			"01d": "day_sunny",
      			"02d": "day_cloudy",
      			"03d": "cloudy",
      			"04d": "cloudy_windy",
      			"09d": "showers",
      			"10d": "rain",
      			"11d": "thunderstorm",
      			"13d": "snow",
      			"50d": "fog",
      			"01n": "night_clear",
      			"02n": "night_cloudy",
      			"03n": "night_cloudy",
      			"04n": "night_cloudy",
      			"09n": "night_showers",
      			"10n": "night_rain",
      			"11n": "night_thunderstorm",
      			"13n": "night_snow",
      			"50n": "night_alt_cloudy_windy"
      		};
      		this.currentWeatherType = weatherIconTable[data.weather[0].icon];
      	},
      
      
      	// Override notification handler.
      	notificationReceived: function(notification, payload, sender) {
      		if (notification == "CURRENTWEATHER_DATA") {
      			this.setCurrentWeatherType(payload.data);
      		}
      	},
      
      });
      
      posted in Troubleshooting
      T
      tomyboy96
    • RE: Change language in Clock module?

      Wow… I feel dumb…

      Thanks!

      posted in Troubleshooting
      T
      tomyboy96
    • Change language in Clock module?

      I’m trying to change the language in the default clock module. I want to change from english to swedish.
      Possible? and if so… how?

      Thanks

      posted in Troubleshooting
      T
      tomyboy96
    • 1 / 1