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

    Posts

    Recent Best Controversial
    • RE: Raspberry Pi 1 - Any Magic Mirror Setup Possible?

      Hm, the post that @jmadero links to is from Jan, but I installed Chromium just a few weeks ago successfully. Did you run this first before trying to install chromium?

      sudo apt-get update && sudo apt-get upgrade -y
      

      This step is necessary for making sure you’ve got the latest repository lists, I think.

      Also, when you open the chromium browser that you did install, what exactly happens? Does the browser itself not work, or are you not seeing the MagicMirror page? Once again, please be specific!

      posted in Hardware
      M
      mbalfour
    • RE: iCal parsing bug?

      Well bummer, I hadn’t seen your module when working on this. :( I’ve just merged my changes back into the main calendar code and sent a pull request for it: https://github.com/MichMich/MagicMirror/pull/375

      (I also sent a pull request to the ical.js repo - https://github.com/peterbraden/ical.js/pull/64 )

      Looking at your code, it looks like we’re trying to accomplish slightly different things, but with similar approaches, so it probably wouldn’t be too bad to merge them together as well. The main difference is that I want the ical events to show up on the monthly calendar view, and it looks like you’re displaying an “empty” calendar, right? But you’ve got some cool features like exposing the css styling out more dynamically, having an option to turn off the headers, etc. And your html creation code is cleaner than mine. :)

      I can take a look at bringing these two together eventually myself, but I have to admit it’s a bit lower on my list now that I’ve fixed the functional parts of the calendar and gotten all my events showing up. (A family calendar isn’t much use if you can’t trust that it’s displaying everything correctly)

      My new first priority is to finish off a module that lets us text message the display to display a notification to the family (“Went out to buy groceries be back in an hour”). :) The base concept is that it shows the summary of the latest gmail message an account receives, since you can text gmail accounts. Guess it’s possible other people might find other reasons to want that too…

      posted in Troubleshooting
      M
      mbalfour
    • RE: Raspberry Pi 1 - Any Magic Mirror Setup Possible?

      @sagatxxx I’m not in a state where I can upload a full OS image, but if you explain more fully what steps you’ve tried and where you’re failing, I can try and provide a bit of guidance.

      posted in Hardware
      M
      mbalfour
    • RE: iCal parsing bug?

      OK, made the larger-scale changes and they seem to work. :) I don’t have anything in a state to pull-request into MagicMirror yet, since I’m doing this with a variant of the calendar module to give a monthly view. I’ve changed ical.js to create a recurrences[] array to contain all the recurrence exceptions, and an exdate[] array to contain all the “except this date” exceptions. This is now pull-requested on the ical.js repository.

      On the calendar module side, it took a few changes in calendarfetcher.js to use these arrays to correctly generate the lists of upcoming events. This will take me longer to get back to MagicMirror, since I’m trying to merge my monthly-view calendar and the existing calendar module, since they share about 90% of the same code.

      posted in Troubleshooting
      M
      mbalfour
    • RE: iCal parsing bug?

      Ugh.

      So, the fix above is only partially right, and the problems with it speak to the minimalistic nature of this ical implementation. :( I’ve verified that the first half of this is right - we shouldn’t overwrite any existing entries to “par[curr.uid]”. The second half, where I’m trying to merge it, is just flat-out wrong though.

      The problem that I’m facing is that my first ics entry is setting up a recurrence rule, for example:
      RRULE:FREQ=DAILY;UNTIL=20160229T055959Z
      “repeat daily until 2/29/2016”

      The second ics entry is trying to say “do something different on a specific day”:
      RECURRENCE-ID;TZID=US/Central:20160228T090000
      “change some information for the 2/28/2016 calendar entry”

      There’s simply no concept in ical.js (or consequently calendarfetcher.js) for storing exceptions and changes to a recurring rule, so I don’t think I can get this to display correctly without some larger-scale changes, or swapping out the ical implementation for a more complete & full-featured one.

      The warning to everyone: The calendar module is currently a bit dangerous, in that this bug will cause your calendar to silently display misleading information if you have recurring calendar entries and modified single occurrences of them. :(

      posted in Troubleshooting
      M
      mbalfour
    • iCal parsing bug?

      I think I’ve found a bug in ical.js in the calendar module, but I’m not super-familiar with the iCal format, so I figured I’d post here and see if this is correct.

      My ics file has some entries that look like this:

      BEGIN:VEVENT
      CREATED:20160103T174939Z
      DTEND;TZID=US/Central:20160226T190000
      DTSTAMP:20160225T150003Z
      DTSTART;TZID=US/Central:20160226T090000
      LAST-MODIFIED:20160103T174940Z
      RRULE:FREQ=DAILY;UNTIL=20160229T055959Z
      SEQUENCE:0
      SUMMARY:Work
      UID:00296911-7E2C-4229-9E49-1FBBA96F5344
      END:VEVENT
      BEGIN:VEVENT
      CREATED:20160103T175015Z
      DTEND;TZID=US/Central:20160228T170000
      DTSTAMP:20160225T150003Z
      DTSTART;TZID=US/Central:20160228T110000
      LAST-MODIFIED:20160216T070945Z
      RECURRENCE-ID;TZID=US/Central:20160228T090000
      SEQUENCE:0
      SUMMARY:Working
      UID:00296911-7E2C-4229-9E49-1FBBA96F5344
      END:VEVENT
      

      What’s happening is that instead of this showing up as a recurring event, it’s showing up as a single-date event. It appears this is because I’ve got multiple entries with the same UID, and so the second one is just clobbering over the first. My best guess is that the appropriate behaviour is for it to merge with the first.

      I think the correct fix is in ical.js, to change this:

              if (curr.uid)
                      par[curr.uid] = curr
      

      To this:

              if (curr.uid)
              {
                  if (par[curr.uid] === undefined)
                  {
                      par[curr.uid] = curr
                  }
                  else
                  {
                      // TODO: Is this the correct way to merge?  Do I need to take LAST-MODIFIED field into account?
                      var key;
                      for (key in curr)
                      {
                          par[key] = curr[key];
                      }
                  }
              }
      

      In my limited test case it works, but does anyone know this code or the ical format well enough to chime in?

      posted in Troubleshooting
      M
      mbalfour
    • RE: Raspberry Pi 1 - Any Magic Mirror Setup Possible?

      Yep, it’s definitely possible, but it’s not easy. I’ve got the server plus an auto-boot into chromium kiosk mode up and running on a Raspberry Pi 1.

      Here’s some half-written notes that I was keeping as I went through the process. Hopefully somebody can take this and turn it into better documentation.

      PC-side:
      install WinSCP: https://winscp.net/eng/download.php
      install PuTTY: http://www.chiark.greenend.org.uk/~sgtatham/putty/download.html

      Overall kiosk screen setup:
      See https://www.danpurdy.co.uk/web-development/raspberry-pi-kiosk-screen-tutorial/
      Important commands:

      sudo apt-get update && sudo apt-get upgrade -y
      sudo apt-get install chromium x11-xserver-utils unclutter
      

      Install node.js:
      See https://www.losant.com/blog/how-to-install-nodejs-on-raspberry-pi
      Important commands:

      curl -o- https://raw.githubusercontent.com/creationix/nvm/v0.31.0/install.sh | bash
      nvm install v6.2.1
      

      Magic Mirror setup:
      See https://github.com/MichMich/MagicMirror#usage
      Important commands:

      sudo apt-get install php5
      curl -sL https://raw.githubusercontent.com/MichMich/MagicMirror/master/installers/raspberry.sh
      (need to modify raspberry.sh to take out the Pi1 fail check)
      bash raspberry.sh
      git clone https://github.com/MichMich/MagicMirror
      cd ~/MagicMirror
      npm install
      node serveronly
      

      Raspberry Pi 1 CSS incompatibility issue
      fix drawing:
      nano css/custom.css

      	height: 90%;
      	width: 90%;
      

      (TODO - find better fix for this)

      Install wifi adapter:
      See https://www.raspberrypi.org/forums/viewtopic.php?p=462982#p462982
      Important commands:

      lsusb
      uname -a
      wget https://dl.dropboxusercontent.com/u/80256631/8188eu-20160305.tar.gz
      tar xzf 8188eu-20160305.tar.gz
      ./install.sh
      sudo reboot
      

      Create a startup script:

      nano run_magicmirror.sh
      
      echo 'removing log.txt'
      rm -f /home/pi/MagicMirror/log.txt
      
      echo 'running MagicMirror server'
      /home/pi/.nvm/versions/node/v6.2.1/bin/node /home/pi/MagicMirror/serveronly > /home/pi/MagicMirror/log.txt
      
      echo 'waiting for server to start'
      sleep 20
      
      echo 'running web browser'
      chromium --noerrdialogs --kiosk --incognito http://localhost:8080
      

      Set up autostart:
      See https://github.com/MichMich/MagicMirror/wiki/Configuring-the-Raspberry-Pi
      Important commands:
      sudo nano /etc/xdg/lxsession/LXDE/autostart

      	@xscreensaver -no-splash
      	@xset s off
      	@xset -dpms
      	@xset s noblank
      	@lxterminal -e sh /home/pi/run_magicmirror.sh
      

      Note from admin: Please use Markdown on code snippets!

      posted in Hardware
      M
      mbalfour
    • RE: node_helper modules not working with Pi One

      Solved!

      I was running node v0.12.9. Once I upgraded to node v6.2.1 everything worked fine.

      posted in Troubleshooting
      M
      mbalfour
    • RE: node_helper modules not working with Pi One

      More information:

      • It also happens if I just copy config.js.sample to config.js, so it has nothing to do with node_helper or my custom modules. Sorry for the false alarm there.
      • I added a bit of code to app.js to print out the exception being thrown, and it’s “TypeError: undefined is not a function” from the Object.assign call in loadConfig. I also added printouts of both defaults and c just above the Object.assign call, and they both appear to be loaded and correct.
      posted in Troubleshooting
      M
      mbalfour
    • node_helper modules not working with Pi One

      I’m trying to get MagicMirror up and running on my Raspberry Pi One. I’ve got a config that’s trying to use the following 5 modules:

      • clock
      • currentweather
      • calendar
      • weatherforecast
      • my_ip (custom module to print the Pi’s IP address)

      I’ve got everything installed, and I run the server with “node serveronly”. Here are the weird things I’m seeing:

      1. Starting up the server prints the following. This seems odd because the final display is showing all the modules, so it clearly is loading the config:
        Loading config …
        WARNING! Could not find config. Please create one.
        Loading module helpers …
        No helper found for module: helloworld.
        All module helpers loaded.
        Starting server op port 8080 …
        Server started …
        Sockets connected & modules started …
        Ready to go! Please point your browser to: http://localhost:8080

      (When I use this config on my PC, it works correctly, and running “node serveronly” prints out a lot more messages like “No helper found for module: alert” and notes about starting node helpers)

      1. When I view the MagicMirror page from a browser (on my PC), I can see the clock, the currentweather, and the weatherforecast all working correctly. However, the calendar is blank and my my_ip module is blank. The primary difference I see between these modules and the other three are that they both use node_helper. I don’t see any output showing that the node helpers have started, which is also why I think this might be going wrong.

      Any suggestions on where to look or how to troubleshoot further? I’m not sure where to find any logs or error messages on the Pi from the MagicMirror. Right now I don’t have anything automated, I’m just running “node serveronly” directly from the command line on the Pi.

      Some other information:

      • I’m running raspian 4.1.19+ #858
      • I’ve run “sudo apt-get update && sudo apt-get upgrade -y” to make sure I’m up-to-date
      posted in Troubleshooting
      M
      mbalfour
    • 1 / 1