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

MMM-FRITZ-Box-Callmonitor throws an error after enabling phonebook sync



  • Hi there,

    I recently build up a magicmirror2 install on a raspberry Pi Zero W.
    The MM is working and now I’m playing around with modules.

    After installing the MMM-FRITZ-Box-Callmonitor module it shows incoming calls and also call history. But when I activate the phonebook sync it throws me an error on the console:

    Received config for MMM-FRITZ-Box-Callmonitor
    MMM-FRITZ-Box-Callmonitor is waiting for incoming calls.
    Starting access to FRITZ!Box...
    Whoops! There was an uncaught exception...
    TypeError: PythonShell is not a constructor
        at Class.loadDataFromAPI (/home/pi/MagicMirror/modules/MMM-FRITZ-Box-Callmonitor/node_helper.js:216:17)
        at Class.socketNotificationReceived (/home/pi/MagicMirror/modules/MMM-FRITZ-Box-Callmonitor/node_helper.js:62:10)
        at Socket. (/home/pi/MagicMirror/modules/node_modules/node_helper/index.js:113:11)
        at emitTwo (events.js:125:13)
        at Socket.emit (events.js:213:7)
        at /home/pi/MagicMirror/node_modules/socket.io/lib/socket.js:513:12
        at _combinedTickCallback (internal/process/next_tick.js:131:7)
        at process._tickCallback (internal/process/next_tick.js:180:9)
    MagicMirror will not quit, but it might be a good idea to check why this happened. Maybe no internet connection?
    If you think this really is an issue, please open an issue on GitHub: https://github.com/MichMich/MagicMirror/issues
    

    The config for the module is:

    	{
    		module: "MMM-FRITZ-Box-Callmonitor",
    		position: "bottom_left",	// This can be any of the regions. Best results in left or right regions.
    		header: "Letzte Anrufe", // This is optional
    		config: {
    			showContactsStatus: "true",
    			fritzIP: "192.168.178.1",
    			showContactsStatus: "true",
    			maximumCallDistance: "9999999999",
    			username: "username",
    			password: "password",
    			debug: "true",
    			// See 'Configuration options' for more information.
    		}
    	},
    

    Where can I see the debug informations? On the MM screen I only see this:
    0_1536352119253_c946f163-3bdc-491a-9209-2de5d31e8aea-image.png
    and the sync circle is running without ending.

    The issue occures everytime I reload the MM website.

    During the install of the module I don’t get errors but I’m not that firm with linux to go deeper in the programming.

    Maybe someone can help?

    Thanks,
    kovu94



  • @kovu94

    Although I did not have a problem with syncing, (actually I was not getting any call history) my logs gave a similar error.

    TypeError: PythonShell is not a constructor
        at Class.loadDataFromAPI (/home/pi/MagicMirror/modules/MMM-FRITZ-Box-Callmonitor/node_helper.js:216:17)
        at Class.socketNotificationReceived (/home/pi/MagicMirror/modules/MMM-FRITZ-Box-Callmonitor/node_helper.js:69:9)
        at Socket. (/home/pi/MagicMirror/modules/node_modules/node_helper/index.js:113:11)
        at emitTwo (events.js:126:13)
        at Socket.emit (events.js:214:7)
        at /home/pi/MagicMirror/node_modules/socket.io/lib/socket.js:528:12
        at _combinedTickCallback (internal/process/next_tick.js:131:7)
        at process._tickCallback (internal/process/next_tick.js:180:9)
    

    Looking for the error on internet I found some references to the PythonShell dependency that is being used. It seems that PythonShell is now running at version 1.0.7. Where it was running @ version 0.5.0 during development of the module.

    I have reverted back to 0.5.0 and things are working like they should!

    Go to cd ~/MagicMirror/modules/MMM-FRITZ-Box-Callmonitor/node_modules.
    Remove the Python-shell directory and all its content:
    rm python-shell -r.
    Now reinstall the old version with:
    npm install python-shell@0.5.0.

    Restart your MagicMirror and it should work.

    Al least it did for me. ☺

    Hein-Jan



  • @kovu94 - You can modify the 3 Files documented here to fix the problem

    Sandy2503