mboskamp / MMM-PIR

This MagicMirror module monitors a PIR sensor and turns on/off your display. You can even run custom scripts and control it via Telegram.
16 stars 6 forks source link

MMM-ModuleScheduler stops working if MMM-PIR is active #3

Open flo269 opened 6 years ago

flo269 commented 6 years ago

Hi,

I need some help here please :-)

I’m on latest master and everything works fine. BUT when I activate MMM-PIR, one of my MMM-ModuleScheduler schedules stops working. When I comment out MMM-PIR from the config everything works as expected.

Could someone maybe point me in a direction of where to dig in deeper to find out whats going wrong?

Thanks!!

Cheers Flo

Here is my config:

/* Magic Mirror Config Sample
 *
 * By Michael Teeuw http://michaelteeuw.nl
 * MIT Licensed.
 *
 * For more information how you can configurate this file
 * See https://github.com/MichMich/MagicMirror#configuration
 *
 */

var config = {
    address: "", // Address to listen on, can be:
                          // - "localhost", "127.0.0.1", "::1" to listen on loopback interface
                          // - another specific IPv4/6 to listen on a specific interface
                          // - "", "0.0.0.0", "::" to listen on any interface
                          // Default, when address config is left out, is "localhost"
    port: 8080,
    ipWhitelist: [],  // Set [] to allow all IP addresses
                 //["127.0.0.1", "::ffff:127.0.0.1", "::1", "::ffff:10.10.10.51"],                                          // or add a specific IPv4 of 192.168.1.5 :
                                                           // ["127.0.0.1", "::ffff:127.0.0.1", "::1", "::ffff:192.168.1.5"],
                                                           // or IPv4 range of 192.168.3.0 --> 192.168.3.15 use CIDR format :
                                                           // ["127.0.0.1", "::ffff:127.0.0.1", "::1", "::ffff:192.168.3.0/28"],
    language: "en",
    timeFormat: 24,
    units: "metric",
    electronOptions: {
        fullscreen: true,
      },

    modules: [
        {
            module: "alert"
        },
        {
      module: 'MMM-Remote-Control'
    },
        {
            module: 'MMM-ModuleScheduler',
            config: {
                    notification_schedule: [
                    // RESTART THE MAGICMIRROR PROCESS AT 2am EVERY day
                    {notification: 'REMOTE_ACTION', schedule: '0 2 * * *', payload: {action: "RESTART"}},
                    ],
                    // SHOW MODULES WITH THE CLASS 'go2work_scheduler' AT 06:00 AND HIDE AT 10:00 EVERY DAY
                    global_schedule: {from: '0 6 * * *', to: '0 10 * * *', groupClass: 'go2work_scheduler' }
                  },
    },
        {
            module: "updatenotification",
            position: "top_bar"
        },
        {
            module: "clock",
            position: "top_left"
        },
        {
          module: 'worldclock',
          position: 'top_left', // This can be any of the regions, best results in top_left or top_right regions
          config: {
            timeFormat: 'HH:mm', //defined in moment.js format()
            style: 'top', //predefined 4 styles; 'top', 'left','right','bottom'
            clocks: [
              {
                title: "Bali", // Too long title could cause ugly text align.
                timezone: "Asia/Makassar", //When omitted, Localtime will be displayed. It might be not your purporse, I bet.
                flag: "id",
              },
                ]
            }
        },
        {
            module: "calendar",
            header: "Termine",
            position: "top_left",
            config: {
              displaySymbol: false,
                calendars: [
                    {
                        url: '',
                        auth: {
                            user: '',
                            pass: '',
                            method: 'basic'
                              }
                    },
                    {
                        url: '',
                        auth: {
                                user: '',
                                pass: ''
                                method: 'basic'
                                }
                    },
                ],
            }
        },
        {
            module: "calendar",
            header: "",
            position: "top_left",
            config: {
              maximumEntries: "3",
                displaySymbol: false,
                calendars: [
                    {
                        url: '',
                        symbol: 'trash',
                        auth: {
                                user: '',
                                pass: '',
                                method: 'basic'
                                }
                    },
                ],
            }
        },
        {
            module: "currentweather",
            position: "top_right",
            config: {
                location: "",
                locationID: "",  //ID from http://www.openweathermap.org/help/city_list.txt
                appid: ""
            }
        },
        {
            module: "weatherforecast",
            position: "top_right",
            header: "Weather Forecast",
            config: {
                location: "",
                locationID: "",  //ID from http://www.openweathermap.org/help/city_list.txt
                appid: ""
            }
        },
        {
            module: "newsfeed",
            position: "bottom_bar",
            config: {
                feeds: [
                    {
                        title: "Der Postillion",
                        url: "http://feeds.feedburner.com/blogspot/rkEL?format=xml"
                    },
                    {
                        title: "Tagesschau",
                        url: "http://www.tagesschau.de/xml/rss2"
                    }
                ],
                showSourceTitle: true,
                showPublishDate: true
            }
        },
        {
    module: 'MMM-PIR',
    position: 'bottom_center',
    config: {
        sensorPin: 22,
        delay: 30000,
        turnOffDisplay: true,
        showCountdown: false
            }
        },
        {
            module: 'MMM-DWD-WarnWeather',
            position: 'top_right',
            config: {
                region: '',
                changeColor: true,
                minutes: false,
                displayRegionName: true,
                interval: 10 * 60 * 1000, // every 10 minutes
                longversion: true,
                loadingText: 'Warnungen werden geladen...',
                noWarningText: 'Keine Warnungen'
                }
        },
    {
        module: 'MMM-DWD-WarnWeather',
        position: 'top_right',
            classes: 'test_scheduler',
        config: {
                region: '',
        changeColor: true,
        minutes: false,
        displayRegionName: true,
        interval: 10 * 60 * 1000, // every 10 minutes
        loadingText: 'Warnungen werden geladen...',
        noWarningText: 'Keine Warnungen'
        }
    },
        {
        module: 'MMM-GoogleMapsTraffic',
        position: 'top_left',
            classes: 'scheduler',
        config: {
                module_schedule: {from: '0 6 * * *', to: '0 10 * * *' },
            key: '',
            lat: ,
            lng: ,
            height: '300px',
            width: '300px'
                }
    },
        {
            module: 'MMM-rfacts',
            position: 'bottom_bar'
        },
        { module: 'MMM-NiceThings',
            position: 'lower_third'
      },
        {
            module: 'DailyXKCD',
            position: 'lower_third',
            config: {
                invertColors: true,
                randomComic: true,
                titleFont: 'small',
                title: true,
                altText: false
                }
        },
    ]
};

