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

    Posts

    Recent Best Controversial
    • RE: sendSocketNotification from node_helper to Module

      @Leobaillard I think I got it.

      Lines 76-81 of MMM-JCD-Bikes.js is the culprit. I believe that once you were going into Object.keys it was losing the scope. Try changing those lines to this:

      			// List available bikes via a stations array
      			var self = this;
      			Object.keys(self.stationsData).forEach(function (key)
      			{
      				table.appendChild(self.createStationNameRow(self.stationsData[key].name));
      				table.appendChild(self.createAmountRow(self.stationsData[key]));
      			});
      

      note that I’ve added var self = this; and now calling these when appending children elements to the table: self.createStationNameRow, self.stationsData[key].name, self.createAmountRow and self.stationsData[key]

      Another spot that I’ve noticed is that createStationNameRow function didn’t appendHTML name of the station to the cell. I didn’t dig too much into it, but I think this cell.innerHTML = name; was missing from it:

      	createStationNameRow: function(name) {
      		var nameRow = document.createElement("tr");
      		var cell = document.createElement("td");
      		cell.className = "stationName";
      		cell.setAttribute("colSpan", 2);
      		cell.innerHTML = name;
      
      		nameRow.appendChild(cell);
      
      		return nameRow;
      	},
      

      Hopefully it will get you going in the right direction.

      posted in Development
      morozgrafixM
      morozgrafix
    • RE: How to set Font in Alarm Clock

      @strawberry-3.141 & @broberg I believe that default alert module has inline styles for alerts and notifications that would override any CSS that is set outside of it.

      For example take a look at https://github.com/MichMich/MagicMirror/blob/master/modules/default/alert/alert.js#L39

      		if (message.title) {
      			msg += "<span class='thin' style='line-height: 35px; font-size:24px' color='#4A4A4A'>" + message.title + "</span>";
      		}
      		if (message.message){
      			if (msg != ""){
      				msg+= "<br />";
      			}
      			msg += "<span class='light' style='font-size:28px;line-height: 30px;'>" + message.message + "</span>";
      		}
      

      and https://github.com/MichMich/MagicMirror/blob/master/modules/default/alert/alert.js#L81

      		if (params.title) {
      			message += "<span class='light' style='line-height: 35px; font-size:30px' color='#4A4A4A'>" + params.title + "</span>"
      		}
      		if (params.message) {
      			if (message != ""){
      				message += "<br />";
      			}
      
      			message += "<span class='thin' style='font-size:22px;line-height: 30px;'>" + params.message + "</span>";
      		}
      
      

      I believe that most elegant way of fixing it is to move those styles into CSS file and have ability to override it in custom.css or other file.

      posted in Troubleshooting
      morozgrafixM
      morozgrafix
    • RE: Npm start...

      @cowboysdude I managed to get it up and running locally on a super old system running Ubuntu 16.04.1 LTS. I had some trouble starting electron via SSH when running DISPLAY=:0 npm start, but npm start worked just fine

      Here is a list of steps that got it running (i’m running node v6.9.4 and npm v4.1.1):

      sudo apt-get install git
      git clone https://github.com/MichMich/MagicMirror.git
      curl -sL https://deb.nodesource.com/setup_6.x | sudo -E bash -
      sudo apt-get install -y nodejs
      node --version
      curl -sL https://www.npmjs.com/install.sh | sudo -E bash -
      npm --version
      cd MagicMirror/
      cp config/config.js.sample config/config.js
      npm install
      npm start
      

      Not sure if this will help. You can always try to run verbose mode npm start --verbose to see if there is any information that may lead you to finding a reason why it doesn’t start. It was very sluggish on my system, but this is a very old computer.

      P.S. Sorry it took me a while to get to try it out and get back to you. It has been a very long and exhausting day.

      Good luck.

      posted in Troubleshooting
      morozgrafixM
      morozgrafix
    • RE: Npm start...

      @LincolnClay I’m glad it all worked out for you. But I would be careful adding sudo command to everything. You may run into permissions issues. The reason why you need to use sudo when installing packages with apt-get is because you need to have elevated privileges as you are making system wide changes. Cloning MM repository in your home directory shouldn’t require sudo, if you use sudo to clone all files will belong to root user and your user (usually pi) will not have permissions to create or modify files in MagicMirror directory (which opens a whole different can of worms).

      TL;DR version: try to use sudo only when necessary.

      @cowboysdude Do you have only one monitor (your TV through HDMI) to your Ubuntu box? Also you may want to attempt to run https://github.com/electron/electron-quick-start just to see electron app running on your rig completely outside of MM codebase.

      @cianoo45 are you still having problems starting the MM? That writeup was specifically for @cowboysdude who was trying to get MM setup on his Ubuntu system. You should be fine with npm v4.0.0 (on my RasPi I’m running node v6.9.2 and npm v3.10.9 if that matters)

      posted in Troubleshooting
      morozgrafixM
      morozgrafix
    • RE: Settings in config.js aren't loaded after reboot of RasPi

      @LincolnClay I’m not really sure why MM code is not picking up your /home/pi/MagicMirror/config/config.js after restart.

      By the way config.js.sample is just a sample config that can be copied into config.js and it comes along with MM code and doesn’t really play any role when MM starts up, so there is no need to modify that file in any way.

      If your /home/pi/MagicMirror/config/config.js keeps your desired changes, I wonder if you somehow have 2 different locations where MM is installed and configured. (I noticed that you have node_modules directory in /home/pi which seems a bit odd.)

      I’m assuming you are starting MM with pm2 on a startup. Can you please show post contents of your /home/pi/mm.sh file (you can run cat /home/pi/mm.sh and copy/paste contents of the output) and also run pm2 list and pm2 show mm and copy/paste output here?

      Sorry I’m kind of running out of ideas without knowing more information.

      Thanks.

      P.S. I’ve forked our conversation into a separate topic, this way we will not highjack original topic.

      posted in Troubleshooting
      morozgrafixM
      morozgrafix
    • RE: How to set ipWhitelist for all device can acess to MagicMirror v2?

      @Mykle1 Sorry about delay. It looks like your RasPi is using IPv6 and earlier I gave you instructions for IPv4. Sorry about misinformation.

      For IPv6 setting ipWhitelist subnet mask to ::ffff:192.168.1.1/120 will give you access to 256 IP addresses. So your setting for ipWhitelist part in config.js would look like this:

      ipWhitelist: ["127.0.0.1", "::ffff:127.0.0.1", "::1", "::ffff:192.168.1.1/120"]
      

      After making changes restart MM and try to access from browser on your computer.

      Let me know if it worked. Thanks.

      posted in Troubleshooting
      morozgrafixM
      morozgrafix
    • RE: Replacing snow flakes with hearts in the MMM-SNOW module

      How is it his? There are 15 different Valentines themed icons and most of the code is shamelessly borrowed from MMM-Snow by @MichMich
      0_1486097486590_upload-16416aa3-f2f1-4e99-b943-89cf8acac379

      Going to get some dinner and push it up to GitHub

      posted in Troubleshooting
      morozgrafixM
      morozgrafix
    • RE: Replacing snow flakes with hearts in the MMM-SNOW module

      @roramirez Yes you are right, I also thought about idea of general module that can be configured with various images or possibly have a schedule that will pick images from different folders and be hidden rest of the time.

      posted in Troubleshooting
      morozgrafixM
      morozgrafix
    • RE: Where are you from?

      San Francisco, CA

      posted in General Discussion
      morozgrafixM
      morozgrafix
    • RE: Creating a module to display daily horoscopes

      This topic can probably be marked as “solved” - module thread is here https://forum.magicmirror.builders/topic/1370/mmm-horoscope

      posted in Development
      morozgrafixM
      morozgrafix
    • 1 / 1