A minimal tracker for Weather. Intended for use on external Raspberry Pi based displays (3.5inch) or within a browser.
- Please ensure the following software is installed
npm installnpm run devnpm run buildRun Unit Tests with Vitest
npm run testLint with ESLint
npm run lintTo deploy within Docker, please follow these steps:
-
Install Docker Engine
Tip: If running on a Raspberry Pi, follow these docs: install
-
Build the dockerfile within the client directory
Tip: Run
sudo usermod -aG docker <user>to avoid prefixing the following commands with sudo
docker build -t kajgm/weathertracker .
- Run the dockerfile
docker run -d -p 8080:80 --restart always --name weathertracker kajgm/weathertracker
Ensure the Docker deployment steps from above are followed on the target Raspberry Pi
- If running these commands over ssh, set the $DISPLAY environment variable
export DISPLAY=:0
- Run chromium in fullscreen mode
chromium-browser --kiosk --app=http://localhost:8080/ --start-fullscreen --incognito
Alternatively, you may have to append
nohupand&to run the command in the background (if executing via ssh):
nohup chromium-browser --kiosk --app=http://localhost:8080/ --start-fullscreen --incognito &
- Give the startup.sh file executable permissions
chmod +x startup.sh
- To enable script auto start on boot, create an entry within
~/.config/autostart/.desktopwith the following lines:Make sure to edit the
<username>field
[Desktop Entry]
Version=1.0
Type=Application
Terminal=false
Exec='/home/<username>/weathertracker/startup.sh'
Name=weathertracker
- Issues with chromium-browser: Install chromium browser version 88
For whatever reason the latest version of chromium-browser sometimes doesn't play nice. If you're running into issues with the next few commands, try installing this version.
wget "http://archive.raspberrypi.org/debian/pool/main/c/chromium-browser/chromium-browser_88.0.4324.187-rpt1_armhf.deb"
wget "http://archive.raspberrypi.org/debian/pool/main/c/chromium-browser/chromium-codecs-ffmpeg-extra_88.0.4324.187-rpt1_armhf.deb"
apt install --no-install-recommends --allow-downgrades --allow-change-held-packages ./chromium-browser_88.0.4324.187-rpt1_armhf.deb ./chromium-codecs-ffmpeg-extra_88.0.4324.187-rpt1_armhf.deb
- Raspberry pi screen sleeping: Set the raspberrypi config settings
sudo raspi-config
# Select 2 Display Options > D2 Screen Blanking > No > Finish