fewieden / MMM-AlarmClock

Alarm Clock Module for MagicMirror²
MIT License
47 stars 18 forks source link

Popup to dismiss alarm isn't appearing when alarm goes off #48

Closed thisisjjd closed 3 months ago

thisisjjd commented 3 months ago

Platform (Hardware/OS): Raspberry Pi Model B Rev 1.2

Node version: 20.15.0

MagicMirror version: v2.28.0

Module version: 2.0.2

Description of the issue:

Display: Raspberry Pi 7-inch Touchscreen

I'm looking for some help/advice here.

I've been using MMM-AlarmClock for quite a while and been very happy. I recently rebuilt my system with the latest MagicMirror and Raspbian and modules and now when the alarm goes off, I no longer get the popup that you can click on to dismiss the alarm. I've tried a bunch of different configuration options, and it doesn't appear.

This is my config:

    {
        disabled: false,
        module: 'MMM-AlarmClock',
        position: 'top_center',
        config: {
        alarms: [
            { time: "06:00", days: [1,2,3,4,5], title: "Wake Up if you feel like it", message: "You DON'T have to go to work today!!!", sound: "https://fm909.wbur.org/wbur_www" },
            { time: "15:13", days: [0,1,2,3,4,5,6], title: "Temp alarm", message: "Testing 123", sound: "https://fm909.wbur.org/wbur_www" },

        ],
        timer: 3600000, 
        format: "dd H:mm",
        touch: true,
        popup: true,
        fade: true,
        fadeTimer: 30000,
        fadeStep: 0.0333,
        }
    },

This is what my screen looks like before the alarm goes off: before and this is what my screen looks like while the alarm is going off: after

Am I doing something wrong? Thanks for any advice you can provide.

thisisjjd commented 3 months ago

I did this to further debug:

And it still did not show the popup when the alarm went off.

This was the simple configuration I tested:

    modules: [
    {
        module: 'MMM-AlarmClock',
        position: 'middle_center',
        config: {
        alarms: [
            { 
            time: "11:30", 
            days: [0,1,2,3,4,5,6], 
            sound: 'alarm.mp3', 
            title: "title", 
            message: "message", 
            },
        ],
        touch: true, 
        popup: true,
        }
    },
    ]

I should probably also note that when the alarm is going off, touching anywhere on the screen does not turn off the alarm.

I must be doing something wrong because I can't believe this would be failing for everyone and no one else would have reported it.

Any advice appreciated.

fewieden commented 3 months ago

@thisisjjd I used your example config and the popup showed up for me. I also did a fresh install of the module with the same result. Do you see any errors in the browser/electron console?

image

thisisjjd commented 3 months ago

@fewieden: Thank you so much for your response.

That is very useful information. There must be something else in my config.js that is interacting badly with MMM-AlarmClock.

There is nothing in the browser Console of interest. By “Electron console” I assume you mean standard output of MagicMirror? Indeed, I do see something there. This is on startup, not on alarm activation:

[2024-07-30 09:52:13.212] [LOG] config template file not exists, no envsubst [2024-07-30 09:52:13.217] [LOG] Loading module helpers ... [2024-07-30 09:52:13.219] [LOG] No helper found for module: MMM-AlarmClock. [2024-07-30 09:52:13.220] [LOG] All module helpers loaded. [2024-07-30 09:52:13.242] [LOG] Starting server on port 8080 ...
0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0/home/jjd/MagicMirror/node_modules/electron/dist/electron exited with signal SIGTERM

(I deleted a bunch of the null characters — there were 1171 of them.)

I will work on modifying my config.js to see if I can eliminate this.

Thank you very much!

—Jim--

On Jul 28, 2024, at 10:42 AM, fewieden @.***> wrote:

@thisisjjd I used your example config and the popup showed up for me. I also did a fresh install of the module with the same result. Do you see any errors in the browser/electron console? image.png (view on web) — Reply to this email directly, view it on GitHub, or unsubscribe. You are receiving this because you were mentioned.Message ID: @.***>

thisisjjd commented 3 months ago

Well, those null characters (and the "electron exited") were apparently an artifact of how I was starting MagicMirror. I have adjusted my script and that problem has disappeared. However, the alarm popup still doesn't appear.

