Template reload following reboot. **solved**
Moderator: Mattk
Template reload following reboot. **solved**
Hi,
I wonder if you could tell me if the meteobridge (mr3020) is designed to retry loading templates if the initial load fails when it is restarted?
The reason I’m asking is this am the power failed at my site. Everything came back online after 30 mins and looked good except the FTP service file being uploaded by the meteobridge to my weather site (a local web server) was empty and as a consequence the web site displayed no current data. The meteobridge was uploading a file but is was zero length. I could access the template file fine from my browser but the meteobridge didn’t appear to be able to do so or if it was able wasn’t processing it. The fix was to manually reload the template using the button on the service definition panel. As soon as I did this everything came right.
In the past I have had a laptop running small web and FTP servers to host the meteobridge template and the web site. I’ve recently ported this configuration to a raspi to reduce the 24x7 power usage. The new raspi doesn’t have any backup battery (unlike the laptop) and as a consequence in a power fail situation it to will fail also. The raspi is booting off a USB 1TB hard drive and restarting is not instant. It may take an extended period following a crash shutdown if the hard drive is dirty.
I’m thinking my problem might be that the meteobridge is coming back on-line (100mb/sec fibre so it loads quickly) before the ftp server holding the FTP service template is on-line. This wouldn’t be an issue if the meteobridge kept trying to load a template if the initial load failed. Which brings me back to me question... does the meteobridge try repeatedly to load templates on restart or try once and then give up?
Any thoughts would be most appreciated.
Rgds Steve
I wonder if you could tell me if the meteobridge (mr3020) is designed to retry loading templates if the initial load fails when it is restarted?
The reason I’m asking is this am the power failed at my site. Everything came back online after 30 mins and looked good except the FTP service file being uploaded by the meteobridge to my weather site (a local web server) was empty and as a consequence the web site displayed no current data. The meteobridge was uploading a file but is was zero length. I could access the template file fine from my browser but the meteobridge didn’t appear to be able to do so or if it was able wasn’t processing it. The fix was to manually reload the template using the button on the service definition panel. As soon as I did this everything came right.
In the past I have had a laptop running small web and FTP servers to host the meteobridge template and the web site. I’ve recently ported this configuration to a raspi to reduce the 24x7 power usage. The new raspi doesn’t have any backup battery (unlike the laptop) and as a consequence in a power fail situation it to will fail also. The raspi is booting off a USB 1TB hard drive and restarting is not instant. It may take an extended period following a crash shutdown if the hard drive is dirty.
I’m thinking my problem might be that the meteobridge is coming back on-line (100mb/sec fibre so it loads quickly) before the ftp server holding the FTP service template is on-line. This wouldn’t be an issue if the meteobridge kept trying to load a template if the initial load failed. Which brings me back to me question... does the meteobridge try repeatedly to load templates on restart or try once and then give up?
Any thoughts would be most appreciated.
Rgds Steve
Re: Template reload following reboot
Latency on boot up can be a problem and not sure if the MR3020 latest version supports the Boot Delay option intended to let the router fully boot before the MB tries and connects. This has been at least an MBPro feature since Feb 2017 Ver 3.2+
Re: Template reload following reboot
But that would not help in this case as the template files are on a "slow starting" local-server,
The best solution would be to move the meteoridge to another raspi which makes it possible to store all template files on the Meteobridge-device.
Wim
Support for Leuven-Template & Scripts at https://support.leuven-template.eu/
Support for the PWS_Dashboard (HWS-template) https://pwsdashboard.com/
Support for the PWS_Dashboard (HWS-template) https://pwsdashboard.com/
Re: Template reload following reboot
Thanks both of you.
I’m assuming based on you replies that the metrobridge does NOT attempt to re-try loading templates on restart.
Is there any chance this feature could be added? It would seem to be something that would add general robustness in many different use cases.
Rgds
I’m assuming based on you replies that the metrobridge does NOT attempt to re-try loading templates on restart.
Is there any chance this feature could be added? It would seem to be something that would add general robustness in many different use cases.
Rgds
Re: Template reload following reboot
Wim, Not sure I understand your reasoning? The problem reads that if power is returned and all begin to start up then some devices will complete boot then try and connect devices that are still booting? Fail then won't try again?
If the MB tries to connect before the reliant systems are fully running then the MB my not re-try? But if all the other devices are allowed to fully start first, then the MB is started then all should be good? Time delay on the MB does exactly this.
Re: Template reload following reboot
thanks for the comments
In my 40 years in IT I've learnt that systems of of components that rely on particular start orders or wait times in the end are problematic. If you can get to a point where any individual component can be restarted or upgraded without then having to restart related components or worry about lost data life is much calmer and you get far more sleep. That's one reason the old VP2-datalogger-weatherlink app worked so well. You could reboot the windows system without any loss of data. If weatherlink was down, even for days, the data piled up in the logger but was it never lost. When weatherlink came back on-line the data in the logger was processed and the historical database showed no sign of the outage.
There is no wait time in meteobridge (mr3020) I can see so I'm not seeing an easy option, even if it is suboptimal, to my immediate problem.
The best option would be for the meteobridge to keep trying to reload a configured template if it doesn't load just like the meteobridge repeatedly tries to upload weather data if that process fails. I'd suggest an initial wait time of 30 seconds, which doubled on each iteration up to a maximum of say 60 minutes.
Is there any chance of this enhancement?
Rgds Steve
In my 40 years in IT I've learnt that systems of of components that rely on particular start orders or wait times in the end are problematic. If you can get to a point where any individual component can be restarted or upgraded without then having to restart related components or worry about lost data life is much calmer and you get far more sleep. That's one reason the old VP2-datalogger-weatherlink app worked so well. You could reboot the windows system without any loss of data. If weatherlink was down, even for days, the data piled up in the logger but was it never lost. When weatherlink came back on-line the data in the logger was processed and the historical database showed no sign of the outage.
There is no wait time in meteobridge (mr3020) I can see so I'm not seeing an easy option, even if it is suboptimal, to my immediate problem.
The best option would be for the meteobridge to keep trying to reload a configured template if it doesn't load just like the meteobridge repeatedly tries to upload weather data if that process fails. I'd suggest an initial wait time of 30 seconds, which doubled on each iteration up to a maximum of say 60 minutes.
Is there any chance of this enhancement?
Rgds Steve
Re: Template reload following reboot
There is no plan to add more clutter to processes by repeating load of templates.
If any edge-case does need it, feel free to write a shell script for this and to call this to your liking.
If any edge-case does need it, feel free to write a shell script for this and to call this to your liking.
Re: Template reload following reboot
It all seems a little inconsistent to me. Even if the template was hosted on a win10 laptop its recovery could be stalled by a win10 upgrade. And the only fix is manual intervention.
I can see this hasn't been a common problem in the past because with slower internet connections the meteobridge bootstrap process would always take an extended time. With faster connections and FTTH common the meteobridge will more often be first up and this situation will be more common.
As things stand your status page shows all green ticks on the upload status even though the template didn't load and ftp is pumping out a zero length file. Most confusing. Should this be classified as a bug?
I can see this hasn't been a common problem in the past because with slower internet connections the meteobridge bootstrap process would always take an extended time. With faster connections and FTTH common the meteobridge will more often be first up and this situation will be more common.
As things stand your status page shows all green ticks on the upload status even though the template didn't load and ftp is pumping out a zero length file. Most confusing. Should this be classified as a bug?
Re: Template reload following reboot
I recently brought this for my Rpi-4B and it does work. Provides approx. 10 hours of backup time.
https://www.amazon.com/gp/product/B07Y2 ... UTF8&psc=1
https://www.amazon.com/gp/product/B07Y2 ... UTF8&psc=1
Re: Template reload following reboot
Nice option. Thanks.
I have been looking at a ups option that will support 2x Raspi, the meteobridge, 3 Poe cameras, a switch, a router, and the telco fibre termination device. And then there are smart home devices that might be added. I can see in the future some sort of reliable power device and wiring will be a standard feature of new homes.
That said, even with reliable power devices need to be able to restart and recover independently or the whole thing becomes unmanageable.
Rgds
I have been looking at a ups option that will support 2x Raspi, the meteobridge, 3 Poe cameras, a switch, a router, and the telco fibre termination device. And then there are smart home devices that might be added. I can see in the future some sort of reliable power device and wiring will be a standard feature of new homes.
That said, even with reliable power devices need to be able to restart and recover independently or the whole thing becomes unmanageable.
Rgds
Re: Template reload following reboot
I Live in the county side of Oklahoma. We have frequent power outages here. Every sensitive electronic device is on a UPS. Cable Moden and routers are on there own providing power for at least 4 hours... My weather station again is on the UPS I mentioned with the Ecowitt GW1000 plugged into the Rpi-4 for extra back-up. If power is out for more than an hour I fire up one of the 4 generators we now have 1 being diesel for longer-term outages. ... that's how bad our electrical supply is here.stevem wrote: ↑Tue Jan 19, 2021 10:26 pmNice option. Thanks.
I have been looking at a ups option that will support 2x Raspi, the meteobridge, 3 Poe cameras, a switch, a router, and the telco fibre termination device. And then there are smart home devices that might be added. I can see in the future some sort of reliable power device and wiring will be a standard feature of new homes.
That said, even with reliable power devices need to be able to restart and recover independently or the whole thing becomes unmanageable.
Rgds
Re: Template reload following reboot
This site is at a beach in New Zealand, unattended most of the time, and fed by a non-redundant mains supply. We have an outage every couple of months either because the power company decide to do maintenance or some idiot drives their car into a pole. I'll have to get something. A tesla powerwall would be nice
Rgds Steve

