rahlquist
Posts: 149
Joined: Tue Jan 21, 2014 1:02 pm

Re: RPi Cam Web Interface

Sat Jun 14, 2014 6:08 pm

Hate to reply right after myself but this might be worth it. I had been having trouble since the last round of updates not only with the cam but also with my cputemp scripts bases on one I found online ( http://lazydroid.com/2013/05/16/ ).

The only real differences between his scripts and mine is that I store the writable files on a samba share on my linux media server. That way I cut back on thrashing on my SD Card. Lately something has been causing the process to hang. I will see 3 items in my 'ps aux' list. First is '/USR/BIN/CRON' the second two are calling my script, one process sudo the other not. These processes are zombies, status shows as D, so they cannot be killed, matter of fact once I have these zombies spawned the only way to fix the situation is to power off the pi.

You are probably wondering why I bring that up, well the FIFO appears to be having the same sort of hanging issue. I am starting to wonder if there is something about the file system that is not releasing, or returning properly. Once the FIFO hangs no other commands seem to work. Same with my script, once it hangs once, each following process zombies so that I get hundreds.

Am I off base?

leechpool
Posts: 4
Joined: Sun Jun 15, 2014 12:17 pm

Re: RPi Cam Web Interface

Sun Jun 15, 2014 3:03 pm

Hi,
I've been studying the PiPan code associated with this brilliant project. I'm very new to trying to create a webpage to do things - this will be only the second I've attempted. I've simply been looking very hard at the code and trying to work out how / what it does. I think I've got a limited understanding of the majority of it and look forward to experimenting when the RPi I've ordered arrives but there is one thing that keeps bothering me.....
I don't understand what makes the touch screen functionality work. I can seen how the javascript function pipan_start appears to be looking for touchmove and touchend events and then actions appropriate functions when they happen but what triggers the pipan_start function in the first place? I think I can seen how a button press or key press initiates the appropriate functions but just don't see it for the touch screen part. Any help in explaining this would be greatly appreciated.
Thanks
:)

jit
Posts: 33
Joined: Fri Apr 18, 2014 2:52 pm

Re: RPi Cam Web Interface

Mon Jun 16, 2014 8:44 pm

jbeale wrote:
tigroz wrote:Hi, very good work!
I'm trying to configure to send an email automatically with the link to the video generated by following this guide:
http://jeremyblythe.blogspot.co.uk/2012 ... r-and.html
the script that upload the video on Google drive and send an email works indeed, but
but the problem it's that the motion.conf uses
on_event_end echo 'ca 0' > /var/www/FIFO
so if i use :
on_movie_end sudo python /etc/motion/uploader.py /etc/motion/uploader.cfg %f
it doesn't do anything...
Right, the 'motion' program does not realize that there is any video recording, it just sends some characters to the /var/www/FIFO pipe and the recording is done elsewhere (raspimjpeg). In the motion.conf file, "on_movie_end" applies only if you turned on the MPEG encoding option of "motion" and that by default is not on.

So what you need to do is modify "on_event_end" to not only send the 'ca 0' command to halt recording, but also send the email. So, something like

Code: Select all

on_event_end echo 'ca 0' > /var/www/FIFO && sudo python /etc/motion/uploader.py /etc/motion/uploader.cfg
Note that you cannot pass %f to your uploader.py script because "motion" did not record the video and does not know its filename. Your script will have to check for the most recent file in /var/www/media to find out what it is. That becomes another issue, because at that moment raspimjpeg closes out the raw .h264 it had been recording, it calls MP4Box to convert it to .mp4 format, which takes some seconds depending on length, and then deletes the .h264 file. So your script should either wait for MP4Box to complete its work, or substitue the .mp4 extension by itself in the email message, while realizing that the .mp4 file will not exist for some unknown period of time until MP4Box is done.
Just wondered if anyone got this working?

thomasgatt
Posts: 4
Joined: Fri Jun 13, 2014 12:09 am

Re: RPi Cam Web Interface

Tue Jun 17, 2014 7:41 am

Just wondered if anyone got this working?
Why don't you try the following? That is what I'm testing atm:

Code: Select all

