Auto reboot, potential feature?? **solved**

All about the standard Meteobridge devices based on mobile routers from TP-Link, D-Link, ASUS

Moderator: Mattk

Post Reply
Clément
Senior Boarder
Senior Boarder
Posts: 52
Joined: Sun Nov 24, 2013 11:04 am
Contact:

Auto reboot, potential feature?? **solved**

Post by Clément »

Hello,

I have several MeteoBridge in a weatherstations network.
Some are working very well, uptime is more than 150 days :) but some others lose the connection with the datalogger even if there is a usb hub.

After a reboot everything comes back to normal for a random time. It can be 1 day or 1 month...

Can it be possible to add a feature which reboots the system 5 minutes after loosing the connection with the datalogger or something like that?

What do you think about that?
Thanks.
User avatar
admin
Platinum Boarder
Platinum Boarder
Posts: 7874
Joined: Mon Oct 01, 2007 10:51 pm

Re: Auto reboot, potential feature??

Post by admin »

Which kind of weather stations are connected?
User avatar
admin
Platinum Boarder
Platinum Boarder
Posts: 7874
Joined: Mon Oct 01, 2007 10:51 pm

Re: Auto reboot, potential feature??

Post by admin »

Next release will have following new template variables to be used in a custom script by you to define reboot conditions
  • uptime: uptime of Meteobridge in seconds
  • lastdata: seconds passed since last piece of data received from weather station, returns -1 if no data received. Does not distinguish between useful and useless garbage data
  • lastgooddata: seconds passed since last piece of meaningful sensor data recorded, returns -1 if no sensor data recorded so far
Your script might look like this:

Code: Select all

#!/bin/sh
#
### reboot Meteobridge after N seconds of no data coming in; N is parameter
if [ [mbsystem-uptime] -gt $1 ] && [ [mbsystem-lastgooddata] -eq -1 ]
then
  reboot
fi
if [ [mbsystem-lastgooddata] -gt $1 ]
then
  reboot
fi
exit 0
I stored that script on the Meteobridge server for common use at: "http://templates.meteobridge.com/nodatareboot.sh"
Your call might look like this:
Screen Shot 2015-01-14 at 23.07.46.png
Screen Shot 2015-01-14 at 23.07.46.png (24.01 KiB) Viewed 4383 times
Clément
Senior Boarder
Senior Boarder
Posts: 52
Joined: Sun Nov 24, 2013 11:04 am
Contact:

Re: Auto reboot, potential feature?? **solved**

Post by Clément »

Thanks a lot !

So I just need to host nodatareboot.sh on my webserver and then call the script with the MeteoBridge ?
User avatar
wvdkuil
Platinum Boarder
Platinum Boarder
Posts: 606
Joined: Sun Jul 24, 2011 8:00 pm
Location: Belgium
Contact:

Re: Auto reboot, potential feature?? **solved**

Post by wvdkuil »

Clément wrote:Thanks a lot !

So I just need to host nodatareboot.sh on my webserver and then call the script with the MeteoBridge ?
NO, You could but you should not do that. Do not host a copy of the script on your webserver. The script is for common use. So if there are additional features they will be implemented in that script. You only have to push the "Reload template" to use the latest version, and you will allways use the latest version after a restart.

You customize the script to your liking with your "no good data time" as parameter (300 seconds in the example) and the frequency of checking (2 minutes in the example).

Wim
User avatar
admin
Platinum Boarder
Platinum Boarder
Posts: 7874
Joined: Mon Oct 01, 2007 10:51 pm

Re: Auto reboot, potential feature?? **solved**

Post by admin »

Yes, Wim is right. I plan to put a drop-down next to the reload script button,
which allows to select one of the predefined scripts, so that you don't have to remember the exact script URL.
User avatar
admin
Platinum Boarder
Platinum Boarder
Posts: 7874
Joined: Mon Oct 01, 2007 10:51 pm

Re: Auto reboot, potential feature?? **solved**

Post by admin »

Just released update includes new system variables. Therefore, reboot can be made as requested.
Clément
Senior Boarder
Senior Boarder
Posts: 52
Joined: Sun Nov 24, 2013 11:04 am
Contact:

Re: Auto reboot, potential feature?? **solved**

Post by Clément »

Thank you for the work.
Post Reply