/*************** DO NOT EDIT THE LINE BELOW ***************/
if (typeof module !== "undefined") {module.exports = config;}
'''

Here is the pm2 out log:

Starting MagicMirror: v2.3.1
Loading config ...
Loading module helpers ...
No helper found for module: alert.
Initializing new module helper ...
Module helper loaded: MMM-Remote-Control
Initializing new module helper ...
Module helper loaded: MMM-ModuleScheduler
Initializing new module helper ...
Module helper loaded: updatenotification
No helper found for module: clock.
No helper found for module: worldclock.
Initializing new module helper ...
Module helper loaded: calendar
No helper found for module: currentweather.
No helper found for module: weatherforecast.
Initializing new module helper ...
Module helper loaded: newsfeed
Initializing new module helper ...
Module helper loaded: MMM-PIR
Initializing new module helper ...
Module helper loaded: MMM-DWD-WarnWeather
No helper found for module: MMM-GoogleMapsTraffic.
Initializing new module helper ...
Module helper loaded: MMM-rfacts
Initializing new module helper ...
Module helper loaded: MMM-NiceThings
Initializing new module helper ...
Module helper loaded: DailyXKCD
All module helpers loaded.
Starting server on port 8080 ... 
You're using a full whitelist configuration to allow for all IPs
Server started ...
Connecting socket for: MMM-Remote-Control
Starting node helper for: MMM-Remote-Control
Connecting socket for: MMM-ModuleScheduler
Starting node helper for: MMM-ModuleScheduler
Connecting socket for: updatenotification
Connecting socket for: calendar
Starting node helper for: calendar
Connecting socket for: newsfeed
Starting module: newsfeed
Connecting socket for: MMM-PIR
Starting module helper: MMM-PIR
Connecting socket for: MMM-DWD-WarnWeather
MMM-DWD-WarnWeather helper started...
Connecting socket for: MMM-rfacts
Starting module: MMM-rfacts
Connecting socket for: MMM-NiceThings
Starting node_helper for: MMM-NiceThings
Connecting socket for: DailyXKCD
Starting node helper: DailyXKCD
Sockets connected & modules started ...
Launching application.
MMM-ModuleScheduler is removing all scheduled jobs
MMM-ModuleScheduler received CREATE_NOTIFICATION_SCHEDULE
MMM-ModuleScheduler is scheduling REMOTE_ACTION using "0 2 * * *
MMM-ModuleScheduler has scheduled REMOTE_ACTION
MMM-ModuleScheduler will next send REMOTE_ACTION at Mon Apr 23 2018 02:00:00 GMT+0200 (CEST)
Create new calendar fetcher for url: - Interval: 300000
Create new calendar fetcher for url: - Interval: 300000
Create new calendar fetcher for url:  - Interval: 300000
Create new news fetcher for url: http://feeds.feedburner.com/blogspot/rkEL?format=xml - Interval: 300000
Create new news fetcher for url: http://www.tagesschau.de/xml/rss2 - Interval: 300000
I made this website for you.
Notification: GET_COMIC Payload: [object Object]
mboskamp commented 6 years ago

Hey Flo,

Sorry for the late response. Have you been able to solve your problem? Your config looks ok to me. At least the MMM-PIR part. I am quite busy at the moment and I would need to setup MMM-ModuleScheduler first (as I don't use it at the moment) so unfortunately I cannot look into this issue right now. I hope to find some time in the near future. ;)

Please let me know if you made any progress so far. Thanks, Miklas

Ebirts commented 5 years ago

Hi, I have the same problem as this or similar. On a clean install of Rasbian also clean install of Magic Mirror. Only added this module to test on clean install, soon as I put the module in the config.js it crashes MM and does not start. MM only starts if I comment out the MM-PIR.

This is what is being added to the config.

{ module: 'MMM-PIR', position: 'top_right', config: { sensorPin: '4', delay: '10000', turnOffDisplay: true, showCountdown: true, } },

Any ideas what is causing this? Anything might of changed since the module was first done to make this happen?

Steve

djay07 commented 5 years ago

same here

Log:

/home/pi/MagicMirror/node_modules/electron/dist/electron js/electron.js: symbol lookup error: /home/pi/MagicMirror/modules/MMM-PIR/node_modules/epoll/build/Release/epoll.node: undefined symbol: _ZN2v816FunctionTemplate3NewEPNS_7IsolateEPFvRKNS_20FunctionCallbackInfoINS_5ValueEEEENS_5LocalIS4_EENSA_INS_9SignatureEEEiNS_19ConstructorBehaviorENS_14SideEffectTypeE npm ERR! file sh npm ERR! code ELIFECYCLE npm ERR! errno ENOENT npm ERR! syscall spawn npm ERR! magicmirror@2.7.1 start: sh run-start.sh npm ERR! spawn ENOENT npm ERR! npm ERR! Failed at the magicmirror@2.7.1 start script. npm ERR! This is probably not a problem with npm. There is likely additional logging output above.

npm ERR! A complete log of this run can be found in: npm ERR! /home/pi/.npm/_logs/2019-05-23T16_48_30_084Z-debug.log

@mboskamp can you look into it?