ras07
Posts: 119
Joined: Tue May 22, 2018 4:04 am

Re: RPi Cam Web Interface ---motion detection stop---(resolved itself)

Wed Sep 16, 2020 6:27 pm

CharlyDelta wrote:
Tue Sep 15, 2020 7:23 pm
After months of good working, (in fact, it's a function I barely use on this device, so I don't know since when), when I click on ''motion detection stop'', the Rpi Cam Web freezes. Also when movement detected.
...
Mystery, after two days that it doesn't work and having groped a lot of stuff... this morning, after leaving it on all night long it works... Weird !
In my experience:
  • I've found a surprising amount of weirdness can get solved by reseating the camera cable
  • Reflashing your SD card can also fix a lot of problems
  • SD cards can fail in a lot of different (and sometimes non-obvious) ways; replacing (or at least thoroughly testing) your SD card can be helpful, especially if it's been in use for a long time

rpiuser2016
Posts: 80
Joined: Tue Jan 12, 2016 1:53 pm

Re: RPi Cam Web Interface

Mon Sep 21, 2020 10:25 am

Why all my videos marked as "busy" and cannot be viewed?

Image

ras07
Posts: 119
Joined: Tue May 22, 2018 4:04 am

Re: RPi Cam Web Interface

Mon Sep 21, 2020 12:40 pm

rpiuser2016 wrote:
Mon Sep 21, 2020 10:25 am
Why all my videos marked as "busy" and cannot be viewed?
Might mean the "boxing" (conversion from .h264 to .mp4) is hung or failing for some reason. Things to look for:
  • What's the contents of the media directory (usually /var/www/html/media) look like? If you have a bunch of files that end in .h264 this could be the problem.
  • Sometimes there is a corrupt .h264 file that's preventing the rest of the queue from processing (this can happen if, for example, the Pi crashed during a recording). If any .h264 files are of zero size, delete them. Otherwise find the oldest .h264 file and delete it. You may have to reboot after this. The rest of the .h264 files should start processing after this. (Can take a while!)
  • There's a script in the macros directory (usually /var/www/html/macros) called startstopX.sh. I think it is obsolete now, but its intent was to convert unprocessed .h264 files. I'm pretty sure this happens automatically on reboot now, but if all else fails try making this script executable and manually running it.
  • If all else fails, just delete all the existing .h264 files (or better yet, everything in the media directory) and reboot.
If this kind of thing happens repeatedly, you might try try upping the GPU memory (run sudo raspi-config, go to 7 Advanced Options, then A3 Memory Split, set it to perhaps 128Mb or 192Mb for a Pi Zero or 256Mb for a 2 or 3, and reboot). (YMMV; I'm not positive this has any effect on boxing; also, I'm told this setting doesn't matter on the Pi 4 as the OS handles it dynamically as needed.)

Qbo
Posts: 2
Joined: Mon Jun 29, 2020 12:37 am

Re: RPi Cam Web Interface

Wed Sep 30, 2020 12:47 pm

Hi,
I'm using the RPi cam web interface along the HQ camera and the Pi4 for timelapses mainly. I would like to know if there is an option to 1:1 zoom on main page so I could use it to assist me at focusing?
Also, I'm having trouble on day-night cycles, I can not get the camera to have long exposures at night enough not to see everything pitch black. Any ideas or tutorials on that front would be appreciated.
Thanks for all the hard work, btw.

Lastly (for now) I'm trying to convert the jpg to dng using PyDNG, it should be pretty straight foward, I create a bash end_image.sh on macros folder, and execute the examples/utility.py of PyDNG using the 1% arg with the file name.
Well, I can not figure out what I'm doing wrong but I'm getting a Module no found error, so I'm guessing I need some path variable I'm overseeing. So If anyone can help this noob with that script I'd be most grateful

pifantoo
Posts: 5
Joined: Thu Oct 01, 2020 7:52 pm

Re: RPi Cam Web Interface - busy videos

Thu Oct 01, 2020 8:23 pm

Hi rpiuser2016,

Me too had this problem.

I think I solved it by changing three things.
First I use 3 and 3+ so I cannot tell about other raspberry pi versions.
First I did what ras07 tells you except for the last part with memory increase for the GPU.
Remember that you can still watch the unboxed .h264 files, just save them and use VLC in Windows(?).
Then I changed to a 32GB SD card. That will not really help you, but it will take longer before you notice problems. I have my cameras on a remote location, so I cannot go there very frequently.
Second I limited the video size to a maximum of 60 seconds. Videos will still be recorded but only in maximum 60 seconds chunks. The 60 second limit don't seem to be very accurate, but that is not the point, the point is if you have a huge recording, the boxed file will also be huge and I believe they are both present on the media at some moment so it may become full. I don't recall where to find the maximum size setting, but it should not be too tricky to find.
Finally I set up automatic purging of video files if I only have 2GB free space left on the SD card. This is done under schedule settings. I first had 1GB limit, but was not happy so I increased it to 2GB.
Since then I'm "eagerly" waiting for it to happen again.

And finally finally,
Thanks a lot to all of you great guys who made this working and still provide us with excellent support here in the blog, noone mentioned and noone forgotten ;)

Happy user

pifantoo
Posts: 5
Joined: Thu Oct 01, 2020 7:52 pm

Re: RPi Cam Web Interface - busy videos

Thu Oct 01, 2020 8:32 pm

I should have mentioned that typically it is the first or one of the first files that is the huge and problematic file.
If the SD card is "full", almost everything after is lost but you still get many small thumbs marked as busy.

Happy user

User avatar
RichShumaker
Posts: 262
Joined: Tue Jul 31, 2012 4:16 pm
Location: Sunny Southern CA near downtown LA
Contact: Website Facebook Twitter YouTube

Re: RPi Cam Web Interface

Fri Oct 02, 2020 2:56 am

Qbo wrote:
Wed Sep 30, 2020 12:47 pm
Hi,
I'm using the RPi cam web interface along the HQ camera and the Pi4 for timelapses mainly. I would like to know if there is an option to 1:1 zoom on main page so I could use it to assist me at focusing?
I use an iPad and pinch squeeze the image to help zoom for focus.
At 9:09 in this video you can see me do this to help focus
https://youtu.be/y5IwNFpTvEI
Rich Shumaker
http://www.instructables.com/id/Pi-Zero-W-NoIR-8MP-Camera-Build-Overview-Introduct/

User avatar
RichShumaker
Posts: 262
Joined: Tue Jul 31, 2012 4:16 pm
Location: Sunny Southern CA near downtown LA
Contact: Website Facebook Twitter YouTube

Re: RPi Cam Web Interface - busy videos

Fri Oct 02, 2020 3:01 am

pifantoo wrote:
Thu Oct 01, 2020 8:32 pm
I should have mentioned that typically it is the first or one of the first files that is the huge and problematic file.
If the SD card is "full", almost everything after is lost but you still get many small thumbs marked as busy.

Happy user
You can FTP to the folder and download the H264 to another machine and transcode with VLC. Although my VLC likes to hang when I do it. It converts the file even though it hangs.

Side note if the SD card is full nothing is recorded the file is 0 I have had that happen.
Rich Shumaker
http://www.instructables.com/id/Pi-Zero-W-NoIR-8MP-Camera-Build-Overview-Introduct/

Qbo
Posts: 2
Joined: Mon Jun 29, 2020 12:37 am

Re: RPi Cam Web Interface

Fri Oct 02, 2020 8:18 am

RichShumaker wrote:
Fri Oct 02, 2020 2:56 am
Qbo wrote:
Wed Sep 30, 2020 12:47 pm
Hi,
I'm using the RPi cam web interface along the HQ camera and the Pi4 for timelapses mainly. I would like to know if there is an option to 1:1 zoom on main page so I could use it to assist me at focusing?
I use an iPad and pinch squeeze the image to help zoom for focus.
At 9:09 in this video you can see me do this to help focus
https://youtu.be/y5IwNFpTvEI
Thanks, that was it! I'll field test it today.

pifantoo
Posts: 5
Joined: Thu Oct 01, 2020 7:52 pm

Re: RPi Cam Web Interface - camera focus

Fri Oct 02, 2020 11:39 am

Hi Qbo,

One possible workaround is to look at the file size.
The bigger the file, the more detail it has.
If you adjust focus slightly between different pictures with a fixed motive and fixed camera and look for the largest file you should be close to optimum focus.
I would like to try the new camera myself even if I only can take stills with it.

Currently I have both the old camera v1.3 and v2.1.
V2.1 can be adjusted but my older cameras rev 1.3 are glued to prevent changing focus.
Anyone who knows how to "crack" the glue?

Happy user

ras07
Posts: 119
Joined: Tue May 22, 2018 4:04 am

Re: RPi Cam Web Interface - camera focus

Fri Oct 02, 2020 6:27 pm

pifantoo wrote:
Fri Oct 02, 2020 11:39 am
Currently I have both the old camera v1.3 and v2.1.
V2.1 can be adjusted but my older cameras rev 1.3 are glued to prevent changing focus.
Anyone who knows how to "crack" the glue?
Just twist harder :D

(Only halfway joking ... on mine the glue broke away pretty easily)

User avatar
RichShumaker
Posts: 262
Joined: Tue Jul 31, 2012 4:16 pm
Location: Sunny Southern CA near downtown LA
Contact: Website Facebook Twitter YouTube

Re: RPi Cam Web Interface - camera focus

Sun Oct 04, 2020 1:00 am

ras07 wrote:
Fri Oct 02, 2020 6:27 pm
pifantoo wrote:
Fri Oct 02, 2020 11:39 am
Currently I have both the old camera v1.3 and v2.1.
V2.1 can be adjusted but my older cameras rev 1.3 are glued to prevent changing focus.
Anyone who knows how to "crack" the glue?
Just twist harder :D

(Only halfway joking ... on mine the glue broke away pretty easily)
Agreed. I used a pencil with a new eraser to help. I remember a lot of people discussing this early on and twist harder(but be careful) was said a lot.
Rich Shumaker
http://www.instructables.com/id/Pi-Zero-W-NoIR-8MP-Camera-Build-Overview-Introduct/

pifantoo
Posts: 5
Joined: Thu Oct 01, 2020 7:52 pm

Re: RPi Cam Web Interface - camera focus

Sun Oct 04, 2020 5:03 pm

Thanks guys!

Encouraged of your twists, I gave it a try on one of my slightly out of focus v 1.3 cameras.
When your cams was manufactured the glue-specialist obviously took a day off. Mine was terribly well glued around almost half the lens, so after separating the camera from the camera board, I took a sharp surgery knife and cut away all visible glue under a microscope.
No help, the lens was still stuck and increasing the force further would have risked it. There is not much grip for a tool, so I then cut two opposite sides of the movable lens to make a better grip for twisting and continued cutting the upper edge until the lens was flat with the lens holder just near the thread and the glued gap clearly visible. Then I used the knife tip to carefully bend the glued gap slightly open all around to crack the remaining glue inside the thread. This helped so I could twist it open fairly easy :)

So, it works but is not a quick fix for the faint-hearted.

If this is too much of topic, please move it to where it belongs.
However, other readers might find this info useful also here.

bbirkhahn
Posts: 1
Joined: Thu Oct 08, 2020 7:13 pm

Re: RPi Cam Web Interface

Thu Oct 08, 2020 7:16 pm

Is it possible to use the Rpi Cam Web Interface AND the Pihole Web Interface?
I only get one of them working.