Here is my full config.js file:

let config = {
    address: "0.0.0.0",
    basePath: "/",
    ipWhitelist: [],
    logLevel: ["INFO", "LOG", "WARN", "ERROR", "DEBUG"], // Add "DEBUG" for even more logging
    timeFormat: 24,
    units: "imperial",

    modules: [
    {
        module: 'MMM-AlarmClock',
        position: 'middle_center',
        config: {
        alarms: [
            { 
            time: "12:09", 
            days: [0,1,2,3,4,5,6], 
            sound: 'alarm.mp3', 
            title: "title", 
            message: "message", 
            },
        ],
        touch: true, 
        popup: true,
        }
    },
    ]
};

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

Here is the browser console output:

main.js:583           Initializing MagicMirror².
translator.js:116     Loading core translation file: translations/en.json
translator.js:132     Loading core translation fallback file: translations/en.json
loader.js:160         Load script: modules/MMM-AlarmClock/MMM-AlarmClock.js
module.js:480         Module registered: MMM-AlarmClock
loader.js:133         Bootstrapping module: MMM-AlarmClock
loader.js:160         Load script: vendor/node_modules/moment/min/moment-with-locales.js
loader.js:137         Scripts loaded for: MMM-AlarmClock
loader.js:175         Load stylesheet: vendor/css/font-awesome.css
loader.js:175         Load stylesheet: modules/MMM-AlarmClock/MMM-AlarmClock.css
loader.js:140         Styles loaded for: MMM-AlarmClock
translator.js:99      MMM-AlarmClock - Load translation: translations/en.json
loader.js:143         Translations loaded for: MMM-AlarmClock
loader.js:175         Load stylesheet: css/custom.css
MMM-AlarmClock.js:167 Starting module: MMM-AlarmClock
main.js:602           All modules started!

And here is the application output:

> magicmirror@2.28.0 start
> DISPLAY="${DISPLAY:=:0}" ./node_modules/.bin/electron js/electron.js

[2024-07-30 12:07:33.347] [LOG]   Starting MagicMirror: v2.28.0 
[2024-07-30 12:07:33.505] [LOG]   Loading config ... 
[2024-07-30 12:07:33.510] [LOG]   config template file not exists, no envsubst 
[2024-07-30 12:07:33.515] [LOG]   Loading module helpers ... 
[2024-07-30 12:07:33.517] [LOG]   No helper found for module: MMM-AlarmClock. 
[2024-07-30 12:07:33.518] [LOG]   All module helpers loaded. 
[2024-07-30 12:07:33.536] [LOG]   Starting server on port 8080 ...  
[2024-07-30 12:07:33.549] [WARN]  You're using a full whitelist configuration to allow for all IPs 
[2024-07-30 12:07:34.715] [LOG]   Server started ... 
[2024-07-30 12:07:34.727] [LOG]   Sockets connected & modules started ... 
[2024-07-30 12:07:37.250] [LOG]   Launching application. 
[2024-07-30 12:07:40.687] [INFO]  System information:
### SYSTEM:   manufacturer: Raspberry Pi Foundation; model: Raspberry Pi 3 Model B Rev 1.2; raspberry: [object Object]; virtual: false
### OS:       platform: linux; distro: Raspbian GNU/Linux; release: 12; arch: arm; kernel: 6.6.40-v7+
### VERSIONS: electron: 31.2.1; used node: 20.15.0; installed node: 18.19.0; npm: 9.2.0; pm2: 5.4.2
### OTHER:    timeZone: America/New_York; ELECTRON_ENABLE_GPU: undefined 

I don't see any problems in any of this, yet the popup still doesn't appear.

Does any of this look incorrect?

Thank you.

thisisjjd commented 3 months ago

OK, I resorted to reading the MMM-AlarmClock.js source code and figured it out.

In my zeal to strip down everything to a minimum, I did not have alert module listed in the list of modules.

Since MMM-AlarmClock depends on using alert module, it wasn't alerting! I added alert back to the list of modules and everything works fine. Thank you for your help @fewieden !

fewieden commented 3 months ago

@thisisjjd glad you figured it out