I’m trying to use this model on my Raspberry Pi Zero W with the Raspberry Cam. I run
MM in serveronly mode, using the Midori-browser. This setup itself works fine and also the camera is able to make pictures
raspistill -o testpicture.jpg
However, if I try to add the ‘motiondetector’ module to the config I just get an empty (black, but not switched of) screen after reboot. This is even the case for a very small config.js :
var config = {
port: 8080,
ipWhitelist: ["127.0.0.1", "::ffff:127.0.0.1", "::1"],
language: "en",
timeFormat: 24,
units: "metric",
modules: [
{
module: "clock",
position: "top_left"
},
{
module: 'motiondetector',
config: {
timeout: 5*60*1000
}
},
]
};
/*************** DO NOT EDIT THE LINE BELOW ***************/
if (typeof module !== "undefined") {module.exports = config;}
Things I did:
cd ~/MagicMirror/modules
git clone https://github.com/alexyak/motiondetector
Added line bcm2835-v4l2
to /etc/modules
and hdmi_blanking=1
to /boot/config.txt
If I omit the motiondetecotor entry in the config.js it loads fine and I can see the loaded modules. If I execute
/opt/vc/bin/tvservice -o
the screen goes off (completely black). I I afterwards run
/opt/vc/bin/tvservice --preferred && sudo chvt 6 && sudo chvt 7
the background light of the screen goes on, however the modules that were there previously don’t show up again ( I waited for several minutes).
If I run
/opt/vc/bin/tvservice --preferred && sudo chvt 6 && sudo chvt 2
the modules become visible again. Therefore I changed the line in
~/MagicMirror/modules/motiondetector/node_helper.js
accordingly. However then I got still an empty screen and in the log:
Jul 16 18:59:23 me startMagicMirror.sh[480]: ** Message: console message: [native code] @0: Starting module: motiondetector
Jul 16 18:59:23 me startMagicMirror.sh[480]: ** Message: console message: http://localhost:8080/modules/motiondetector//motiondetector.js @39: TypeError: Attempted to assign to readonly property.
Jul 16 18:59:24 me startMagicMirror.sh[480]: monitor :state 0x12000a [HDMI DMT (82) RGB full 16:9], 1920x1080 @ 60.00Hz, progressive
Jul 16 18:59:24 me startMagicMirror.sh[480]: ** Message: console message: http://localhost:8080/js/main.js @134: TypeError: null is not an object (evaluating 'moduleWrapper.getElementsByClassName')
To me as a beginner it looks like a permission problem. However even making the motiondetector folder and all files therein rw for everybody it didn’t work.
I hope that somebody who has knowledge about JS can comment on this issue. Many thanks in advance.