Skip to content

Conversation

@AgP42
Copy link

@AgP42 AgP42 commented Jul 18, 2018

Modification :

  • add the possibility to display the last absolute date and time of the successfull ping by using a new config parameter "showAbsoluteTime"

  • Possibility to call a RPI reboot (need MMM-Remote-Control) if a configurable delay without successfull PING is exceeded

  • this reboot will be log in pm2 log with GMT time of the reboot (in /home/pi/.pm2/logs)

  • README.md updated accordingly

Known issues :

Tested on a RPI2, using MM v2.4.1

AgP42 added 5 commits July 18, 2018 12:10
Modification of this file : 
- add the possibility to display the last absolute date and time of the successfull ping by using a new config parameter "showAbsoluteTime"
- add management of "USER_PRESENCE" send by the module MMM-PIR. In case of no user present, the automatic update of ping module will be standby, and set again when the user return
- add management of "module.hidden" by the use of both core system function "resume" and "suspend" : in case the module is hidden by the system (case of the use of a carousel or the module MMM-Pages or hidden by Remote-Control, or ....) then the ping supervision is stopped and will be resumed at the return of the possible display. This has no side effect with the param "showAlways". The module is only stopped in case of it cannot display its info to the user anyway.
I finally changed my mind and removed the limitation of PING in case when the module cannot be displayed (CFenner#5). 
This new version keep the possibility to display last absolute date of successfull PING and add :
- Possibility to call a RPI reboot (need MMM-Remote-Control) if a configurable delay without successfull PING is exceeded
- this reboot will be log in pm2 log  with GMT time of the reboot (in /home/pi/.pm2/logs)

Known issue : the reboot is directly requested to the RPI, without proper close of the MagicMirror. Issue raised on MMM-Remote-Control module : Jopyth/MMM-Remote-Control#85
Add param details for :
- rebootIfNoPing: false, 
- rebootDelay: 20
@AgP42 AgP42 changed the title Add Absolute Time and user presence management Add Absolute Time and reboot RPI Jul 24, 2018
The initialization of this.lastConnection is now done at the start-up time and not 0 (1970). 
So in case of total network lost, the delay to be reach before reboot is well "rebootDelay" and not "updateInterval"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant