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

geeklimit

@geeklimit

0
Reputation
488
Profile views
8
Posts
0
Followers
0
Following
Joined Oct 7, 2017, 7:33 PM
Last Online Oct 13, 2017, 8:09 PM

geeklimit Unfollow Follow

Latest posts made by geeklimit

  • RE: MMM-Wunderlist-Enhanced javascript error

    OK, that fixed all of the modules I was having trouble with, but getting Chromium to work right wasn’t easy.

    Chromium doesn’t like to be run as root (via startup script) you have to give it the flag:

    --no-sandbox
    

    Which doesn’t work, so instead you need to do this to run it as pi:

    su pi -c 'chromium-browser --kiosk --noerrdialogs http://localhost:8080
    

    To launch it without toolbars or a window (fullscreen), you have to give it the flag:

    --kiosk
    

    I tried the -app switch, and it removes the toolbars but leaves the window, so --kiosk is the way to go.

    But this leaves an annoying warning about --no-sandbox not being supported, so you have to also add in:

    --noerrdialogs
    

    Chromium also does an annoying popup when the Pi is rebooted without properly closing Chromium: “Chromium was not shut down correctly”. (power cycle or sudo reboot in the terminal). So you can try to edit Chromium’s file before it launches to make it think it shut down OK:

    sed -i 's/"exited_cleanly": false/"exited_cleanly": true/' ~/.config/chromium/Default/Preferences
    

    Which doesn’t work because ~/ doesn’t work as expected when it’s a root-run startup script looking for a path in /home/pi/, so:

    sed -i 's/"exited_cleanly": false/"exited_cleanly": true/' /home/pi/.config/chromium/Default/Preferences
    

    Which didn’t work either, so I tried using some older documentation:

    su pi -c 'chromium-browser --start-fullscreen --disable-session-crashed-bubble --disable-infobars http://localhost:8080
    

    Which also didn’t work.

    So… Then I realized I don’t really care about my browsing session data at all, so tried this:

    su pi -c 'chromium-browser --kiosk --incognito http://localhost:8080
    

    And that works, every time. Even when the Pi is power cycled.

    Yikes.

    So the complete launch command of “midori-start.sh” (now modified for Chromium) is:

    #!/bin/sh
    
    unclutter & 
    xset -dpms # disable DPMS (Energy Star) features.
    xset s off # disable screen saver
    xset s noblank # don’t blank the video device
    matchbox-window-manager &
    su pi -c 'chromium-browser --kiosk --incognito http://localhost:8080'
    
    

    This also gets rid of the balloon telling me that “I can search here with Google”, pointing to where the address bar should be when Pi opens Chrome for the first time. It only happens once, but nice to clear that out as well.

    The moral of the story here is: Don’t try to be fancy, just brute force the f@#$ing thing.

    posted in Troubleshooting
    G
    geeklimit
    Oct 9, 2017, 3:02 PM
  • RE: MMM-Wunderlist-Enhanced javascript error

    Thanks! I am having other “SyntaxError: Unexpected token” errors in other modules as well, as you guessed.

    Trying chromium first. I think that might be a better option, because even the default Compliments.js module has the same error.

    posted in Troubleshooting
    G
    geeklimit
    Oct 9, 2017, 1:33 PM
  • RE: MMM-Wunderlist-Enhanced javascript error

    I’d love to use Chromium instead of Midori, but the tutorial I followed for getting MagicMirror working on a Pi Zero W used Midori, and I don’t know a lot about what I’m doing.

    Theoretically I could look up how to install Chromium and change the browser-boot script from:

    #!/bin/sh
    
    unclutter &
    xset -dpms # disable DPMS (Energy Star) features.
    xset s off # disable screen saver
    xset s noblank # don’t blank the video device
    matchbox-window-manager &
    midori -e Fullscreen -a http://localhost:8080
    

    to

    #!/bin/sh
    
    unclutter &
    xset -dpms # disable DPMS (Energy Star) features.
    xset s off # disable screen saver
    xset s noblank # don’t blank the video device
    matchbox-window-manager &
    chromium-browser --no-sandbox --app="http://localhost:8080"
    

    Assuming that Chromium uses the same switches?

    Installing Chromium now via:

    sudo apt-get -y install chromium-browser
    

    Will test.

    posted in Troubleshooting
    G
    geeklimit
    Oct 9, 2017, 1:25 PM
  • RE: MMM-Wunderlist-Enhanced javascript error

    You’re losing me, but I think you mean I should edit the line causing the error from:

    this.config.lists.forEach((listValue, listKey) => {
    

    to

    this.config.lists.forEach ((listValue, listKey) {
    

    Or does this section of the code need a complete rewrite?

    posted in Troubleshooting
    G
    geeklimit
    Oct 9, 2017, 1:22 PM
  • RE: MMM-Wunderlist-Enhanced javascript error

    I am using Midori as part of my startup script. Specifically:

    #!/bin/sh
    
    unclutter &
    xset -dpms # disable DPMS (Energy Star) features.
    xset s off # disable screen saver
    xset s noblank # don’t blank the video device
    matchbox-window-manager &
    midori -e Fullscreen -a http://localhost:8080
    
    posted in Troubleshooting
    G
    geeklimit
    Oct 9, 2017, 1:20 PM
  • RE: MMM-Wunderlist-Enhanced javascript error

    It’s a Pi Zero W.

    pi@kitchenpi:~/MagicMirror/modules/MMM-NOAA $ npm version
    { 'mmm-noaa': '1.0.0',
      npm: '5.4.2',
      ares: '1.10.1-DEV',
      cldr: '31.0.1',
      http_parser: '2.7.0',
      icu: '59.1',
      modules: '57',
      node: '8.3.0',
      openssl: '1.0.2l',
      tz: '2017b',
      unicode: '9.0',
      uv: '1.13.1',
      v8: '6.0.286.52',
      zlib: '1.2.11' }
    

    Looks like node is at version 8.3.0.

    So…downgrade node or update the syntax?

    posted in Troubleshooting
    G
    geeklimit
    Oct 9, 2017, 1:16 PM
  • MMM-Wunderlist-Enhanced javascript error

    Running MMM-Wunderlist-Enhanced via PM2 on Raspbian Jessie Lite. MM 2.1.3 and Electron 1.4.5.

    MMM-Wunderlist-Enhanced doesn’t show on screen. Checking PM2 error logs shows:

    ** Message: console message: [native code] @0: Load script: modules/MMM-Wunderlist-Enhanced//MMM-Wunderlist-Enhanced.js
    
    ** Message: console message: http://localhost:8080/modules/MMM-Wunderlist-Enhanced//MMM-Wunderlist-Enhanced.js @59: SyntaxError: Unexpected token '>'
    

    I’ve tried the following, just to make sure all dependencies and files are up to date and correct:

    pi@kitchenpi:~/MagicMirror/modules/MMM-Wunderlist-Enhanced $ git fetch --all
    Fetching origin
    pi@kitchenpi:~/MagicMirror/modules/MMM-Wunderlist-Enhanced $ git reset --hard origin/master
    HEAD is now at 4f01f5d Update README.md
    pi@kitchenpi:~/MagicMirror/modules/MMM-Wunderlist-Enhanced $ npm install
    up to date in 37.436s
    

    Seems OK. The section of code in MMM-Wunderlist-Enhanced.js that’s giving the problem is:

        this.config.lists.forEach((listValue, listKey) => {
    

    and in context here (line 59):

      getTodos: function() {
        var tasks = [];
        this.config.lists.forEach((listValue, listKey) => {
          let list = this.tasks[listValue];
          if (list && list.length)
            list.forEach(todo => {
              if (this.config.order === 'reversed') {
                tasks.push(todo);
              } else {
                tasks.unshift(todo)
              }
    

    It seems like the ‘=>’ is the problem?

    I’m not a javascript coder, so I can’t tell if it’s supposed to be that way or not.

    I tried changing it to just ‘=’, but that doesn’t fix the problem.

    posted in Troubleshooting
    G
    geeklimit
    Oct 9, 2017, 1:09 PM
Enjoying MagicMirror? Please consider a donation!
MagicMirror created by Michael Teeuw.
Forum managed by Sam, technical setup by Karsten.
This forum is using NodeBB as its core | Contributors
Contact | Privacy Policy