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

    Posts

    Recent Best Controversial
    • RE: Run JavaScript if a file is created

      Why so convoluted? If you’re already using PHP on your page, just have it check for the existence of the file. No need to involve JS to do file system actions, just have it refresh the page at a set interval, let PHP take care of the rest.

      posted in General Discussion
      KirAsh4K
      KirAsh4
    • RE: Unable to install dependencies, NPM install not working

      I will try this weekend. Haven’t had much free time lately.

      posted in Troubleshooting
      KirAsh4K
      KirAsh4
    • RE: Complete Setup Tutorial

      Configuring Wireless

      Tired of the mile long posts? Well, here’s a short one. As I noted earlier, I will be running my rpi wirelessly. If you are physically connecting it to your network using a cable, you can skip this post.

      Step 1
      Once your rpi reboots and you’re back at the graphical desktop, launch the Terminal program (it’s a black monitor icon on the menu bar at the top.) Edit the wpa_supplicant.conf file to add your network information

      0_1465935687240_030-wifi-config-sm.png


      Step 2
      At the bottom of the contents, add your network information. Note the quotation marks as this is specially important if you have a space in your wireless network name. Same for the password part. When you’re done editing, press CTRL-X to exit, saying Y(es) to saving the changes.

      0_1465935941427_031-wifi-config-sm.png


      Step 3
      Time to reboot and make sure the rpi comes up and successfully connects to your wireless network.

      0_1465936127908_032-wifi-config-sm.png

      If all went well, when the rpi reboots and comes back to the graphical desktop, in the upper right corner you should see a familiar blue WiFi icon.

      0_1465936267885_wifi-icon.png

      And if you want to make double sure that it connected, you can open a Terminal window again, and type in ifconfig and look for the wlan0 section

      0_1465936892163_wifi-ifconfig-sm.png

      You’re looking for it to have a valid IP that belongs to your network. The specific private network that this rpi is connected to is in the 192.168.25.x range, so this validates that the rpi connected and received an IP from the DHCP server.

      If you are physically connecting the rpi to a network hub or router, you need to look at the eth0 section at the top.

      So what if it failed? Then you’d want to check a few things:

      • Did you enter the corect information in the wpa_supplicant.conf file above? Go back and check again.
      • Is your wireless router set to block unknown hosts? In a secure environment, it could be (mine is.) Make sure you allow it to connect and receive an IP from the router.
      • Are you in range of the wireless router?
      posted in Tutorials
      KirAsh4K
      KirAsh4
    • RE: Monthly Calendar View

      That’s the custom CSS being implemented. By default it doesn’t have any color nor border. The user can edit their CSS and personalize it that way. Essentially the code reads:

      	// Module defaults
      	defaults: {
      		...
      		displayMonthyear: true,
      		cssStyle: "default" /* Current options are 'default', 'block', 'custom' */
      	},
      
      	// Required styles
      	getStyles: function() {
      		switch(this.config.cssStyle) {
      			case "block":
      				return ["styleDefault.css", "styleBlock.css"];
      				break;
      			case "custom":
      				return ["styleDefault.css", "styleCustom.css"];
      				break;
      			default:
      				return ["styleDefault.css"];
      		}
      	},
      
      posted in Requests
      KirAsh4K
      KirAsh4
    • RE: Besides your MagicMirror, what are some Maker-projects you worked/working on?

      This is an existing design that I modify to get rid of things a laser cutter can not make. Original design calls for dowels in certain spots (axles and such), I modify it to use the same flat sheet material. This’ll be a fun build

      0_1469649285060_20160727-001.jpg

      0_1469649295365_20160727-002.jpg

      And how this compares to the Front End Loader I made last year:

      0_1469649332446_20160727-003.jpg

      posted in General Discussion
      KirAsh4K
      KirAsh4
    • $9 C.H.I.P.

      I received my $9 C.H.I.P. computer today, with the HDMI module that I added to the Kickstarter campaign. So naturally, I wanted to see if it would run MM. Being that it runs Debian, I figured why not.

      The positives:
      Hardware is ARM7l …
      Installing node v6+: no problem.
      Installing the necessary node modules: no problem
      Installing electron: no issues

      The negative: Electron won’t run. It’s saying it’s missing one of the prebuilt files. I need to figure out what that is and why. But, it DOES run as a server only setup. I can load it up just fine through a browser. This is actually kinda fun for a tiny little thing. And I do mean tiny, it’s smaller than a Raspberry Pi.

      posted in Hardware
      KirAsh4K
      KirAsh4
    • RE: Alternating Modules to save on real estate

      This would be a crude way of doing it, by creating another module to manipulate the ones you want swapping. It’s crude, but it gets the job done. Ideally this would be just a routine that allows you to tell it which modules to swap, as opposed to them being hard coded like they are in this code. But, this is just to show that it’s possible. One caveat is that if one module is wider than the other, you will notice things on your screen jump around a bit. That’s just the way CSS works when an element gets removed, and the nature of the flexible regions that we use.

      This code swaps the default calendar and clock modules every 10 seconds, with a 2 seconds fade delay. The 'config.js' portion is simply:

          {
            module: 'my_swap',
          },
      

      and in 'modules/my_swap/' I have the following file called 'my_swap.js':

      Module.register("my_swap",{
      
        // Default module config.
        defaults: {
        },
      
        // Define required scripts.
        getScripts: function() {
          return ["moment.js"];
        },
      
        start: function() {
          Log.log("Starting module: " + this.name);
          this.DOMloaded = 0;
          this.isHidden = 0;
      
          var self = this;
          setInterval(function() {
            self.swapModules();
          }, 1000);
        },
      
        notificationReceived: function(notification, payload, sender) {
          if (notification === 'DOM_OBJECTS_CREATED') {
            this.DOMloaded = 1;
          }
        },
      
        // swapModules.
        swapModules: function() {
      
          var now = moment();
          var self = this;
      
          if (!(now.seconds() % 10)) { // Update on the tens (00, 10, 20, 30, 40, and 50)
            if (this.DOMloaded) {
              if (self.isHidden) {
                MM.getModules().exceptModule(this).enumerate(function(module) {
                  if (module.name === "clock") {
                    module.hide(2000, function() {
                      MM.getModules().exceptModule(this).enumerate(function(module) {
                        if (module.name === "calendar") {
                          module.show(2000, function() {
                          });
                        }
                      });
                    });
                  }
                });
                self.isHidden = 0;
              } else {
                MM.getModules().exceptModule(this).enumerate(function(module) {
                  if (module.name === "calendar") {
                    module.hide(2000, function() {
                      MM.getModules().exceptModule(this).enumerate(function(module) {
                        if (module.name === "clock") {
                          module.show(2000, function() {
                          });
                        }
                      });
                    });
                  }
                });
                self.isHidden = 1;
              }
            }
          }
        }
      });
      
      posted in Requests
      KirAsh4K
      KirAsh4
    • RE: Besides your MagicMirror, what are some Maker-projects you worked/working on?

      As if I don’t already have a bunch of stuff on my plate, yesterday someone asked me to re-make this for them:
      https://www.youtube.com/watch?v=r8PtwqRvVDU

      After calculating all 148 parts, it comes out to 135 hours of printing (24 hours a day, non-stop), $60 worth of material, about 175 meters of it. If I were to print it at high quality, it’s 190 hours of printing (24 hours a day, non-stop.)

      Then you need to add 20 minutes of cooling time between prints (the print bed has to cool down before you can remove the parts), set up time, the assumption that there will be not a single failed print job, assembly time, machine time, and that pesky electric bill.

      posted in General Discussion
      KirAsh4K
      KirAsh4
    • Skywriter for the RPI

      Another toy to play with for motion gestures: https://shop.pimoroni.com/products/skywriter-hat

      posted in Hardware
      KirAsh4K
      KirAsh4
    • RE: Alternating Modules to save on real estate

      Yep, what you did is pretty much the idea. You figured it out and used your modules in the code. It needs to be rewritten a bit to allow for configurable module names. Possibly also allow more than just 2 modules to be swapped. There are some other things I can think of but it’s not something that’s at the top of the list for me. It is sitting in my dev repository, but it’ll be a bit before I focus on it. I’m glad what I wrote is helping you out though.

      posted in Requests
      KirAsh4K
      KirAsh4
    • 1 / 1