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

    Posts

    Recent Best Controversial
    • RE: MMM-ResRobot - Public transport information for Sweden

      @wizz
      It’s automatic and already there! Try it and you’ll see.
      Icons are selected based on mode of transport, it’s going to be one of bus, metro, rail or ferry.

      posted in Transport
      AlvingerA
      Alvinger
    • RE: MMM-ResRobot - Public transport information for Sweden

      @Advokaten
      Do you mean that the name of the bus stop is misnamed on screen? Then you have to contact ResRobot to change it.

      posted in Transport
      AlvingerA
      Alvinger
    • RE: MMM-ResRobot - Public transport information for Sweden

      @Advokaten
      Strange, my mirror is running flawlessly. I’ll put in your config and see what happens.

      posted in Transport
      AlvingerA
      Alvinger
    • RE: MMM-ResRobot - Public transport information for Sweden

      @MobbareKurtZ
      By adding them as a comma-separated list, e.g.

      from: "12345,12346,12347",
      to: "54321,64321,74321"
      

      where each from and to pair specify an id for the departure and destination stops. If destination is not needed for a departure station, simply leave it empty like this:

      from: "12345,12346,12347",
      to: "54321,,74321"
      
      posted in Transport
      AlvingerA
      Alvinger
    • RE: MMM-ResRobot - Public transport information for Sweden

      @MobbareKurtZ
      It all depends on the underlying ResRobot API but it sounds reasonable that ResRobot needs to know in what direction you are travelling.

      As the module only shows departures there is no need to specify a destination unless you want to limit the displayed departures to the ones going in that specific direction. In that case I would suggest to enter not the ultimate destination but rather the next “logical” stop such as point of transit between modes of transport.

      posted in Transport
      AlvingerA
      Alvinger
    • RE: 3 tries 3 fails Raspberry b+

      @infamoustiggr
      I didn’t fiddle that much with the mirror pi. But ahead of that I’ve been doing quite some fiddling with Pis in general so I didn’t start from scratch.

      To help you with troubleshooting:

      After installing DietPi and rebooting you are presented with the dietpi-software screen:
      0_1488462696670_upload-e5c282b6-f86e-4f85-9db8-c09d2112e649

      Look under “Software Optimized” and “Software Additional” and make sure that NONE of the options are selected, you want an install that is as clean as possible.

      Under DietPi-Config make sure that Autostart is set to option 0 (default):
      0_1488462810956_upload-7d9332c2-e5a0-4048-9a38-cd6b58a09246

      Change directory to /root and install MagicMirror according to instructions in the README.

      Following my instructions above to install all systemd scripts and their helpers. My /root contains the following:
      0_1488463243912_upload-a81285c4-984c-490f-9115-d51ae96b7284

      Stop magicmirror service (just to make sure it isn’t running) with the command:

      systemctl stop magicmirror.service
      

      Start the magicmirror interactively by running node serveronly from the MagicMirror directory. You should see something similar to this:

      root@mirrortest:~/MagicMirror# node serveronly
      Starting MagicMirror: v2.1.1
      Loading config ...
      Loading module helpers ...
      No helper found for module: alert.
      Initializing new module helper ...
      Module helper loaded: MMM-Remote-Control
      No helper found for module: clock.
      Initializing new module helper ...
      Module helper loaded: calendar
      Initializing new module helper ...
      Module helper loaded: MMM-WunderGround
      Initializing new module helper ...
      Module helper loaded: newsfeed
      Initializing new module helper ...
      Module helper loaded: MMM-ResRobot
      Initializing new module helper ...
      Module helper loaded: MMM-NetworkScanner
      All module helpers loaded.
      Starting server op port 80 ... 
      Server started ...
      Connecting socket for: MMM-Remote-Control
      Starting node helper for: MMM-Remote-Control
      Connecting socket for: calendar
      Starting node helper for: calendar
      Connecting socket for: MMM-WunderGround
      MMM-WunderGround helper started ...
      Connecting socket for: newsfeed
      Starting module: newsfeed
      Connecting socket for: MMM-ResRobot
      Starting node_helper for module: MMM-ResRobot
      Connecting socket for: MMM-NetworkScanner
      Starting module: MMM-NetworkScanner
      Sockets connected & modules started ...
      
      Ready to go! Please point your browser to: http://localhost:80
      

      If any errors are shown, investigate them.

      Now that MagicMirror is running it’s time to move on to the browser part.
      Stop MagicMirror with ctrl+C and start the service with systemctl start magicmirror.service.

      Make sure browser and matchbox are stopped by running the commands:

      systemctl stop kioskbrowser.service
      systemctl stop matchbox.service
      

      Start matchbox with the command systemctl start matchbox.service. Check that it started ok with systemctl status matchbox.service. If not investigate.

      Once you get this far the “only” thing left to check is the midori browser. As you don’t have an X Display on the console it is slightly trickier. Let me know if/when you made it this far and we’ll take it from there.

      posted in Show your Mirror
      AlvingerA
      Alvinger
    • RE: 3 tries 3 fails Raspberry b+

      @johnnyboy
      That’s technology development for you. Of course, in this case @infamoustiggr has the luxury of having someone with the exact same equipment already having the solution running.

      As to the speed issue, apart from taking a few extra seconds on boot, I have no issues whatsoever with speed for functionality on my Pi 1. But I must admit it took me a number of tries to get there! Doing it with little to no experience with Linux is really tough.

      posted in Show your Mirror
      AlvingerA
      Alvinger
    • RE: 3 tries 3 fails Raspberry b+

      @johnnyboy
      Of course you could always buy a Pi 3 and not worry, but what’s the fun in that? It’s much more rewarding to make it run on a Pi 1! :-)

      @infamoustiggr
      The first rule of troubleshopting is to eliminate all things that ARE working! What’s left must be the error.

      I would start with running all commands from the shell, i.e. do not create the systemd scripts, rather run the respective commands from the shell bybtyping them in, that way you will get feedback from each command.

      The error messages you post do not have any context so it’s hard to know when they occur. From where did you cut the errors?

      When installing raspbian or dietpi you should NOT install X or any desktop environment, the relevant packages will be installed when you install the other components.

      posted in Show your Mirror
      AlvingerA
      Alvinger
    • RE: MMM-ResRobot - Public transport information for Sweden

      @albertc
      Not right now. This was a conscious decision on my part as the mirror updates fairly seldom. relative departure times would be showing the wrong info after one minute.

      posted in Transport
      AlvingerA
      Alvinger
    • RE: MMM-ResRobot - Public transport information for Sweden

      @broberg @FallandeGubbe

      One thing popped into my mind: the Pi 1 is much slower than a Pi 3 and loading all the modules takes quite some time. Could it be that you are trying to open midori before MagicMirror has loaded all the modules and therefore is refusing connections? That in itself was the reason I had to go with a script that checked that midori was listening before launching MagicMirror.

      Have you checked with journalctl that magicmiror is ready for action?

      posted in Transport
      AlvingerA
      Alvinger
    • RE: MMM-ResRobot - Public transport information for Sweden

      @FallandeGubbe
      Maybe a stupid quesrion but did you run npm install after cloning the repository?

      posted in Transport
      AlvingerA
      Alvinger
    • RE: MMM-ResRobot - Public transport information for Sweden

      @FallandeGubbe,
      I’m running it on a Raspberry Pi 1 B with 256MB so yes, it’s possible… :-)

      You can’t run MagicMirror out of the box but I wrote a post in another thread about it:
      [https://forum.magicmirror.builders/topic/1659/3-tries-3-fails-raspberry-b/13]

      posted in Transport
      AlvingerA
      Alvinger
    • RE: MMM-ResRobot - Public transport information for Sweden

      @Klzow,
      I’ve uploaded a new version of the module. It has a new config option, skipMinutes, which allows you to skip departures occuring within skipMinutes from now. Feel free to try it out.

      posted in Transport
      AlvingerA
      Alvinger
    • RE: Cast from Server

      You can get this to work if you create a custom receiver for the Chromecast. A bit more work but definately doable.

      More info here:
      https://developers.google.com/cast/docs/custom_receiver

      posted in Feature Requests
      AlvingerA
      Alvinger
    • RE: 3 tries 3 fails Raspberry b+

      @infamoustiggr, thanks!
      Just make sure sure to pay it forward if you have the opportuniy to help someone else here in the forums.

      posted in Show your Mirror
      AlvingerA
      Alvinger
    • RE: 3 tries 3 fails Raspberry b+

      @infamoustiggr,

      Installed packages
      If you are running dietpi or Raspbian Jessie systemd should already be installed. Otherwise you need to install and enable it. Google is your friend.

      Midori should also be installed but Matchbox most likely isn’t. Install it with:

      sudo apt-get install matchbox-window-manager
      

      Systemd
      The systemd scripts are all located in /etc/systemd/system. To create magicmirror.service enter the following command (I’m using the editor nano):

      sudo nano /etc/systemd/system/magicmirror.service
      

      Paste script from above and edit to suit your needs.

      Make the script executable with the following command:

      sudo chmod +x /etc/systemd/system/magicmirror.service
      

      Repeat these steps for the other scripts by replacing magicmirror.service with the appropriate name.

      Custom script
      For DietPi the scripts are located in /root and for Raspbian they are located in /home/pi. Change to the appropriate directory with cd.

      nano kioskbrowser
      

      Paste the code from above and save/exit
      Make the script executable by running:

      chmod +x kioskbrowser
      

      MagicMirror config
      Make sure that MagicMirror has the correct port set in config.js. (Look for “port”: in config/config.js and make sure it is set to 80. Otherwise modify kioskbrowser.service and change the url http://localhost to http://localhost:port where port is the port number of MagicMirror.)

      Scheduled on/off times
      If you’re like me and do not want your mirror active during the night you can either use a module such as MMM-ModuleScheduler or a cron script that turns the monitor power on/off at set times. I use the latter. To do that you enter the command:

      crontab -e
      

      and paste the following lines

      59 05 * * *     /usr/bin/vcgencmd display_power 1
      09 23 * * *     /usr/bin/vcgencmd display_power 0
      

      Exit and save.
      The first line turns the monitor ON at 05:59 and the second line turns if OFF at 23:09. Modify according to needs.

      Reboot your pi and enjoy!

      posted in Show your Mirror
      AlvingerA
      Alvinger
    • RE: Help with config file

      The position line for the clock module is also wrong, it should be like this:

      position: "top_left",
      

      I recommend that you use a lint tool (e.g. eslint) to do syntax checking. It will find most of the errors.

      posted in Troubleshooting
      AlvingerA
      Alvinger
    • RE: Help with config file

      @sullivnc
      There is a curly brace missing in the config field of the clock module.

      posted in Troubleshooting
      AlvingerA
      Alvinger
    • RE: 3 tries 3 fails Raspberry b+

      Hi all,
      I’m running my mirror on an original Pi B 256MB with no issues at all!

      The Raspbian version I use is DietPi which is really great on a 256MB Pi. Note that the standard user in DietPi is “root” rather than “pi”. If you use standard Raspbian just replace all occurences of “root” with “pi” in the scripts below.

      As the documentation states you start off with installing the Server Only option. If I remember correctly I had to manually install many of the node module dependencies as they weren’t installed correctly otherwise

      I use matchbox as the window manager because it suited my needs best. It uses less resources which again is great for a 256MB Pi.

      I’m using systemd scripts rather than pm2 as I think they work better. My scripts:

      magicmirror.service:

      [Unit]
      Description=Node.js Magic Mirror Server
      
      [Service]
      ExecStart=/usr/bin/node /root/MagicMirror/serveronly/index.js
      WorkingDirectory=/root/MagicMirror
      Restart=always
      RestartSec=20
      StandardOutput=syslog
      StandardError=syslog
      SyslogIdentifier=nodejs-magicmirror
      Environment=NODE_ENV=production PORT=1337
      
      [Install]
      WantedBy=multi-user.target
      

      matchbox.service:

      [Unit]
      Description=X11
      After=X.service
      
      [Service]
      Environment=DISPLAY=:0.0
      ExecStart=/usr/bin/matchbox-window-manager -use_titlebar no -use_cursor no
      User=root
      Restart=on-failure
      
      [Install]
      WantedBy=multi-user.target
      

      Kioskbrowser.service:

      [Unit]
      Description=Kiosk Browser
      After=matchbox.service magicmirror.service
      Requires=magicmirror.service
      
      [Service]
      WorkingDirectory=/root/MagicMirror
      User=root
      
      Environment=DISPLAY=:0.0
      
      # Don't activate screensaver
      ExecStartPre=/usr/bin/xset s off
      
      # Disable DPMS (Energy Star) features
      ExecStartPre=/usr/bin/xset -dpms
      
      # Don't blank the video device
      ExecStartPre=/usr/bin/xset s noblank
      
      ExecStart=/root/kioskbrowser http://localhost
      Restart=on-failure
      
      [Install]
      WantedBy=multi-user.target
      

      Note that the kioskbrowser service relies on a user script called /root/kioskbrowser. This script has some extra logic to avoid the initial white screen when midori has loaded but not fetched any magic mirror content. The script perform a curl call to see if the magic mirror module is responding. If not it waits for a few seconds and then tries again. Once the magic mirror responds it starts midori in fullscreen mode.

      /root/kioskbrowser:

      #!/bin/bash
      status=1
      url="$1"
      wait="10s"
      tries=0
      
      # URL must be first argument
      if [ -z "$url" ]; then
        exit 1
      fi
      
      # Make sure that the url is reachable
      while [ $status -ne 0 ]; do
        let tries++
        curl --fail --progress-bar -o /dev/null --url "$url"
        status=$?
        if (($tries > 10)); then
          wait="30s"
        fi
        if (($tries > 20)); then
        wait="5m"
        fi
        if (($tries > 30)); then
        echo "$0: Can't load URL $url"
          exit 2
        fi
        sleep "$wait"
      done
      
      # Start browser in fullscreen mode
      /usr/bin/midori -e Fullscreen -a "$url"
      

      Hope this helps.

      posted in Show your Mirror
      AlvingerA
      Alvinger
    • RE: MMM-ResRobot - Public transport information for Sweden

      @Klzow,
      That shouldn’t be too hard to do. I will look into it. My current thinking is to introduce a new config value (something like “ignoreBefore=5” with default 0 for backward compatibility) Keep an eye on this thread for developments!

      posted in Transport
      AlvingerA
      Alvinger
    • 1 / 1