Page 1 of 1
Auto reboot, potential feature?? **solved**
Posted: Wed Jan 14, 2015 10:14 pm
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.
Re: Auto reboot, potential feature??
Posted: Wed Jan 14, 2015 10:51 pm
by admin
Which kind of weather stations are connected?
Re: Auto reboot, potential feature??
Posted: Wed Jan 14, 2015 11:53 pm
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 (24.01 KiB) Viewed 4387 times
Re: Auto reboot, potential feature?? **solved**
Posted: Thu Jan 15, 2015 9:10 am
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 ?
Re: Auto reboot, potential feature?? **solved**
Posted: Thu Jan 15, 2015 9:56 am
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
Re: Auto reboot, potential feature?? **solved**
Posted: Thu Jan 15, 2015 8:53 pm
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.
Re: Auto reboot, potential feature?? **solved**
Posted: Thu Jan 15, 2015 11:51 pm
by admin
Just released update includes new system variables. Therefore, reboot can be made as requested.
Re: Auto reboot, potential feature?? **solved**
Posted: Fri Jan 16, 2015 12:05 pm
by Clément
Thank you for the work.