Re: Template reload following reboot
Just released update will retry on template loads after reboot, when it does not work on first try.
Re: Template reload following reboot. **solved**
Many thanks. I’m sure this will be of assistance to many over time.
Rgds
Steve
Rgds
Steve
Re: Template reload following reboot. **solved**
Hi Admin,
Something is not right with this fix. I have just had the situation occur again with a second site.
The power failed.
Following the power fail a web site that relies on a template formatted json file ftp'd to it by the meteobridge fails
On inspection the web site is repeatedly receiving a zero byte file. Both the web site (which also holds the meteobridge template) and ftp server are running fine.
The meteobridge admin pages show all uploads are working correctly (green tick) including the templated FTP item at issue
The issue is resolved by refreshing the template on the meteobridge (an MR3020) by pressing the button provided.
I conclude that for some reason the template did not load correctly or for some reason it has been lost within the meteobridge.
Is it possible to refresh templates automatically every 24 hrs and also when the output of the template process is zero length?
Regards
Steve
Something is not right with this fix. I have just had the situation occur again with a second site.
The power failed.
Following the power fail a web site that relies on a template formatted json file ftp'd to it by the meteobridge fails
On inspection the web site is repeatedly receiving a zero byte file. Both the web site (which also holds the meteobridge template) and ftp server are running fine.
The meteobridge admin pages show all uploads are working correctly (green tick) including the templated FTP item at issue
The issue is resolved by refreshing the template on the meteobridge (an MR3020) by pressing the button provided.
I conclude that for some reason the template did not load correctly or for some reason it has been lost within the meteobridge.
Is it possible to refresh templates automatically every 24 hrs and also when the output of the template process is zero length?
Regards
Steve