Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Intalling on Rasbperry Pi Zero 2W w/512 memory #61

Open
maserowik opened this issue Dec 20, 2024 · 0 comments
Open

Intalling on Rasbperry Pi Zero 2W w/512 memory #61

maserowik opened this issue Dec 20, 2024 · 0 comments

Comments

@maserowik
Copy link

I by no way am a programmer just a tinkerer. This is how I got it to work on my end not sure if this is correct but wanted to share incase someone else has the same/similiar hardware am using.

With the Raspberry Pi Zero 2w only having 512 gig of memory using Chromium or Firefox was not a option.
I uninstall Chromium and Firefox from the Pi. Listed below is the web browser that I got to work.

Hardware use :

Raspberry PI Zero 2W
OS Bookworm
Waveshare 7inch HDMI LCD screen

Looking for comments or suggestions on the steps listed below.

Make sure Raspberry Pi is fully updated
sudo apt update && sudo apt upgrade -y

Now install NodeJS
curl -fsSL https://deb.nodesource.com/setup_lts.x | sudo -E bash -
sudo apt install -y nodejs

Test NodeJs
Run the following commands to confirm Node.js and npm are installed:
node -v
npm -v

Clone Pi weather
git clone https://github.com/elewin/pi-weather-station.git
cd pi-weather-station
npm install
If you get a message about npm needing update follow the process but do a sudo in front of the commands

I modified the server/index.js file to allow other machine on my local network to access the weather web server

app.listen(PORT, "localhost", async () => {
so that it becomes:

app.listen(PORT, async () => {

npm start

Follow the rest of the guide to set up the api keys

How to get the app and website to load follow on reboot of the pi follow these steps.

Configure software to autoboot web browser and open up pi-weather

sudo apt update && sudo apt upgrade -y && sudo apt install -y openbox surf x11-xserver-utils unclutter
mkdir -p ~/.config/openbox
nano ~/.config/openbox/autostart
# Disable screen blanking and power management
xset -dpms # Disable Display Power Management
xset s off # Disable the screen saver
xset s noblank # Prevent the screen from blanking

# Hide mouse cursor after inactivity
unclutter -idle 0 &

#Delay to make sure pi is up and ready
sleep 10

# Launch surf in fullscreen with the specified URL
surf -F http://pi-weather:8080 &

nano ~/.xinitrc
exec openbox-session

nano ~/.bashrc
if [ -z "$DISPLAY" ] && [ "$(tty)" = "/dev/tty1" ]; then
startx
fi

Create a Linux service
sudo nano /etc/systemd/system/pi-weather.service
[Unit]
Description=Pi Weather Station
After=network.target

[Service]
ExecStart=/usr/bin/node /home/weather/pi-weather-station/server/index.js
WorkingDirectory=/home/weather/pi-weather-station
Restart=always
User=weather

[Install]
WantedBy=multi-user.target

To enable and start the service

sudo systemctl enable pi-weather
sudo systemctl start pi-weather

To Verify status of Pi-Weather
sudo systemctl status pi-weather

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant