ras07
Posts: 122
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: 122
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: 323
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: 323
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: 122
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: 323
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: 122
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!

Dave2020
Posts: 1
Joined: Tue Oct 27, 2020 1:18 am

Re: RPi Cam Web Interface

Tue Oct 27, 2020 1:39 am

Hi, I love this software but I have just discovered that I am unable to achieve the target fps. For example, when set to 30 fps (1296 x 972) I obtain only ~23-25 fps (it varies second to second). Similarly, at a setting of 90 fps (640 x 480), I obtain only ~50 fps. I am using a RPI 4b, with this camera (https://www.amazon.com/Raspberry-Camera ... B07RGKN6QT), and recording to the SD card (https://www.amazon.com/Lexar-Profession ... B07NHCB6N3).
I have followed previous advice such as deleting the uconfig file but this has not helped.
I am able to achieve the target fps in raspivid.
The problem I'm having seems to be similar to this issue reported in github: https://github.com/silvanmelchior/RPi_C ... issues/583

Any advice on how to achieve higher and consistent fps?

User avatar
RichShumaker
Posts: 323
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

Tue Oct 27, 2020 8:09 pm

Dave2020 wrote:
Tue Oct 27, 2020 1:39 am
Hi, I love this software but I have just discovered that I am unable to achieve the target fps. For example, when set to 30 fps (1296 x 972) I obtain only ~23-25 fps (it varies second to second). Similarly, at a setting of 90 fps (640 x 480), I obtain only ~50 fps. I am using a RPI 4b, with this camera (https://www.amazon.com/Raspberry-Camera ... B07RGKN6QT), and recording to the SD card (https://www.amazon.com/Lexar-Profession ... B07NHCB6N3).
I have followed previous advice such as deleting the uconfig file but this has not helped.
I am able to achieve the target fps in raspivid.
The problem I'm having seems to be similar to this issue reported in github: https://github.com/silvanmelchior/RPi_C ... issues/583

Any advice on how to achieve higher and consistent fps?
I hope you can find some answers as I LOVE RPi_Cam_Web_Interface and it is not working for me right now.
I too was on a Pi4. I also used the new HQ camera. I am going to set up some older Pi's V1/V2 combos to confirm/duplicate this issue. I will rebuild and reinstall everything from scratch with up to date OS images.
I will update my Github ticket with more details as well as here.
Rich Shumaker
http://www.instructables.com/id/Pi-Zero-W-NoIR-8MP-Camera-Build-Overview-Introduct/

hogwell
Posts: 8
Joined: Sat Oct 19, 2019 4:14 pm

Re: RPi Cam Web Interface

Thu Oct 29, 2020 5:57 pm

Tortoizian:

The key to controlling hardware (like your relay example) from RPi_Cam_Web_Interface is to use a pipe to send commands
to a script that runs in the background as root (e.g. launched as "python myscript.py &" in /etc/rc.local).

This is because the macro sh file that is launched from a userbuttons entry will run as user www-data, which does not have
permissions necessary to control hardware directly.

Here's an example .sh file that sends a command through a pipe named FIFO_relay that was created previously:

Code: Select all

mkfifo /var/www/html/FIFO_relay

Code: Select all

#!/bin/bash
# Send command through the pipe
echo -n "relay 0 0" >/var/www/html/FIFO_relay
In the background script running as root, the pipe is read to process the command and operate the hardware:
For example, in myscript.py, you might have code like this:
....

Code: Select all

                pipein = open("/var/www/html/FIFO_relay", 'r')
                line = pipein.readline()
                line_array = line.split(' ')
                if line_array[0] == "relay":
                      if line_array[1] == "0":
                                #Turn relay off
                      else:
                                #Turn relay on
....

I hope this helps get you going on this idea!

hogwell
Posts: 8
Joined: Sat Oct 19, 2019 4:14 pm

Re: RPi Cam Web Interface

Sat Oct 31, 2020 10:57 pm

Qbo wrote:
Wed Sep 30, 2020 12:47 pm

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
I ran into the same error (ModuleNotFound: pydng) when I ran examples/utility.py as user www-data
(end_image.sh will run as this user).

I think this is because I installed PyDNG as user 'pi'.

I'm not sure how to set up python to have access to the pydng module from user www-data.
The cloned PyDNG folder has 644 permissions, so you would think any user could access pydng.

Maybe someone who knows python better can help with this?

Otherwise, I'll have to set up a command pipe to process the PyDNG conversion as root perhaps.

TheBluePhoenix
Posts: 1
Joined: Sun Nov 01, 2020 6:35 am

Re: RPi Cam Web Interface

Sun Nov 01, 2020 6:54 am

Hello, I finally got this up and running after struggling with some permission issues. I want to add additional code and buttons to this interface and include a few python scripts in it, which use the feed coming from the rpi cam as an input and display a few additional things on the gui like his ID no. after face recognition. Has someone tried this?

hang12
Posts: 4
Joined: Mon Oct 08, 2018 4:13 pm

Re: RPi Cam Web Interface --- Long exposure with HQ cam

Sat Nov 14, 2020 7:42 pm

According to https://www.raspberrypi.org/documentati ... longexp.md, the Raspicam HQ is capable of doing 230sec long exposures. How can I use this long exposure times in the RPi Cam Web Interface?

I would be happy even with 5..10sec, but I seem to be getting only 1sec max.

cleveridiot
Posts: 11
Joined: Sun Sep 08, 2019 7:36 am

Re: RPi Cam Web Interface

Mon Nov 16, 2020 2:45 pm

9B8C2EFE-25C5-4258-B9A6-54FCE3ECB72C.jpeg
9B8C2EFE-25C5-4258-B9A6-54FCE3ECB72C.jpeg (137.64 KiB) Viewed 240 times
My issue is this. It’s the new camera module and it sometimes flashes a correct color image but mostly this. Like some effect but also the left side has a band of correct image still...

EDIT: Solved by updating OS and RPi cam software. Couldn’t update before because SD card was too small, moved to bigger one and all went fine after that.

JPGarcia
Posts: 1
Joined: Sun Nov 22, 2020 6:48 am

Re: RPi Cam Web Interface -- Continuos recording segments extraction

Sun Nov 22, 2020 7:34 am

Hi!

I want to set RPi Cam to record continuously (it is for limited sessions of maybe 2 hours) and allow the users to review moments of it on demand.

I'm thinking about two ways of doing this:

A)
In my ideal world, I'd like to not have to mess with clipping and exports, just to set the playhead to the desired time in the full length movie (or movies if I'm recording in splits).

I'd like to generate an HTML page with the movie and a list of time stamps that would set the playhead accordingly (to the marked time)

My questions are: which code to study or modify to get the playhead time and from where? The camera is recording, I guess that one way would be to get information from the raspimjpeg but I'm not sure.

Can I create successive HTML pages to store the recording sessions and timestamps associated or is this an incorrect approach?

B)
The second option would be to extract clips from the recorded movie. I know that the .h264 file is boxed into MP4, so I have 2 questions:

1) Can this "clipping" be done from the .H264 file before boxing?
2) If yes, can someone explain me how to do it from a high level point of view? I mean... I will have to write a script in Python? Where can I learn about the function to write? I don't have experience with Python but I think I can work this out with work and patience. I only need you to point me in the correct direction.

My requeriments are: "put the cam to record continuously", "get the time of the present moment plus the buffer" and either "generate a link to set the playhead at the desired time for the given recording" or "extract a clip from the recording for the wanted time".

Sorry if I ask newbie stuff, I'm new to Rpi, to Python and to RPi Cam :-)

Return to “Camera board”