on_event_end echo 'ca 0' > /var/www/FIFO && sleep 1m && sudo python /etc/motion/uploader.py /etc/motion/uploader.cfg
Of course you can increase the amount of time for the sleep command. But in one minute the processing will probably complete.

jit
Posts: 33
Joined: Fri Apr 18, 2014 2:52 pm

Re: RPi Cam Web Interface

Tue Jun 17, 2014 8:17 am

thomasgatt wrote:
Just wondered if anyone got this working?
Why don't you try the following? That is what I'm testing atm:

Code: Select all

on_event_end echo 'ca 0' > /var/www/FIFO && sleep 1m && sudo python /etc/motion/uploader.py /etc/motion/uploader.cfg
Of course you can increase the amount of time for the sleep command. But in one minute the processing will probably complete.
I don't think this would work because the second parameter to the uploader.py script is the filename to upload. Motion doesn't know what the filename is because its not creating the recording directly, but rather triggering the raspimjpeg to create the file.

thomasgatt
Posts: 4
Joined: Fri Jun 13, 2014 12:09 am

Re: RPi Cam Web Interface

Tue Jun 17, 2014 8:22 am

Of course you have to modify the py file that instead of getting the filename, the script looks for the latest mp4 in the folder where you're saving your files :)

jiaqi1993
Posts: 1
Joined: Thu Jun 19, 2014 2:52 am

Re: RPi Cam Web Interface

Thu Jun 19, 2014 2:56 am

I have tried RPi Cam Web but there's problem when I run it with my pulse sensors.

It's attached to an arduino Mega and get the data from serial using the python script.
Whenever I start my script with the Camera on, the data fluctuate until I stop the camera.

rahlquist
Posts: 149
Joined: Tue Jan 21, 2014 1:02 pm

Re: RPi Cam Web Interface

Wed Jun 25, 2014 5:01 am

Ok I think I may have found a way to run latest kernel.

I reupdated my Pi to the latest, tested saving a snapshot and sure enough 0k fie and the same for any more created. So it was breaking. So then I updated and compiled. Tried saving an image again the the browser ui and this time had no issues. I cant take credit I saw what appears to be a connection and got lucky. http://www.raspberrypi.org/forums/viewt ... 43&t=76172 is the thread The steps I took were;

Code: Select all

git clone git://github.com/raspberrypi/userland.git
cd userland/
./buildme
Then rebooted. Now it seems to work just fine. YMMV

EDIT: may have been premature.

BoehserWolf
Posts: 44
Joined: Thu Jun 12, 2014 2:53 pm

Re: RPi Cam Web Interface

Wed Jun 25, 2014 7:18 am

rahlquist wrote:Ok I think I may have found a way to run latest kernel.
EDIT: may have been premature.
Funny, I was on the same track yesterday but came from a different approach. Saw a couple of things changed in the userland code especially in the mmal libs. Since raspimjpeg depends on these libs, I was thinking a simple recompile of raspimjpeg against the new libs could help.

Code: Select all

ldd raspimjpeg
        /usr/lib/arm-linux-gnueabihf/libcofi_rpi.so (0xb6f6d000)
        libmmal_core.so => /opt/vc/lib/libmmal_core.so (0xb6f4c000)
        libmmal_util.so => /opt/vc/lib/libmmal_util.so (0xb6f37000)
        libmmal_vc_client.so => /opt/vc/lib/libmmal_vc_client.so (0xb6f2c000)
        libvcos.so => /opt/vc/lib/libvcos.so (0xb6f1a000)
        libbcm_host.so => /opt/vc/lib/libbcm_host.so (0xb6f00000)
        libpthread.so.0 => /lib/arm-linux-gnueabihf/libpthread.so.0 (0xb6ee1000)
        libdl.so.2 => /lib/arm-linux-gnueabihf/libdl.so.2 (0xb6ed6000)
        librt.so.1 => /lib/arm-linux-gnueabihf/librt.so.1 (0xb6ec7000)
        libvchiq_arm.so => /opt/vc/lib/libvchiq_arm.so (0xb6eb9000)
        libc.so.6 => /lib/arm-linux-gnueabihf/libc.so.6 (0xb6d88000)
        libgcc_s.so.1 => /lib/arm-linux-gnueabihf/libgcc_s.so.1 (0xb6d60000)
        /lib/ld-linux-armhf.so.3 (0xb6f7b000)
