Read the statement by Michael Teeuw here.
Can't get MMM-Facial-Recognition working
-
turn on the developers window with ctrl-shift-i
then select the console tab, and look for messages as you move aboutalso, how are you starting MM? with pm2? or your own command (npm start)
the pm2.log file might show something
-
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,
-
did you run npm install in the MMM-Facial-Recognition folder?
-
@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.
-
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)]});