mlukasek / M5_NightscoutMon

M5Stack Nightscout monitor
GNU General Public License v3.0
197 stars 153 forks source link

Alarm sound to error in Loop #39

Open cduarte opened 4 years ago

cduarte commented 4 years ago

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 commented 4 years ago

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);
      }
    }
mlukasek commented 4 years ago

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 commented 3 years ago

Solved in release v2020-12-06-01.

cduarte commented 2 years ago

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

mlukasek commented 2 years ago

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) {

MrPsi commented 2 years ago

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