Improved reliability of real-time data

Real time data displayed on this website have seen interruptions to the updating of the data on a number of occasions. These ongoing issues should now be solved with the introduction of an automated process to deal with this. Most recently an 8 hour outage occurred during the overnight hours. Measures are in place to deal with these issues, including automated monitoring of data reaching the website in a timely manner.

These issues started with the introduction of a Weatherlink Live data capture and streaming device used to collect the data from our on-site sensors measuring the weather. This device was brought into use in order to expand the data in collect and publish, which was not possible for technical reasons with its predecessor.

Due to this system relying on our residential home network (including wi-fi connectivity) to a greater deal than the previous implementation of the weather system there are occasional temporary dropped connections between the Weatherlive Live device and the Raspberry Pi computer used to collate, store and upload the data within our network. As a consequence of this, sometimes the Raspberry Pi computer loses connection to the Weatherlink Live device, and doesn’t regain a successful connection.

The impact of this is the software continues to run and upload data that have not updated correctly. In the most recent outage the data rolled over to the new day, but continued to used data from the previous day.

Usually, however a reboot of the Raspberry Pi computer fixes the issue. However if the Raspberry Pi has lost connection to the network, then it makes more difficult to reboot it, as the Raspberry Pi operates in a headless configuration with no keyboard, mouse or monitor. Usually cutting power to the computer and turning it back on has been the only option to get the system back up and running.

So in view of this, a bash script was created to manage these issues in an automated manner. The script handles a) the data collection software is not running because it crashed for some reason, and b) the data collection software is running but the data is not current because it lost connection within the network. When these situations occur the software is shut down, and the system rebooted. The script is ran as a scheduled cron task every 5 minutes on the Raspberry Pi computer. The Raspberry Pi computer on boot up is configured to auto-start all of the required systems, thereby getting the data back online. The scripts allows for the time periods for these two time periods to be defined, and to write the actions taken to a log file when triggered in the script.

The bash script is as the following:

Whilst these measures will need monitoring over time, and with possible tweaks/ or improvements, this should help with increasing the availability of the data on this website.

If you find this type of blog post of value, please free free to comment or share on this post. You can also contact us if you have any questions directly related to the information on this website.

Want to share this?

Leave a Reply

Your email address will not be published. Required fields are marked *

You may use these HTML tags and attributes:

<a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code class="" title="" data-url=""> <del datetime=""> <em> <i> <q cite=""> <s> <strike> <strong> <pre class="" title="" data-url=""> <span class="" title="" data-url="">

This site uses Akismet to reduce spam. Learn how your comment data is processed.