MagicMirror Forum

    • Register
    • Login
    • Search
    • Recent
    • Tags
    • Unsolved
    • Solved
    • MagicMirror² Repository
    • Documentation
    • Donate
    • Discord
    MagicMirror² v2.24.0 is available! For more information about this release, check out this topic.

    SOLVED Can't get MMM-Facial-Recognition working

    Troubleshooting
    2
    6
    1395
    Loading More Posts
    • Oldest to Newest
    • Newest to Oldest
    • Most Votes
    Reply
    • Reply as topic
    Log in to reply
    This topic has been deleted. Only users with topic management privileges can see it.
    • J
      jorgh6 last edited by

      Hi All,

      I’m running Magic Mirror on a Pi 3B+, and I’m using the Pi V2 camera module.
      I’ve installed the module MMM-Facial-Recognition and the required training tools. After training the model, and verified it positively identifies me using the supplied test tooling, I’ve configured and enabled the module within Magic Mirror.
      The module seems active, as only default classes appear on the mirror, however, if I’m in front of the camera, nothing changes.
      I’ve basically used the config as supplied followed the instructions.
      Anyone a clue on where I can check what’s going wrong here?

      Kind regards,

      Jorg

      1 Reply Last reply Reply Quote 0
      • S
        sdetweil last edited by

        turn on the developers window with ctrl-shift-i
        then select the console tab, and look for messages as you move about

        also, how are you starting MM? with pm2? or your own command (npm start)

        the pm2.log file might show something

        Sam

        Create a working config
        How to add modules

        1 Reply Last reply Reply Quote 0
        • J
          jorgh6 last edited by

          Ok, thanks for the info. I’ve found that the magicmodule is supspended as a result of it crashing. Error in the log:
          0|MagicMir | TypeError: PythonShell is not a constructor
          0|MagicMir | at Class.python_start (/home/pi/MagicMirror/modules/MMM-Facial-Recognition/node_helper.js:11:21)
          0|MagicMir | at Class.socketNotificationReceived (/home/pi/MagicMirror/modules/MMM-Facial-Recognition/node_helper.js:40:14)
          0|MagicMir | at Socket. (/home/pi/MagicMirror/modules/node_modules/node_helper/index.js:113:11)
          0|MagicMir | at Socket.emit (events.js:182:13)
          0|MagicMir | at /home/pi/MagicMirror/node_modules/socket.io/lib/socket.js:528:12
          0|MagicMir | at process._tickCallback (internal/process/next_tick.js:61:11)

          I’ve seen other reports of this issue, at least now I’ve got a lead where to look.

          Kind regards,

          1 Reply Last reply Reply Quote 0
          • S
            sdetweil last edited by

            did you run npm install in the MMM-Facial-Recognition folder?

            Sam

            Create a working config
            How to add modules

            1 Reply Last reply Reply Quote 0
            • J
              jorgh6 last edited by

              @jorgh6 said in Can't get MMM-Facial-Recognition working:

              TypeError: PythonShell is not a constructor

              This issue is discussed at https://github.com/paviro/MMM-Facial-Recognition/issues/58 . So I’ll pick it up from there. Apparently some api changes on recent PythonShell updates, there are more modules suffering from the same issue.

              1 Reply Last reply Reply Quote 0
              • J
                jorgh6 last edited by

                Got it working by changing two lines in node_helper.js (changes in bold).

                Line 4:
                const {PythonShell} = require(‘python-shell’);
                Line 11:
                const pyshell = new PythonShell(‘modules/’ + this.name + ‘/facerecognition/facerecognition.py’, { pythonPath: ‘python’, mode: ‘json’, args: [JSON.stringify(this.config)]});

                1 Reply Last reply Reply Quote 0
                • 1 / 1
                • First post
                  Last post
                Enjoying MagicMirror? Please consider a donation!
                MagicMirror created by Michael Teeuw.
                Forum managed by Paul-Vincent Roll and Rodrigo Ramírez Norambuena.
                This forum is using NodeBB as its core | Contributors
                Contact | Privacy Policy