120000

Another habit I have been working on this year is swimming. Trying to go at least twice and week to the lovely Park Road Lido. At the start of the year I set myself a target of swimming 120,000m in 2025 to motivate that goal. Yesterday I passed the 120km mark! On a related theme I have been working on creating a water temperature monitor for the lido and this week focused on the website to display the data.

We tend to use the TIG stack (Telegraf, InfluxDB and Grafana) for our data projects at CASA so my task was to create a simple webpage using chart.js and node to query data in InfluxDB and then present the live and 2 week historic data.

prototype water temperature page

This gave me the opportunity to test the infrastructure Steve has put in place to allow us to host web pages on the CASA network. After creating a skeleton page pulling data from Influxdb and using chart.js library to create a simple line chart, I turned to hosting the page securely so as not to expose the InfluxDB connection to the internet. My brief was to create a node based containerised webpage that dymanically serves data from CE influxdb using the CE portainer environment.

The steps involved installing and setting up Podman to manage local containers. I used one of Steves existing containers as a base to create a new container for the water temperature page. I then created a simple node server using express to serve the static html page and a dynamic endpoint to query the influxdb. Once this was working locally, step 2 involved pushing the container to the CASA github repo so that I had a package that could be pulled into the CE portainer environment. Step 3 involved deploying the package using portainer and setting up ports etc. I probably spent most my time getting my head around these two steps and understanding for the first time how the CE portainer environment works. The last step was to set-up a new subdomain on the CASA network and point it to the new container.

The impact of all this is that we now have a self service environment in the lab for hosting simple web pages. Loking forward to trying to get the water temperature sensor set up at the Lido.