What I did so far:
- updated debian via apt-get
- issued an rpi-update
- landed here: Linux pidev 3.12.22+ #691 PREEMPT Wed Jun 18 18:29:58 BST 2014 armv6l GNU/Linux
- cloned the latest userland tools and build them
- rebuild latest raspimjpeg and transfered to my PI

I got happy after I saw the Web IF runs fine, but after I took the first foto via "record image" got unlucky again on first shot as the preview was frozen. Same happens if I let motion detection run.
From now there is no way out until I restart the app via RPi_Cam_Web_Interface_Installer.sh. It then happens to hang sometimes at the first image, sometimes after a couple of images.

So I digged a bit in the code and found out that jpegencoder2_buffer_callback() is not called from mmal code when the problem occurs.

I see to possibiltities so far:
1) Something changed in the mmal code which needs special handling in raspimjpeg also. I'm thinking about registering of the encoder or maybe some missing lock could be likely.
2) We are facing a bug somewhere in mmal code which needs to be fixed or workarounded somehow.

So overall I presume we are facing a deadlock here...
Don't know if I'll put more effort into this, but I'll keep you updated.

Regards
Ralf

rahlquist
Posts: 149
Joined: Tue Jan 21, 2014 1:02 pm

Re: RPi Cam Web Interface

Wed Jun 25, 2014 11:05 am

BoehserWolf wrote: So overall I presume we are facing a deadlock here...
Don't know if I'll put more effort into this, but I'll keep you updated.
Yeah it sounds like you and I are of like mind on this in thinking its one of the mmal libs. On the surface it makes a lot of sense, its just a matter of finding the right issue. Will post if I get any farther with it.

sumsar1812
Posts: 4
Joined: Fri Jun 27, 2014 10:45 am

Re: RPi Cam Web Interface

Fri Jun 27, 2014 1:33 pm

Hello. I have followed your steps, however I was running into som problems.
I was able to connect to the RaspberryPi via. the ip in my browser.

First problem is when we boot, the Pi, the cam turns on, however the keyboard and mouse we have plugged in is "disabled" also at this point i´m not able to connect to the PI´s IP.

Then i changed the boot order to "Desktop Log in as user 'pi' at the grapical desktop" then the i was able to use mouse and keyboard.
Now i am able to connect to the Pi Ip im my browser however it gives me an errormessage:

How can i fix this ?

Image

BoehserWolf
Posts: 44
Joined: Thu Jun 12, 2014 2:53 pm

Re: RPi Cam Web Interface

Sat Jun 28, 2014 11:29 am

sumsar1812 wrote: Now i am able to connect to the Pi Ip im my browser however it gives me an errormessage:

How can i fix this ?
Image
Try to revert to latest known working firmware, see http://elinux.org/RPi-Cam-Web-Interface ... a_Firmware

Regards
Ralf

waltermixxx
Posts: 34
Joined: Wed May 09, 2012 7:21 pm
Location: Woodbridge, Ontario

Re: RPi Cam Web Interface

Sun Jul 06, 2014 4:23 pm

i created a "sled" for my raspberry pi and picam for my Makerbot replicator 2 3d printer. It's on thingiverse.com: http://www.thingiverse.com/thing:380431

i use it to monitor my 3d prints. using the information in this thread... :) just wanted to say thanks folks... :)

i do have a quick question now that I think about it... i was wondering where i change the text for the webpage, I would prefer it say Makerbot Replicator 2 Monitor or something along those lines... :) where is the actual file kept, i found one file, and changed it, but I dont think it was the correct one, because even after rebooting, the text on the webpage was the same... :)

found it, the files are copied to /var/www/ when the install script is done, so I just went into that folder and changed it there, and sure enough it worked. :)

:)
Electronics for fun...
Raspberry Pi-1 Occidentalist, Tenda 311m x 2
Raspberry Pi-2 Raspbian Wheezy 07-15-12, Netgear N150 x1
Genius 8000 slimline wireless keyboard and mouse both work great with the usb wifi dongle right in the raspberry pi.

