Page 1 of 2

Fresh pies every day

PostPosted: Tue Jul 18, 2017 4:13 pm
by Hackencrash
I have 3 pi's

When I do an uptime on them it's several days, even though the piBeacon plugin is set to reboot them at 2am.

I've tried changing the reboot command to: sync; sync;reboot -f but this makes no difference.

When I select either: REBOOT rPi through ssh command or: Reboot rPi Force through socket both appear to work OK.

The properties file on the rPi's appears to be updated correctly.

Please can you explain the mechanics of how the daily reboot should work so that I can diagnose further?

If it's of any interest, I've never managed to get this working in the long time that I've been enjoying this fantastic plugin.

Thank you

Re: Fresh pies every day

PostPosted: Thu Jul 27, 2017 3:41 am
by Hackencrash
These are, I think, the relevant parts of the ~/pibeacon/parameters file on the rPi:

Code: Select all
"enableRebootCheck": "restartLoop,pingBoot"
"rPiRestartCommand": ""
"rebootCommand": "sudo sync; sync;sudo reboot -f"
"rebootHour": 2
"rebootWatchDogTime": "4"

Re: Fresh pies every day

PostPosted: Thu Jul 27, 2017 11:38 am
by kw123
will look into it later today ..

Re: Fresh pies every day

PostPosted: Thu Jul 27, 2017 2:25 pm
by kw123
do
Code: Select all
ssh pi@x.x.x.x.x
cd pibeacon
nano parameters

you should find (not together though):
Code: Select all
 "rebootCommand": "reboot now",
  "rebootHour": xx,
  "rebootWatchDogTime": "-1",


change xx to the current hour (0-23) and save (ctrl-o) and exit (ctrl-x)

the RPI should reboot within 1-2 minute. .. depending on your loop time / refresh rates ..

if that works, it should also work at 1 am .. I have not tried with 0 hours

if that does not work, your rpi could be bad (or likely a bug) ..
the new version should tell you about it in the indigo log file

also there is a permanent log file in the pibeacon directory . you should have lines like these in there.
Code: Select all
20170727-01:22:51  master  master rebooting / shutdown reboot now   reboot at 2017-07-27 01:22:51.674656  regular_reboot_at_1_hours_requested



Karl

and by looking at it I found a bug somewhere else.. that might have an impact (the SPS check had a bug and forces getsensorvalues.py to restart every 5 minutes... it still works, but should not do that)

Re: Fresh pies every day

PostPosted: Fri Jul 28, 2017 7:48 am
by Hackencrash
Hi Karl,

My RebootCommand and RebootWatchDogTime values are different to yours as can be seen by my second post above.

I changed the rebootHour from 2 to 13 in my case as the time on my rPi was 13:44. However, 45 minutes later and this rPi still hasn't rebooted.

Here is a tail of the ~/pibeacon/permanentLog.log file taken just now. Note that it does appear to be rebooting on some days (notice the gaps between the dates), but it is missing the reboot that should have taken place 45 minutes ago and note that it is the 28th today.

Code: Select all
20170711-02:00:00  master  master rebooting / shutdown sudo sync;sync;sudo reboot -f   reboot at 2017-07-11 02:00:00.534994  regular_reboot_at_2_hours_requested
20170712-02:00:01  master  master rebooting / shutdown sudo sync;sync;sudo reboot -f   reboot at 2017-07-12 02:00:01.496611  regular_reboot_at_2_hours_requested
20170718-02:00:01  master  master rebooting / shutdown sudo sync;sync;sudo reboot -f   reboot at 2017-07-18 02:00:01.782468  regular_reboot_at_2_hours_requested
20170719-02:00:00  master  master rebooting / shutdown sudo sync;sync;sudo reboot -f   reboot at 2017-07-19 02:00:00.275634  regular_reboot_at_2_hours_requested
20170725-02:00:01  master  master rebooting / shutdown sudo sync;sync;sudo reboot -f   reboot at 2017-07-25 02:00:01.826513  regular_reboot_at_2_hours_requested
20170726-02:00:03  master  master rebooting / shutdown sudo sync;sync;sudo reboot -f   reboot at 2017-07-26 02:00:03.519663  regular_reboot_at_2_hours_requested
I did a ps -ef | grep .py and I can see that both master.py and beaconloop.py are running.

Re: Fresh pies every day

PostPosted: Fri Jul 28, 2017 9:27 am
by kw123
It is a question of timing. If the pi programs read the config file at the right time it works. And that is triggered by the plugin sending the config file.
Have a version that does it right. Want to test for one night.



Sent from my iPhone using Tapatalk

Re: Fresh pies every day

PostPosted: Thu Aug 03, 2017 1:29 am
by Hackencrash
2 out of 3 rPi's rebooted with the new version, but that's not necessarily to say that the reboot isn't fixed.

I'll rebuild this rPi tonight as it could be foobar'd in some other way - will let you know.

Re: Fresh pies every day

PostPosted: Sat Aug 05, 2017 3:36 pm
by johnfdl
I was so excited when I saw the thread title....I love fresh pies. :D

Re: Fresh pies every day

PostPosted: Sat Aug 05, 2017 5:29 pm
by durosity
johnfdl wrote:
I was so excited when I saw the thread title....I love fresh pies. :D


What’s your favourite pie? I’d say a nice rhubarb pie with custard!

Re: Fresh pies every day

PostPosted: Sat Aug 05, 2017 6:40 pm
by roussell
Lemon is the one true pie


Sent from my iPhone using Tapatalk

Re: Fresh pies every day

PostPosted: Sat Aug 05, 2017 6:53 pm
by kw123
As for reboot.
If the rpi (ie master.py) starts before the boot time it will not boot that day. It has go over that time to set bootenable true


Sent from my iPhone using Tapatalk

Re: Fresh pies every day

PostPosted: Sun Aug 06, 2017 10:44 am
by jay (support)
durosity wrote:
What’s your favourite pie? I’d say a nice rhubarb pie with custard!


Buttermilk (or my grandmother's chocolate)

Re: Fresh pies every day

PostPosted: Sun Aug 06, 2017 11:11 am
by kw123
as I am on a no carb diet (-17 lbs =- 7.5kg) I take it with bacon

Re: Fresh pies every day

PostPosted: Mon Aug 07, 2017 5:09 am
by Hackencrash
LOL!

I have rebuilt the pi that was not rebooting after the update to piBeacon (using the new SSD image) and here is the permanentLog.log output for today:

Code: Select all
20170805-20:31:08  master  master rebooting / shutdown sudo sync;sync;sudo reboot -f   reboot at 2017-08-05 20:31:08.074673  change_in_ramdisk_for_logfiles
20170806-02:00:08  master  master rebooting / shutdown sudo sync;sync;sudo reboot -f   reboot at 2017-08-06 02:00:08.801555  regular_reboot_at_2_hours_requested
It is missing the 2am reboot for this morning (9th), yet everything else looks to be OK.

What do you think I should do?

P.S. The other 2 rPi's are absolutely fine

Re: Fresh pies every day

PostPosted: Mon Aug 07, 2017 9:07 am
by kw123
I can't look into code for 3 weeks. will need to wait sorry. karl