M5_NightscoutMon icon indicating copy to clipboard operation
M5_NightscoutMon copied to clipboard

Alarm sound to error in Loop

Open cduarte opened this issue 4 years ago • 6 comments

I add the Status line with loop info + basal. Very good this information :)

If possible to get ALARM sound when loop not working (ERROR) for more than 15 minutes. So at night is possible to wake up to fix the problem.

cduarte avatar Apr 16 '20 03:04 cduarte

I resolve! I add ALARM SOUND when loop not working (ERROR).

In line 1051 I add this:

  if(strcmp(ns->loop_display_label,"Error")==0) {
    // red alarm state
    // M5.Lcd.fillRect(110, 220, 100, 20, TFT_RED);
    Serial.println("LOOP ERROR");
    M5.Lcd.fillRect(0, 220, 320, 20, TFT_RED);
    M5.Lcd.setTextColor(TFT_BLACK, TFT_RED);
    int stw=M5.Lcd.textWidth(tmpStr);
    M5.Lcd.drawString(tmpStr, 159-stw/2, 220, GFXFF);
    if( (alarmDifSec>cfg.alarm_repeat*60) && (snoozeRemaining<=0) ) {
        sndAlarm();
        lastAlarmTime = mktime(&timeinfo);
      }
    }

cduarte avatar Apr 18 '20 02:04 cduarte

Great, but this is just a simple workaround. To make it proper it would need appropriate M5NS.INI settings, update in web interface etc. I will keep it open if I will have some spare time for this.

mlukasek avatar Apr 21 '20 08:04 mlukasek

Solved in release v2020-12-06-01.

mlukasek avatar Dec 06 '20 18:12 mlukasek

I try to turn OFF the loop alarm But dont work the alarm off.. all time is ALARMING

cduarte avatar Sep 11 '22 06:09 cduarte

Yep, strange that none never noticed. I will update it in next release. Or if you are able to update the code, you have to update the condition

  if(strcmp(ns->loop_display_label,"Error")==0) {
   ...
     if( (alarmDifSec>cfg.alarm_repeat*60) && (snoozeRemaining<=0) ) {
   ...

to if( (alarmDifSec>cfg.alarm_repeat*60) && (snoozeRemaining<=0) && cfg.snd_loop_error) {

mlukasek avatar Sep 15 '22 09:09 mlukasek

I got the same issue. Happens a lot more often now, after updating Loop to Dev (Loop 3), or maybe after updating Nightscout to 14.2.6. I am using a M5Stack Core2. I have set the volume to 0%. But it still makes this weird clicking sound when alarming. Looking forward to the fix.

Thanks for a great tool to monitor my child during the night

MrPsi avatar Nov 09 '22 20:11 MrPsi