bjornhallberg
Posts: 11
Joined: Sun May 25, 2014 3:46 am

Re: RPi Cam Web Interface

Wed Jul 09, 2014 8:30 am

I'm also getting errors. ./RPi_Cam_Web_Interface_Installer.sh start gives:
mmal: mmal_vc_component_enable: failed to enable component: ENOSPC
Error: Could not enable camera
However, ./RPi_Cam_Web_Interface_Installer.sh stop and then ./RPi_Cam_Web_Interface_Installer.sh start seems to fix things.

What seems to happen here is that the scripts fails after I've been playing around with raspistill and raspivid via ssh and then try to start raspimjpeg again. Wasn't there some mmal error last year that was supposed to be fixed that would cause this exact thing when trying to access the camera twice?
https://github.com/raspberrypi/userland/issues/39
Raspistill and raspivid still work from the command line though, even though raspimjpeg / RPi Cam Web Interface needs to be restarted.

bjornhallberg
Posts: 11
Joined: Sun May 25, 2014 3:46 am

Re: RPi Cam Web Interface

Thu Jul 10, 2014 6:45 am

Also, on another note, would it be possible to interact with RPi Cam Web Interface from home automation software? Telling it when it needs to record video or snap images? I'm thinking of having a PIR motion sensor instead of the motion software. It would be a great way to have your cake and eat it too, being able to run the camera constantly, reading the symlink in var/www at will but also being able to trigger recording based on rules.

eccentricdyslexic
Posts: 157
Joined: Thu Jul 18, 2013 6:13 am
Location: Uttoxeter, Staffordshire, UK

Re: RPi Cam Web Interface

Thu Jul 10, 2014 10:18 am

Love it, but how do I access the mjpeg stream only?

steve

eccentricdyslexic
Posts: 157
Joined: Thu Jul 18, 2013 6:13 am
Location: Uttoxeter, Staffordshire, UK

Re: RPi Cam Web Interface

Fri Jul 11, 2014 1:31 pm

Anybody help me out here? i need to view mjpeg steam on vlc player.

Cheers

Steve

User avatar
RichShumaker
Posts: 228
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 Jul 11, 2014 6:36 pm

Has anyone linked multiple Pi Cameras via direct code or the web servers / code?
Has anyone added GPIO buttons for taking images?
Is there a way to access the Vectors from Motion?
I am not talking about outside this software, I know I can add a button to take a picture I mean a button to access this code.

This software is awesome and really makes the Pi Camera easy to use.
Sorry I don't have the answer on how to access the stream directly
Rich Shumaker
http://www.instructables.com/id/Pi-Zero-W-NoIR-8MP-Camera-Build-Overview-Introduct/

eccentricdyslexic
Posts: 157
Joined: Thu Jul 18, 2013 6:13 am
Location: Uttoxeter, Staffordshire, UK

Re: RPi Cam Web Interface

Sun Jul 13, 2014 6:05 am

I need to uninstall this, are all the files in /var/www for RPi Cam Web Interface? ie am I safe to delete it?

Cheers

Steve

noctividus
Posts: 4
Joined: Fri Jun 06, 2014 7:47 pm

Re: RPi Cam Web Interface

Wed Jul 16, 2014 2:19 am

I've been using this code for some time, and it really works great. I've run into some sort of bug:

When I view the camera for a prolonged period, it eventually dies and the pi has to be reset. The time is in the range of 30 min or so.

I access the camera feed in three ways:
  • The built-in webpage.
  • A custom "fullscreen" page that just displays the image centered nice and pretty.
  • By refreshing cam_pic.php at the desired frame rate inside an android app.
Each method produces the same results...runs great for a while, then just stops. At first I thought it was the "time" counter over-running in the webpage, but my loading of cam_pic.php produces the same result. I thought also that it might need a refresh, but the last method refreshes 10x per second, so that's not it.

Any ideas where the problem is?

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

Wed Jul 16, 2014 8:23 am

