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

    Posts

    Recent Best Controversial
    • RE: MMM-SleepWake turn off but not turn on

      @sdetweil Thank you for sharing :)

      posted in Troubleshooting
      K
      krosamont
    • RE: MMM-SleepWake turn off but not turn on

      @sdetweil Thanks sincerely for your time and your willingness. I would like to start to fork and try implement modification on some modules but I am not confident enough in Javascript. Do you have any suggestion for me. Where to start? Should I go with nodeJS basic tutorials?

      posted in Troubleshooting
      K
      krosamont
    • RE: MMM-SleepWake turn off but not turn on

      @chanster @sdetweil Thanks for your help guys.
      I understood my problem. I was trying to use facial recognition and motion detection at the same time with 2 different services. I can’t work with MMM-SleepWake and MMM-Face-Reco-DNN at the same time.

      posted in Troubleshooting
      K
      krosamont
    • RE: MMM-SleepWake turn off but not turn on

      @sdetweil I am sorry to hear that. I hope you will have a fast recovery!
      I don’t understand which parameters I am suppose to change inside motion.conf

      I have also checked the documentation but sorry…I don’t get your point.
      Here is the list of all the parameters linked to the HTTP based control :

      ############################################################
      # HTTP Based Control
      ############################################################
      
      # TCP/IP port for the http server to listen on (default: 0 = disabled)
      webcontrol_port 8080
      #webcontrol_port 0
      
      # Restrict control connections to localhost only (default: on)
      webcontrol_localhost on
      #webcontrol_localhost off
      
      # Output for http server, select off to choose raw text plain (default: on)
      webcontrol_html_output on
      #webcontrol_html_output off
      
      # Authentication for the http based control. Syntax username:password
      # Default: not defined (Disabled)
      ; webcontrol_authentication username:password
      
      # Parameters to include on webcontrol.  0=none, 1=limited, 2=advanced, 3=restricted
      # Default: 0 (none)
      webcontrol_parms 0
      
      posted in Troubleshooting
      K
      krosamont
    • RE: MMM-SleepWake turn off but not turn on

      @sdetweil

      I have just found 8080 and 8081…there is no 8083.
      I have changed them to 0:

      # TCP/IP port for the http server to listen on (default: 0 = disabled)
      #webcontrol_port 8080
      webcontrol_port 0
      
      # The mini-http server listens to this port for requests (default: 0 = disabled)
      # stream_port  8081
      stream_port 0
      

      I have an error when I run:

      pi@raspberrypi:~/MagicMirror $ sudo motion &
      pi@raspberrypi:~/MagicMirror $ npm start
      

      error:

      [18.01.2021 17:45.26.632] [ERROR] Whoops! There was an uncaught exception...
      [18.01.2021 17:45.26.640] [ERROR] PythonShellError: mmal: mmal_vc_port_enable: failed to enable port vc.null_sink:in:0(OPQV): ENOSPC
      mmal: mmal_port_enable: failed to enable connected port (vc.null_sink:in:0(OPQV))0x5b77ac0 (ENOSPC)
      mmal: mmal_connection_enable: output port couldn't be enabled
      Traceback (most recent call last):
        File "modules/MMM-Face-Reco-DNN/tools/facerecognition.py", line 80, in <module>
          vs = VideoStream(usePiCamera=True, rotation=args["rotateCamera"]).start()
        File "/home/pi/.virtualenvs/cv/lib/python3.7/site-packages/imutils/video/videostream.py", line 18, in __init__
          framerate=framerate, **kwargs)
        File "/home/pi/.virtualenvs/cv/lib/python3.7/site-packages/imutils/video/pivideostream.py", line 10, in __init__
          self.camera = PiCamera()
        File "/home/pi/.virtualenvs/cv/lib/python3.7/site-packages/picamera/camera.py", line 433, in __init__
          self._init_preview()
        File "/home/pi/.virtualenvs/cv/lib/python3.7/site-packages/picamera/camera.py", line 513, in _init_preview
          self, self._camera.outputs[self.CAMERA_PREVIEW_PORT])
        File "/home/pi/.virtualenvs/cv/lib/python3.7/site-packages/picamera/renderers.py", line 558, in __init__
          self.renderer.inputs[0].connect(source).enable()
        File "/home/pi/.virtualenvs/cv/lib/python3.7/site-packages/picamera/mmalobj.py", line 2212, in enable
          prefix="Failed to enable connection")
        File "/home/pi/.virtualenvs/cv/lib/python3.7/site-packages/picamera/exc.py", line 184, in mmal_check
          raise PiCameraMMALError(status, prefix)
      picamera.exc.PiCameraMMALError: Failed to enable connection: Out of resources
      
          at PythonShell.parseError (/home/pi/MagicMirror/modules/MMM-Face-Reco-DNN/node_modules/python-shell/index.js:254:21)
          at terminateIfNeeded (/home/pi/MagicMirror/modules/MMM-Face-Reco-DNN/node_modules/python-shell/index.js:129:32)
          at ChildProcess.<anonymous> (/home/pi/MagicMirror/modules/MMM-Face-Reco-DNN/node_modules/python-shell/index.js:121:13)
          at ChildProcess.emit (events.js:210:5)
          at Process.ChildProcess._handle.onexit (internal/child_process.js:272:12) {
        executable: '/home/pi/.virtualenvs/cv/bin/python3.7',
        options: null,
        script: 'modules/MMM-Face-Reco-DNN/tools/facerecognition.py',
        args: [
          '--cascade=modules/MMM-Face-Reco-DNN/tools/haarcascade_frontalface_default.xml',
          '--encodings=modules/MMM-Face-Reco-DNN/tools/encodings.pickle',
          '--usePiCamera=1',
          '--source=0',
          '--rotateCamera=0',
          '--method=dnn',
          '--detectionMethod=hog',
          '--interval=4000',
          '--output=0',
          '--extendDataset=False',
          '--dataset=modules/MMM-Face-Reco-DNN/dataset/',
          '--tolerance=0.6'
        ],
        exitCode: 1
      }
      [18.01.2021 17:45.26.642] [ERROR] MagicMirror will not quit, but it might be a good idea to check why this happened. Maybe no internet connection?
      [18.01.2021 17:45.26.643] [ERROR] If you think this really is an issue, please open an issue on GitHub: https://github.com/MichMich/MagicMirror/issues
      [18.01.2021 17:45.49.329] [LOG]   sleep-wake helper in socket notification=start_sleep
      

      weird…

      posted in Troubleshooting
      K
      krosamont
    • RE: MMM-SleepWake turn off but not turn on

      @sdetweil you mean that it’s normal if I don’t see the motion log when I run the mirror?

      posted in Troubleshooting
      K
      krosamont
    • RE: MMM-SleepWake turn off but not turn on

      Hello @chanster,
      How do you run your magic mirror project please?
      @sdetweil I have tried:

      pi@raspberrypi:~/MagicMirror $ sudo service motion start
      pi@raspberrypi:~/MagicMirror $ npm start
      

      Still nothing. And nothing appears in the log. I think this is the problem…

      If I do:

      pi@raspberrypi:~/MagicMirror $ sudo motion &
      pi@raspberrypi:~/MagicMirror $ npm start
      

      Then I get an error and the cam is playing my mirror but there, I have the log!!! :/

      I think we are close…:face_with_monocle:

      posted in Troubleshooting
      K
      krosamont
    • RE: MMM-SleepWake turn off but not turn on

      By the way, I have also noticed that no log are generated in motion.log when I am using the mirror? The log is generated only when I do this command:

      pi@raspberrypi:~ $ motion
      

      Is it normal?

      posted in Troubleshooting
      K
      krosamont
    • RE: MMM-SleepWake turn off but not turn on

      @sdetweil the default setting is:

      # Maximum number of frames to be captured per second.
      # Valid range: 2-100. Default: 100 (almost no limit).
      framerate 2
      

      and I have changed the gap event from 60 to 15:

      # Event Gap is the seconds of no motion detection that triggers the end of an event.
      # An event is defined as a series of motion images taken within a short timeframe.
      # Recommended value is 60 seconds (Default). The value -1 is allowed and disables
      # events causing all Motion to be written to one single movie file and no pre_capture.
      # If set to 0, motion is running in gapless mode. Movies don't have gaps anymore. An
      # event ends right after no more motion is detected and post_capture is over.
      event_gap 15
      

      It sounds good, isn’t it?

      I have also installed the module again :

      pi@raspberrypi:~/MagicMirror/modules/MMM-SleepWake $ npm install
      

      and I have tried to use your module without using MMM-Face-Reco-DNN…
      but still I don’t find the solution

      posted in Troubleshooting
      K
      krosamont
    • RE: MMM-SleepWake turn off but not turn on

      @sdetweil said in MMM-SleepWake turn off but not turn on:

      start/stop commands

      You mean going to the terminal and write:

      pi@raspberrypi:~/MagicMirror $ sudo service motion start
      pi@raspberrypi:~/MagicMirror $ sudo service motion stop
      

      I have done it. nothing happened

      posted in Troubleshooting
      K
      krosamont
    • RE: MMM-SleepWake turn off but not turn on

      @sdetweil thanks for the quick answer. Sorry I should have payed more attention to this. I have made the modification into motion.conf:

      # Command to be executed when an event starts. (default: none)
      # An event starts at first motion detected after a period of no motion defined by event_gap
      on_event_start /home/pi/MagicMirror/modules/MMM-SleepWake/external_motion started
      
      # Command to be executed when an event ends after a period of no motion
      # (default: none). The period of no motion is defined by option event_gap.
      on_event_end /home/pi/MagicMirror/modules/MMM-SleepWake/external_motion ended
      
      

      But it still doesn’t turn on after the sleep…

      posted in Troubleshooting
      K
      krosamont
    • MMM-SleepWake turn off but not turn on

      Hi. First of all, thanks for your work @sdetweil.
      I wanted to use your module but I don’t know what I did wrong.
      When no motion is detected, I am able to hide the screen but when I move. Nothing happen.

      I am using a Pi Camera module v2.

      I have tried to follow the documentation on your repository:

      1. I have added the module in config.js:
      pi@raspberrypi:~ $ nano MagicMirror/config/config.js
      {
          module: 'MMM-SleepWake',
          config:{
              delay:  0.5,               // default
              mode:  'hide'
              //debug: true
          }
      }
      
      1. I have made the changes required in motion.conf
      pi@raspberrypi:~ $ sudo nano /etc/motion/motion.conf
      
      # Command to be executed when an event starts. (default: none)
      # An event starts at first motion detected after a period of no motion defined by event_gap.
      ; on_event_start /home/pi/MagicMirror/modules/MMM-SleepWake/external_motion started
      
      # Command to be executed when an event ends after a period of no motion
      # (default: none). The period of no motion is defined by option event_gap.
      ; on_event_end /home/pi/MagicMirror/modules/MMM-SleepWake/external_motion ended
      

      Then I have checked if I had correctly installed the motion project and if it worked properly. Everything seems to work:

      pi@raspberrypi:~ $ /var/log/motion/motion.log
      
      [1865352:motion] [NTC] [ALL] [Jan 18 12:19:13] motion_startup: Using log type (ALL) log level (NTC)
      [1865352:motion] [NTC] [ENC] [Jan 18 12:19:13] ffmpeg_global_init: ffmpeg libavcodec version 58.35.100 libavformat version 58.20.100
      [0:motion] [NTC] [ALL] [Jan 18 12:19:13] main: Camera ID: 0 is from /etc/motion/motion.conf
      [0:motion] [NTC] [ALL] [Jan 18 12:19:13] main: Camera ID: 0 Camera Name: (null) Device: /dev/video0
      [0:motion] [NTC] [ALL] [Jan 18 12:19:13] main: Waiting for threads to finish, pid: YYYY
      [1:ml1] [NTC] [ALL] [Jan 18 12:19:13] motion_init: Camera 0 started: motion detection Enabled
      [1:ml1] [NTC] [VID] [Jan 18 12:19:13] vid_start: Opening V4L2 device
      [1:ml1] [NTC] [VID] [Jan 18 12:19:13] v4l2_start: Using videodevice /dev/video0 and input -1
      [0:wc0] [NTC] [STR] [Jan 18 12:19:13] http_bindsock: listening on 127.0.0.1 port XXXX
      [0:wc0] [NTC] [STR] [Jan 18 12:19:13] httpd_run: Started motion-httpd server on port XXXX (auth Disabled)
      [1:ml1] [NTC] [VID] [Jan 18 12:19:13] v4l2_get_capability:
      ------------------------
      cap.driver: "bm2835 mmal"
      cap.card: "mmal service 16.1"
      cap.bus_info: "platform:bcm2835-v4l2"
      cap.capabilities=0x85200005
      ------------------------
      [1:ml1] [NTC] [VID] [Jan 18 12:19:13] v4l2_get_capability: - VIDEO_CAPTURE
      [1:ml1] [NTC] [VID] [Jan 18 12:19:13] v4l2_get_capability: - VIDEO_OVERLAY
      [1:ml1] [NTC] [VID] [Jan 18 12:19:13] v4l2_get_capability: - READWRITE
      [1:ml1] [NTC] [VID] [Jan 18 12:19:13] v4l2_get_capability: - STREAMING
      [1:ml1] [NTC] [VID] [Jan 18 12:19:13] v4l2_select_input: name = "Camera 0", type 0x00000002, status 00000000
      [1:ml1] [NTC] [VID] [Jan 18 12:19:13] v4l2_select_input: - CAMERA
      [1:ml1] [NTC] [VID] [Jan 18 12:19:13] v4l2_select_input: Device does not support specifying PAL/NTSC norm
      [1:ml1] [NTC] [VID] [Jan 18 12:19:13] v4l2_do_set_pix_format: Testing palette YU12 (320x240)
      [1:ml1] [NTC] [VID] [Jan 18 12:19:13] v4l2_do_set_pix_format: Using palette YU12 (320x240) bytesperlines 320 sizeimage 115200 colorspace 00000001
      [1:ml1] [NTC] [VID] [Jan 18 12:19:13] v4l2_scan_controls: found control 0x00980900, "Brightness", range 0,100
      [1:ml1] [NTC] [VID] [Jan 18 12:19:13] v4l2_scan_controls:       "Brightness", default 50, current 50
      [1:ml1] [NTC] [VID] [Jan 18 12:19:13] v4l2_scan_controls: found control 0x00980901, "Contrast", range -100,100
      [1:ml1] [NTC] [VID] [Jan 18 12:19:13] v4l2_scan_controls:       "Contrast", default 0, current 0
      [1:ml1] [NTC] [VID] [Jan 18 12:19:13] v4l2_scan_controls: found control 0x00980902, "Saturation", range -100,100
      [1:ml1] [NTC] [VID] [Jan 18 12:19:13] v4l2_scan_controls:       "Saturation", default 0, current 0
      [1:ml1] [NTC] [VID] [Jan 18 12:19:13] v4l2_scan_controls: found control 0x00980918, "Power Line Frequency", range 0,3
      [1:ml1] [NTC] [VID] [Jan 18 12:19:13] v4l2_scan_controls:       "Power Line Frequency", default 1, current 1
      [1:ml1] [NTC] [VID] [Jan 18 12:19:13] v4l2_scan_controls: found control 0x0098090e, "Red Balance", range 1,7999
      [1:ml1] [NTC] [VID] [Jan 18 12:19:13] v4l2_scan_controls:       "Red Balance", default 1000, current 1000
      [1:ml1] [NTC] [VID] [Jan 18 12:19:13] v4l2_scan_controls: found control 0x0098090f, "Blue Balance", range 1,7999
      [1:ml1] [NTC] [VID] [Jan 18 12:19:13] v4l2_scan_controls:       "Blue Balance", default 1000, current 1000
      [1:ml1] [NTC] [ALL] [Jan 18 12:19:13] image_ring_resize: Resizing pre_capture buffer to 1 items
      [1:ml1] [NTC] [STR] [Jan 18 12:19:13] http_bindsock: listening on 127.0.0.1 port XXXX
      [1:ml1] [NTC] [ALL] [Jan 18 12:19:13] motion_init: Started motion-stream server on port XXXX (auth Disabled)
      [1:ml1] [NTC] [EVT] [Jan 18 12:19:17] event_newfile: File of type 8 saved to: /var/lib/motion/01-20210118121917.mkv
      [1:ml1] [NTC] [ALL] [Jan 18 12:19:17] motion_detected: Motion detected - starting event 1
      [1:ml1] [NTC] [ALL] [Jan 18 12:19:25] mlp_actions: End of event 1
      [0:wc0] [NTC] [STR] [Jan 18 12:19:25] httpd_run: motion-httpd - Finishing
      [0:wc0] [NTC] [STR] [Jan 18 12:19:25] httpd_run: motion-httpd Closing
      [0:wc0] [NTC] [STR] [Jan 18 12:19:25] motion_web_control: motion-httpd thread exit
      [1:ml1] [NTC] [ALL] [Jan 18 12:19:25] motion_loop: Thread exiting
      [1:ml1] [NTC] [STR] [Jan 18 12:19:25] stream_stop: Closing motion-stream listen socket & active motion-stream sockets
      [1:ml1] [NTC] [STR] [Jan 18 12:19:25] stream_stop: Closed motion-stream listen socket & active motion-stream sockets
      [1:ml1] [NTC] [VID] [Jan 18 12:19:25] vid_close: Cleaning up V4L2 device
      [1:ml1] [NTC] [VID] [Jan 18 12:19:25] v4l2_cleanup: Closing video device /dev/video0
      [0:motion] [NTC] [ALL] [Jan 18 12:19:26] main: Threads finished
      [0:motion] [NTC] [ALL] [Jan 18 12:19:27] main: Motion terminating
      [0:motion] [NTC] [ALL] [Jan 18 12:19:27] motion_remove_pid: Closing logfile (/var/log/motion/motion.log).
      

      And here is the log when I am using the magic mirror:

      pi@raspberrypi:~/MagicMirror $ npm start
      > magicmirror@2.14.0 start /home/pi/MagicMirror
      > DISPLAY="${DISPLAY:=:0}" ./node_modules/.bin/electron js/electron.js
      
      [18.01.2021 11:49.07.972] [LOG]   Starting MagicMirror: v2.14.0
      [18.01.2021 11:49.08.004] [LOG]   Loading config ...
      [18.01.2021 11:49.08.014] [LOG]   Loading module helpers ...
      [18.01.2021 11:49.08.909] [LOG]   Initializing new module helper ...
      [18.01.2021 11:49.08.916] [LOG]   handler helper in init
      [18.01.2021 11:49.08.917] [LOG]   Module helper loaded: MMM-SleepWake
      [18.01.2021 11:49.08.986] [LOG]   All module helpers loaded.
      [18.01.2021 11:49.09.126] [LOG]   Starting server on port XXXX ...
      [18.01.2021 11:49.09.149] [LOG]   Server started ...
      [18.01.2021 11:49.09.153] [LOG]   Connecting socket for: MMM-SleepWake
      [18.01.2021 11:49.09.153] [LOG]   handler helper in start
      [18.01.2021 11:49.09.157] [LOG]   Sockets connected & modules started ...
      [18.01.2021 11:49.09.535] [LOG]   Launching application.
      [18.01.2021 11:49.09.681] [WARN]  (electron) The default value of app.allowRendererProcessReuse is deprecated, it is currently "false".  It will change to be "true" in Electron 9.  For more information please check https://github.com/electron/electron/issues/18397
      [18.01.2021 11:49.11.953] [LOG]   sleep-wake helper in socket notification=config
      [18.01.2021 11:49.11.996] [LOG]    external source defined dir=/home/pi/MagicMirror/modules/MMM-SleepWake/motion
      [18.01.2021 11:49.12.005] [INFO]  Checking git for module: MMM-SleepWake
      [18.01.2021 11:49.41.955] [LOG]   sleep-wake helper in socket notification=start_sleep
      [18.01.2021 11:49.41.957] [LOG]   processing start sleep
      [18.01.2021 11:49.41.962] [LOG]   using HIDE approach
      [18.01.2021 11:50.14.012] [LOG]   Shutting down server...
      [18.01.2021 11:50.14.015] [LOG]   handler helper in stop
      

      I am not able to see what is wrong in my configuration. I hope someone will be able to help me.

      posted in Troubleshooting mmm-sleepwake magic mirror turn on turn off
      K
      krosamont
    • 1 / 1