I have run a Davis Vantage Pro2 personal weather station at my home since 2007, and have had a webcam on my bird feeders since 2008.
Because of Minnesota's harsh winters, I needed a camera that could withstand the cold temperatures without the need for a dedicated heater. Most consumer grade electronics aren't rated for temperatures below freezing (32F), which can get down to -20F or colder in the winter here.
The first iteration of Feedercam was a StarDot Netcam, which uploaded a still image every 30 seconds to my website. The camera ran an embedded uCLinux OS, and allowed direct access via telnet. I was able to run shell scripts and set up a cron job to pull data from an AmbientWeather WeatherHub2 IP server that I was using at the time to capture weather data from the PWS.
Later, when YouTube streaming became available, I switched to an Axis P1365-E network camera to live stream my bird feeders. Since Axis cameras only allow access via their API, I used a Zotax ZBOX mini PC running Linux to run shell scripts and pull the weather data from a Metobridge Pro running Meteohub. These scripts also ran as cron jobs, which called the Meteohub livedata CGI and then the Axis Dynamic Overlay API to overlay the weather data on the video stream. I installed the CamStreamer app on the camera, which makes streaming to YouTube (and other platforms like Twitch, Windy, etc), very easy.
Currently I have an Axis P1375-E camera and connected an external microphone to it for audio. I continue to use the Davis Vantage Pro2, but I now have weewx running on a Beelink mini PC. Since weewx doesn't have a CGI or API to pull data, I decided to write a custom weewx service to process incoming loop packets, and call the Axis camera API to overlay the weather data on the stream. This is done in Python rather than shell scripts and doesn't require a cron job because it's running within the weewx engine itself. Check out my Feedercam (shameless plug) see the result, and maybe some cool birds too!
- Log into your Axis camera web interface.
- Go to Settings -> System -> Accounts
- Create a new account with "Operator" privileges, and set an account name and password. The account name will be the username.
- Add static text on the image, including a placeholder for the dynamic text we'll be overlaying. For example:
- Go to Video -> Overlays
- Add a Text overlay
- For mine I set this text to
Overlook Circle Feedercam | Bloomington MN | %D %T | #D - This will keep the static text on the image, with the placeholders for date (
%D) and time (%T) being updated by the camera. - The
#Dplaceholder is for the dynamic overlay text, which will be updated by the weewx service with weather data from your Davis LOOP packets.
- Click "Modifiers" to see what other placeholders are available.
- Set the font size, color, and position as desired.
You don't have to run this setup to use the service in weewx, but if you would like to run a test before deploying it in weewx, follow these steps:
source ./setup.shin the root of the project.python axis_camera_overlay/test_service.py
- For weewx running on another server:
- Copy
sample.envto.envand set the environment variables for weewx setup. Example values:WEEWX_HOST=1.2.3.4 WEEWX_USER=weewx_user WEEWX_USER_DIR=/etc/weewx/bin/user - Execute
upload_extension.shwhich will tar/gz the extension and place it in the user directory (specified in.env). - Note this assumes you have ssh running on your weewx host and have set up a public/private key pair.
- Copy
- Or you can create the extension tgz manually:
tar -czvf axis_camera_overlay.tar.gz --exclude='test*' --exclude='*pycache*' axis_camera_overlay- Copy
axis_camera_overlay.tar.gzto your weewx user directory, for example/etc/weewx/bin/user/.
- On your weewx server, navigate to your weewx user directory and execute
weectl extension install axis_camera_overlay.tgz --verbosity=3 - Edit the
[AxisCameraOverlay]in yourweewx.conffile to update the settings (host, user, password) for your camera. - NOTE: I'm using Loop2 packets, which are supported by the Davis Vantage Pro2. These packets contain more accurate data with higher precision.
- This requires Davis firmware v1.90 or later.
- You'll need to update
weewx.conf, which defaults to Loop1 packets. In the[Vantage]section, setloop_request = 2.
- If you want to see debug output, change the
debuglevel in the config file to1. - Restart weewx, for example
sudo systemctl restart weewx. - Watch the logs to confirm the service initialized correctly, and to watch debug output, for example:
sudo tail -f /var/log/syslog | grep weewxsudo journalctl -u weewx -f
Optionally edit the axis_weather_overlay.py file to customize the data fields that are displayed on the overlay, and/or
if you prefer different weather values or want to change the logic I'm using there.
Also if you have older Davis firmware that doesn't support loop 2 packets, you'll need to adjust the code accordingly for loop 1 packet fields.
References:
- https://weewx.com/docs/5.2/hardware/vantage/#vantage_data - detail about Davis Vantage data fields.
- https://weewx.com/docs/5.2/custom/service-engine/#create-service - creating a custom weewx service.
- https://developer.axis.com/vapix/network-video/overlay-api/#dynamic-overlay-api - detail about the Axis Dynamic Overlay API.
- https://developer.axis.com/vapix/network-video/overlay-api/#dynamic-text - GET endpoint for updating dynamic text overlay on the camera.