MagicMirror² v2.14.0 is available! For more information about this release, check out this topic.

MMM Facial Recognition - not working

  • Hi to all!
    I am looking for your help.
    I am a newbie and i am setting up my magic mirror
    I use a usbcamera witch i have managed to get it to work to capture my photos for profile and face recognition but when i start the magic mirror it doesn’t turn on ( i have set to “true” the useUSBCAM at config)
    I also get these errors on startup .
    (Launching application.
    ERROR! Could not find main module js file.
    Create new calendar fetcher for url: - Interval: 300000
    Create new news fetcher for url: - Interval: 300000
    Create new news fetcher for url: - Interval: 300000
    [MMM-Facial-Recognition] Facerecognition started…
    [MMM-Facial-Recognition] Loading training data…
    [MMM-Facial-Recognition] ALGORITHM: LBPH
    Whoops! There was an uncaught exception…
    { Error: OpenCV Error: Unspecified error (File can’t be opened for writing!) in load, file /build/opencv-ISmtkH/opencv-, line 325
    Traceback (most recent call last):
    File “modules/MMM-Facial-Recognition/facerecognition/”, line 59, in
    cv2.error: /build/opencv-ISmtkH/opencv- error: (-2) File can’t be opened for writing! in function load

    at PythonShell.parseError (/home/pi/MagicMirror/modules/MMM-Facial-Recognition/node_modules/python-shell/index.js:190:17)
    at terminateIfNeeded (/home/pi/MagicMirror/modules/MMM-Facial-Recognition/node_modules/python-shell/index.js:98:28)
    at ChildProcess. (/home/pi/MagicMirror/modules/MMM-Facial-Recognition/node_modules/python-shell/index.js:88:9)
    at emitTwo (events.js:106:13)
    at ChildProcess.emit (events.js:191:7)
    at Process.ChildProcess._handle.onexit (internal/child_process.js:215:12)

    executable: ‘python’,
    options: null,
    script: ‘modules/MMM-Facial-Recognition/facerecognition/’,
    args: [ ‘{“recognitionAlgorithm”:1,“lbphThreshold”:50,“fisherThreshold”:250,“eigenThreshold”:3000,“useUSBCam”:true,“trainingFile”:"/modules/MMM-Facial-Recognition/training.xml",“interval”:2,“logoutDelay”:15,“users”:[“Christos”],“defaultClass”:“default”,“everyoneClass”:“everyone”,“welcomeMessage”:true}’ ],
    exitCode: 1 }
    MagicMirror will not quit, but it might be a good idea to check why this happened. Maybe no internet connection?)

    Please I would appreciate any help
    thank you in advance

  • Project Sponsor Module Developer

    @xchribiza sounds like missing file permission

  • Is your training file in /modules/MMM-Facial-Recognition/ ? (it is probably in /modules/MMM-Facial-Recognition-Tools/ ), check the path again, and do some change in your config.js

  • @strawberry-3.141 How do I fix this ?? Any idea ?

  • @detuma I have copied the training.xlm to both locations (tools etc) and checked with the both location in config.js
    nothing happended.
    It seems like the camera is not opening (i use a usbcamera)

  • I’m pretty sure you still wrote a wrong path, check this post

Log in to reply