Skip to content

About

Raspberry Pi Zero W weather station for Porthmadog Sailing Club

Resources

Security policy

Stars

1 star

Watchers

1 watching

Forks

Repository files navigation

Porthmadog Sailing Club Weather Station

Live weather station for the Porthmadog Harbour & Estuary, powered by a Davis Vantage Vue weather station.

Architecture

A Raspberry Pi Zero W running Balena.io connects to the Davis Vantage Pro2 weather station via a USB cable. The intention was that this would be in a microservices style, but in the end it was easier to just run everything in the same script as it helped the Pi Zero cope!

It uploads it to a Cloudflare worker which then serves the data to the website. The worker also sends the data to Windy.com and Windguru.

Versioning

This project uses Semantic Versioning, paying more attention to them from v4.0.0 onwards

Debugging

Run npm i and npm start. Run npm test to test the serial protocol handling without a weather station.

The WeatherLink USB data logger is a Silicon Labs CP210x USB to serial bridge - if debugging on Windows you may need their VCP drivers to connect to the Vantage Vue over USB.

How the console is read

Every 30 seconds the script wakes the console, asks for one LOOP2 packet (LPS 2 1), reads exactly 99 bytes and checks the CRC - see VantageSerialProtocolDocs_v261.pdf. If the console stops answering for about 5 minutes, or the serial port disappears, the script exits and the container restart policy starts it again.

When the console can't hear the outdoor sensors (for example when they are brought indoors for the winter) it still answers, but with placeholder "dashed" values. These are uploaded, disregarded by the website, and the reason is shown at /status.

Balena.io Configuration

Device Variables

Config Item Default
LOG_LEVEL silly
CLOUDFLARE_API_URL none
CLOUDFLARE_HEARTBEAT_URL none
SERIAL_PORT auto-detected, falling back to /dev/ttyUSB0

Device Configuration Variables

Following config variables are required to get serial working:

Config Item Value
BALENA_HOST_CONFIG_dtparam "i2c_arm=on","spi=on","audio=on"
BALENA_HOST_CONFIG_enable_uart enabled
BALENA_HOST_CONFIG_dtoverlay pi3-miniuart-bt

Edit the config.txt in balena-boot partition of the SD card and append the following lines.

enable_uart=1

Licence

This project is licensed under the MIT License. See the LICENSE file for details.

About

Raspberry Pi Zero W weather station for Porthmadog Sailing Club

Resources

Security policy

Stars

1 star

Watchers

1 watching

Forks

Releases

Used by

Contributors

Languages