A React based front end to configure the Lantern Power Monitor config file directly on a Raspberry Pi.
- Raspberry Pi with the Lantern Power Monitor image
- lantern-config-api NodeJS running on the Raspberry Pi
- Modified Current Monitor Java project copied to the Pi
- Install npm
- Clone this repo
- Run
npm run build
(To run a local instance for development run npx vite
)
Follow instructions to copy SD card image to an SD card using Balena Etcher for example.
- Install nginx on the Pi
sudo apt-get update && sudo apt-get install nginx
- Create a lantern-config directory in the Pi home folder with
mkdir /home/pi/lantern-config
- Modify
/etc/nginx/sites-available/default
and change the following within theserver
tag:
root /home/pi/lantern-config
location / {
try_files $uri $uri/ /index.html =404;
}
- Copy the 'compressed' lantern-config React build to the Pi: (from your pc)
scp -r dist/* pi@<ip of the lanternmonitor pi>:/home/pi/lantern-config
Now you should be able to navigate to your Pi's IP address and see something like an empty website. It is empty because the data for the site is served by a Node back-end.