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 install
npm run dev
npm run build
Run Unit Tests with Vitest
npm run test
Lint with ESLint
npm run lint
To deploy within Docker, please follow these steps:
-
Install Docker Engine
Tip: If running on a raspberrypi, 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-1 kajgm/weathertracker
Ensure the Docker deployment steps from above are followed on the target Raspberry Pi
- If running these commands over ssh, export the display
export DISPLAY=:0
- Run chromium in fullscreen mode
chromium-browser --kiosk --app=http://localhost:8080/ --start-fullscreen --incognito
Alternatively, you may have to append
nohup
and&
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 bootup, create an entry within
~/.config/autostart/.desktop
with the following lines:make sure to edit the
<username>
field with your username
[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