RichShumaker wrote:Has anyone linked multiple Pi Cameras via direct code or the web servers / code?
I had an idea on this, it requires 2 new switches or toggles on the web interface.
Listen(Y/N) and Broadcast(Y/N)

Listen has the Pi monitor a Port like 4242(I made this up as I am not sure the best port).
Broadcast(when on) sends the button press to all of the Pi's Listening on port 4242.
So you could start video, take picture, or use timelapse.
All Pi's would have independent settings for the camera setups as the Broadcast would only sends button press data and not config data.

If a GPIO physical button was added it could send the button press this same way using a broadcast command.
Rich Shumaker
http://www.instructables.com/id/Pi-Zero-W-NoIR-8MP-Camera-Build-Overview-Introduct/

User avatar
Mettauk
Posts: 238
Joined: Mon Dec 10, 2012 12:40 pm
Location: Zarg

Re: RPi Cam Web Interface

Thu Jul 17, 2014 5:00 pm

Just setting the basics of the RPi Cam Interface up on a new B+ board and sadly the freezing problem persists!

So I tried the recomended firmware from the wiki http://elinux.org/RPi-Cam-Web-Interface

Code: Select all

sudo rpi-update 8660fe5152f6353dec61422808835dbcb49fc8b2
Sadly this does not seem to work with the new B+ board :?

Sugestions welcome, nay, desperatly needed...
As humans we have been the same for a very very long time, technology changes how we do... not who we are as people.

6by9
Raspberry Pi Engineer & Forum Moderator
Raspberry Pi Engineer & Forum Moderator
Posts: 9310
Joined: Wed Dec 04, 2013 11:27 am
Location: ZZ9 Plural Z Alpha, aka just outside Cambridge.

Re: RPi Cam Web Interface

Thu Jul 17, 2014 5:18 pm

Mettauk wrote:Just setting the basics of the RPi Cam Interface up on a new B+ board and sadly the freezing problem persists!

So I tried the recomended firmware from the wiki http://elinux.org/RPi-Cam-Web-Interface

Code: Select all

sudo rpi-update 8660fe5152f6353dec61422808835dbcb49fc8b2
Sadly this does not seem to work with the new B+ board :?

Sugestions welcome, nay, desperatly needed...
Help us then!
I have tried reproducing issues following instructions from BoehserWolf on http://www.raspberrypi.org/forums/viewt ... 43&t=80463 and I end up with glibc reporting memory corruption (it may be a hardware issue, but I haven't had any other issues on this board). If I can't get a working system to reproduce the issue on, then I can't take it forward and investigate.

If you have a known working image on 8660fe that then fails on top of tree then please share that with us (and I do mean a copy of the entire image). Image the SD card, zip it up, and stuff it somewhere accessible (preferably not dropbox as our IT department block access to it)

NB I do NOT normally follow this thread as there are too many app install help requests pinging around. I am following the other thread, so please respond there.
Software Engineer at Raspberry Pi Trading. Views expressed are still personal views.
I'm not interested in doing contracts for bespoke functionality - please don't ask.

0lly
Posts: 77
Joined: Sun Mar 02, 2014 5:07 pm

Re: RPi Cam Web Interface

Fri Jul 18, 2014 8:03 am

Mettauk wrote: So I tried the recomended firmware from the wiki http://elinux.org/RPi-Cam-Web-Interface

Code: Select all

sudo rpi-update 8660fe5152f6353dec61422808835dbcb49fc8b2
Sadly this does not seem to work with the new B+ board :?
Test this way http://www.raspberrypi.org/forums/viewt ... 55#p561155

noctividus
Posts: 4
Joined: Fri Jun 06, 2014 7:47 pm

Re: RPi Cam Web Interface

Fri Jul 18, 2014 6:05 pm

In response to my issue regarding the server going down:

I initially thought it might be variable over-run or something, however it turned out to be a Wifi dongle problem. It's important to note if you're using this as a wifi ip camera:

The Raspberry Pi's onboard USB isn't very good at sourcing current. I thought I could get away with just a headless box and wifi dongle, but I was wrong. Probably a good idea to have a powered usb hub for any wireless work.

Return to “Camera board”