ras07
Posts: 119
Joined: Tue May 22, 2018 4:04 am

Re: RPi Cam Web Interface

Thu Oct 08, 2020 8:43 pm

bbirkhahn wrote:
Thu Oct 08, 2020 7:16 pm
Is it possible to use the Rpi Cam Web Interface AND the Pihole Web Interface?
I only get one of them working.
Should be doable in theory, but I haven't tried it. They would need to run on different ports (they both default to Port 80), so you'd have to change one or the other (it's easy to change the port when setting up RPi-CWI). Pihole uses lighttpd whereas RPi-CWI defaults to Apache; this is probably fine (and would reduce possible configuration collisions). If you wanted to try to minimize overhead you could run RPi-CWI on lighttpd also, but you would probably have to deconflict their configurations manually (and probably have to repeat that every time you upgraded either one).

If you are familiar with Docker (or are willing to learn!) Pihole has a Docker implementation that works well. This would insure minimal possibilities for conflicts (again, you'd have to run one on a different port). You'd probably need a Pi 3 or 4 for this since Docker does have some overhead. Docker has a bit of a learning curve but it's well worth learning; it opens up a lot of possibilities.

pifantoo
Posts: 5
Joined: Thu Oct 01, 2020 7:52 pm

Re: RPi Cam Web Interface - Watchdog detected problem

Mon Oct 12, 2020 9:15 pm

Few days ago I got the "Watchdog detected problem." in my log and the camera hanged with a freezed preview picture.
I use a RPi 4B with 2G memory and the original power supply with stiff power cable. Mains power is very stable where I live so I don't think it's a brown-out. The cam is mounted on the wall near a hall way and has worked fine several months so I started to search here.

From reading btidey's reply to antondubek on page 174, he says that;
"The watchdog is looking for the cam.jpg file in the /dev/shm/mjpeg folder to be regularly updated. This is the preview file which forms the stream. If this does not update for more than the watchdog period then the main process kills itself and the watchdog process starts a separate copy.

As your watchdog is kicking in before it gets going then this would indicate that the camera process is not producing anything right from the start."

So something goes wrong in the camera and this happened to me shortly after midnight, so I had no hard recording at the time.
If you look at the camera, it's a tiny pcb with a tiny flat cable and connectors to a small pcb and a 15 cm "long" 15 pin ribbon cable to the RPi and "nothing" what we could call "ground" in RF sense.
We have all read about checking and re-checking all connections AND power supply, so this has been done several times.

However the ground connection to the camera is not very well defined and I see no obvious EMC filtering. Few capacitors on the camera board and eight on the camera itself could be EMI related filtering. For normal use I think this is good enough, but if you bring your dear phone nearby you might end up with a surprise.
I never carry my phone with me, but my kids do 24/7 for some reason. Even if you think you don't use your phone, the master spy himself does to check what you are up to, just as he is here on this forum to learn few things ;-)

So, if you have problem with your camera and checked everything else you can imagine, check also this:
Leave your mobile phone at least two meters or more away.
If that is not doable, place the RPi with camera inside a metallic box with a hole for the lens and see if it gets better. I have used those cheap one time use food boxes that you can easily bend to shape and put in the freezer or oven. Just isolate it inside to prevent short circuits and avoid hot places as the air cooling gets worse. The RPi 3B+ consumes some 3-4W during operation and 4B even more, so it may not like it without a fan. Warranty void as usual.
Other EMC tricks is to add ferrite clamps on cables including the power and camera cable.

Happy user

Tortoizian
Posts: 8
Joined: Wed Oct 14, 2020 2:58 am

Re: RPi Cam Web Interface

Fri Oct 16, 2020 8:16 am

Hey!

I'm using a relay to control the opening and closing of an electric door strike and I have the code needed to do this but then I want to add a button in website to activate the python script stored in the raspberry pi to lock and unlock the door. Is there a way to do this?

Thanks for helping!

Return to “Camera board”