Closed stovedoctor closed 5 months ago
No worries there are no damp questions.
1st address the RC Local might not work out because there can be issues with starting flask before the camera interface and network interface are ready. While for a quick run at boot its ok, I prefer to run either manually or as a service which I get to in a moment.
2nd the error you have seems there is a missing file. Can you make sure you pull the latest from the repo... Make sure camera-config.json file is in the same directory as the app.py
At this point maybe the file was missing and pulling the latest work and RC.local was ok to start on boot then you should be ok... If not...
Now we get to how to make service - Remove the RC local entry 1st
which python
should look like "/usr/bin/python"cd /etc/systemd/system/
sudo nano picamera2-webui-lite.service
[Unit]
Description=Picamera2 WebUI Lite Server
After=network.target
[Service]
Type=simple
ExecStart=/usr/bin/python /home/rod/picamera2-WebUI-Lite-main/picamera2-WebUI-Lite/app.py
Restart=always
[Install]
WantedBy=multi-user.target
sudo systemctl start picamera2-webui-lite.service
sudo systemctl status picamera2-webui-lite.service
sudo systemctl enable picamera2-webui-lite.service
That 'should' be it. There might be a hicup with virtenv but I am not using that so I am not sure lets try those things to see if it works 1st. If the service does not run I will take another look.
zThanks for responding and willing to help Lol my typo Damp. Should have been dumb. I will give it a go when I get home. But a few questions.
Btw I have tried a fresh pi image with nothing but your program running least 4 times on a fresh image.
I followed all the instructions from the toms hardware page
https://www.tomshardware.com/raspberry-pi/how-to-control-your-raspberry-pi-camera-using-a-web-ui.
Maybe I'm pulling from the wrong package?
From Toms write up.
wget https://github.com/monkeymademe/picamera2-WebUI-Lite/archive/refs/heads/main.zip
From the links on Toms page is how I installed picam2 UI.
But In the write up it shows
Directory picamera2-WebUI-Lite
Your package gave the program directory a name of picamera2-WebUI-Lite-main
Step 6 on toms writeup...
cd picamera2-WebUI-Lite
When it errored no directory I listed the user/rod
and it showed your package created the directory as picamera2-WebUI-Lite-main`
I even tried renaming it removing the -main
just in case things were referring back to the directory named that way.
The error for not being able to load the Json config only comes up if you try to load the app.py outside of the 'picamera2-WebUI-Lite` directory..
I ask about the directory name because of your new instructions of referring to ExecStart=/usr/bin/python /home/pi/picamera2-WebUI-Lite/app.py
Without -main in the directory name.
[Unit] Description=Picamera2 WebUI Lite Server After=network.target [Service] Type=simple ExecStart=/usr/bin/python /home/pi/picamera2-WebUI-Lite/app.py Restart=always [Install] WantedBy=multi-user.target```
Anyway I have a fresh install now
Working but would like it to run in background.
Thanks again for responding.
I'm just now RE learning using Linux and Python commands after over 15 years of not using. Back in the day I ran a remotely hosted colbolt appliances webserver for my websites and shopping online shopping carts and it's slowly coming back to me because I'm old.
Btw I'm trying to get this going because we are leaving for a 7 week road trip in a few weeks. Maybe there is a better way to make a rear view cam but I like the way your interface for controls works and looks. https://www.facebook.com/profile.php?id=61550792727679&mibextid=ZbWKwL
I just looked at the linked files on toms page it looks like a archive.
So I will remove and install your latest release.
https://github.com/monkeymademe/picamera2-WebUI-Lite.git
Will I need to install flask with the bookworm pi os ?
Could you check (just run the server before installing)... I seem to remember something recently changed in bookworm that improved support. either flask or something else. Sorry not near a pi to check
@stovedoctor shoot me an email what your plans are maybe I can throw a timelapse feature (something thats simple start and stop) for you... sweeten the trip? raspberryjamberlin@gmail.com
Also just pushed a change. I figured out the issue with the missing json file... Running as a service the script does not like the relative path (unless its directly a flask thing) so pulling in files next to the app.py it was just lost. So I put in some changes to detect the absolute path.
systemctl method of loading the server works now.
I will close this issue for now
Got it to work.on boot with some fumbling around.....
I copied your instructions.
errors then I noticed you had my old directory name with -main
I fixed that l and still error
then I noticed you had the file path in twice
ExecStart=/usr/bin/python /home/rod/picamera2-WebUI-Lite/picamera2-WebUI-Lite/app.py
. LOL Im glad im not the only one making stupid mistakes
Thanks for the help
You rock..
I also sent you an email
![Uploading PXL_20240427_161249817_exported_1714234422048.gif …]()
Current setup RPI4 Raspberry Pi OS with desktop Release date: March 15th 2024 System: 64-bit Kernel version: 6.6 Debian version: 12 (bookworm) Camera module 3 wifi hotspot Would like to have run in background or not close when closing SSH terminal I want to use this as a rear view cam in a RV trailer and view feed from Device in the tow vehicle connected via PI's hotspot with no internet connection. I have all that working but I really need to be able to keep it running or be able to run the app.py via a remote SSH terminal. As of now can do this but when closing the terminal or loosing connected the app stops. As far I my limited skills are there is no way i have found to keep the app running after remote terminal is closed and keep running other than physical connection via keyboard and monitor to the RPI4.
I have tried to have the pi run the app at start up but not sure why it will not start app. by adding it to /etc/rc.local I may be doing it wrong
sudo python /home/rod/picamera2-WebUI-Lite-main/app.py &
It might because running the if you try to run the app with a command line outside of the directory there is a error
python /home/rod/picamera2-WebUI-Lite-main/app.py
commandpython app.py
works fine if you are in thepicamera2-WebUI-Lite-main
directoryPlease excuse my ignorance if this is damp request or question for I am not a proficient user of the Pi interface and shell. just tiring my best with google searches to find a solution to using the PI as a rearview camera.