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

    Posts

    Recent Best Controversial
    • Controlling Embedded Youtube Video on MM

      Hi all,
      Currently I’m facing an issue with my embedded youtube video on MM. My inspiration of controlling the video comes from Jopyth’s Remote Control module( https://github.com/Jopyth/MMM-Remote-Control ).

      So my idea is that whenever i press the “hide-all” button , the remote will send a notification to my youtube module telling it to play the module while hiding the rest of my module and when “show-all” button is pressed, it hides and pauses the video while showing un-hiding the rest of my modules. However, currently im met with a problem, the function, this.sendnotification doesn’t work. The following is portion that i have edited.

         'show-all-button': function() {
              var buttons = document.getElementsByClassName("edit-button");
              for (var i = 0; i < buttons.length; i++) {
                              if (buttons[i].id!="module_5_youtube"){
                  buttons[i].className = buttons[i].className.replace("toggled-off", "toggled-on");
                  Remote.showModule(buttons[i].id);
                  this.sendNotification("PAUSE_VIDEO", payload);
                              }
                              else{
                  buttons[i].className = buttons[i].className.replace("toggled-on", "toggled-off");
                  Remote.hideModule(buttons[i].id);
                              }
      

      I have added this line “this.sendNotification(“PAUSE_VIDEO”, payload);”
      but MM doesnt process it.

      Is my usage of the code wrong ?

      posted in Troubleshooting
      Z
      zichao92
    • RE: MM to periodically run a python or JS script?

      Hi @tosti007 ,

      I found out that by making use of the “exec” command works too. I came across this command while i was looking at the PIR sensor module ( https://github.com/paviro/MMM-PIR-Sensor ) . Thanks for sharing anyway!

      posted in Requests
      Z
      zichao92
    • Magic Mirror Running a python script upon "DISPLAY=:0 npm start"

      As stated above, i have this issue with my magic mirror. Upon executing display=:0 npm start, my magic mirror will run this python script name LED.py for some reason. Can anyone assist me with this?

      posted in Troubleshooting
      Z
      zichao92
    • RE: MMM-PIR-Sensor - White Screen

      Hi @jwhittaker ,
      Previously i had a working node_modules that Ive installed through npm install ( Cant rmb how i got it but i managed to create a back up copy of it). Subsequently when I tried to use npm install on a new raspberry pi, it didnt work as intended.

      What i did was instead of using npm install, I bypassed it by inserting the node_module that i previously salvaged and it worked for some reasons.

      posted in Troubleshooting
      Z
      zichao92
    • RE: MMM-PIR-Sensor - White Screen

      Hi @Medo ,
      I managed to get it working in an ugly way. Doesnt matter, it works. Thanks for your help!

      posted in Troubleshooting
      Z
      zichao92
    • RE: MMM-PIR-Sensor - White Screen

      Hi @Medo, Thanks for the reply.
      1.) I tried this method and it gives an output of the following error.

      pi@raspi:~/MagicMirror/modules/MMM-PIR-Sensor $ sudo npm install --unsafe-perm
      npm WARN prefer global npm@3.10.10 should be installed with -g
      > epoll@0.1.20 install /home/pi/MagicMirror/modules/MMM-PIR-Sensor/node_modules/epoll
      > node-gyp rebuild
      make: Entering directory '/home/pi/MagicMirror/modules/MMM-PIR-Sensor/node_modules/epoll/build'
        CXX(target) Release/obj.target/epoll/src/epoll.o
        SOLINK_MODULE(target) Release/obj.target/epoll.node
        COPY Release/epoll.node
      make: Leaving directory '/home/pi/MagicMirror/modules/MMM-PIR-Sensor/node_modules/epoll/build'
      > nslog@3.0.0 install /home/pi/MagicMirror/modules/MMM-PIR-Sensor/node_modules/nslog
      > node-gyp rebuild
      make: Entering directory '/home/pi/MagicMirror/modules/MMM-PIR-Sensor/node_modules/nslog/build'
        CXX(target) Release/obj.target/nslog/src/main.o
        CXX(target) Release/obj.target/nslog/src/nslog_linux.o
        SOLINK_MODULE(target) Release/obj.target/nslog.node
        COPY Release/nslog.node
      make: Leaving directory '/home/pi/MagicMirror/modules/MMM-PIR-Sensor/node_modules/nslog/build'
      > Magic-Mirror-Module-PIR-Sensor@1.1.0 postinstall /home/pi/MagicMirror/modules/MMM-PIR-Sensor
      > electron-rebuild -e ../../node_modules/electron-prebuilt
      Unable to find electron-prebuilt's version number, either install it or specify an explicit version
      npm ERR! Linux 4.4.38-v7+
      npm ERR! argv "/usr/bin/nodejs" "/usr/bin/npm" "install" "--unsafe-perm"
      npm ERR! node v7.3.0
      npm ERR! npm  v3.10.10
      npm ERR! code ELIFECYCLE
      npm ERR! Magic-Mirror-Module-PIR-Sensor@1.1.0 postinstall: `electron-rebuild -e ../../node_modules/electron-prebuilt`
      npm ERR! Exit status 255
      npm ERR!
      npm ERR! Failed at the Magic-Mirror-Module-PIR-Sensor@1.1.0 postinstall script 'electron-rebuild -e ../../node_modules/electron-prebuilt'.
      npm ERR! Make sure you have the latest version of node.js and npm installed.
      npm ERR! If you do, this is most likely a problem with the Magic-Mirror-Module-PIR-Sensor package,
      npm ERR! not with npm itself.
      npm ERR! Tell the author that this fails on your system:
      npm ERR!     electron-rebuild -e ../../node_modules/electron-prebuilt
      npm ERR! You can get information on how to open an issue for this project with:
      npm ERR!     npm bugs Magic-Mirror-Module-PIR-Sensor
      npm ERR! Or if that isn't available, you can get their info via:
      npm ERR!     npm owner ls Magic-Mirror-Module-PIR-Sensor
      npm ERR! There is likely additional logging output above.
      npm ERR! Please include the following file with any support request:
      npm ERR!     /home/pi/MagicMirror/modules/MMM-PIR-Sensor/npm-debug.log
      
      1. Yea it’s in the file directory ( MagicMirror/modules/MMM-PIR_Sensor )

      Note from admin: Please use Markdown on code snippets for easier reading!

      posted in Troubleshooting
      Z
      zichao92
    • RE: MMM-PIR-Sensor - White Screen

      Hi @Medo ,
      I have gotten the white screen problem as well and my raspberry pi configuration is similar to yours ( running on PIXEL with the latest nodejs).

      However, upon using option 2 from your solution. I have obtained this error :

      npm ERR! Linux 4.4.38-v7+
      npm ERR! argv "/usr/bin/nodejs" "/usr/bin/npm" "install" "--unsafe-perm"
      npm ERR! node v7.3.0
      npm ERR! npm  v3.10.10
      npm ERR! code ELIFECYCLE
      npm ERR! Magic-Mirror-Module-PIR-Sensor@1.1.0 postinstall: `electron-rebuild -e                                                                                                                                                              ../../node_modules/electron-prebuilt`
      npm ERR! Exit status 255
      npm ERR!
      npm ERR! Failed at the Magic-Mirror-Module-PIR-Sensor@1.1.0 postinstall script '                                                                                                                                                             electron-rebuild -e ../../node_modules/electron-prebuilt'.
      npm ERR! Make sure you have the latest version of node.js and npm installed.
      npm ERR! If you do, this is most likely a problem with the Magic-Mirror-Module-P                                                                                                                                                             IR-Sensor package,
      npm ERR! not with npm itself.
      npm ERR! Tell the author that this fails on your system:
      npm ERR!     electron-rebuild -e ../../node_modules/electron-prebuilt
      npm ERR! You can get information on how to open an issue for this project with:
      npm ERR!     npm bugs Magic-Mirror-Module-PIR-Sensor
      npm ERR! Or if that isn't available, you can get their info via:
      npm ERR!     npm owner ls Magic-Mirror-Module-PIR-Sensor
      npm ERR! There is likely additional logging output above.
      
      npm ERR! Please include the following file with any support request:
      npm ERR!     /home/pi/MagicMirror/modules/MMM-PIR-Sensor/npm-debug.log
      

      Does anyone have solution to this?


      Note from admin: Please use Markdown on code snippets for easier reading!

      posted in Troubleshooting
      Z
      zichao92
    • MM to periodically run a python or JS script?

      Hi there,

      Im still relatively new to the world of Magic Mirror and programming as well. As per topic, I have created a script that generates a JSON file as an output and i would like MM to make use of this output in one of my modules.

      is this possible?

      posted in Requests
      Z
      zichao92
    • RE: MM phone on Tablet or Smart Phone

      @chrisfoerg Alright i got it working.
      Thanks!

      posted in Requests
      Z
      zichao92
    • RE: MM phone on Tablet or Smart Phone

      @Ultimatum22 Hi there,

      Thanks for the reply. Will it be IPv4 of my magic mirror? Im not too sure if im heading the right way as my IPv4 address leads me to my IP camera of the PIcamera.

      posted in Requests
      Z
      zichao92
    • MM phone on Tablet or Smart Phone

      Hey there,

      I’m just wondering if there’s a way on projecting the MM display on a mobile device, lets say on our smart phone or tablets? Is this possible ?

      posted in Requests
      Z
      zichao92
    • RE: Displaying JSON results onto my MagicMirror

      @strawberry-3-141 , thanks for the reply. Will check out the pages that you mentioned!

      posted in Development
      Z
      zichao92
    • Displaying JSON results onto my MagicMirror

      Hi there,

      Im recently introduced to the applications of Raspberry Pi .I was amazed by Magic Mirror’s modules and applications, however, im very new to coding so please pardon me for my lack of understanding.

      Currently im trying to create a new module for my Magic Mirror, I have obtained a python script that generates a JSON file as an output. My current issue is that Im not too sure how i can display these results onto my MagicMirror as part of my module. I studied some of the default magic mirror and most of them uses XML to process the API calls. I tried researching online about using Js to run a local python script but it seems to be fruitless =/ .

      Hence, im seeking a little help from the community of MagicMirror

      posted in Development
      Z
      zichao92
    • 1 / 1