marcel151
Posts: 4
Joined: Sun Jul 23, 2017 11:54 pm

Re: RPi Cam Web Interface

Tue Nov 26, 2019 10:21 am

Hello,
is there a way to set the standard sort order to "descending"? Everytime I open the "Download Videos and Images" in a new browser, it sorts ascending.

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

Re: RPi Cam Web Interface RECORD VIDEO START

Thu Nov 28, 2019 8:32 am

CharlyDelta wrote:
Sun Nov 24, 2019 4:16 pm
Is it possible to start video record with a command in terminal mode ??
I'm not sure what you're after - if you want to start a recording from the command line you can do it with:

Code: Select all

echo ca 1 > FIFO11
You'll also have to stop it in some appropriate way, of course.

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

Re: RPi Cam Web Interface

Thu Nov 28, 2019 9:02 am

marcel151 wrote:
Tue Nov 26, 2019 10:21 am
is there a way to set the standard sort order to "descending"? Everytime I open the "Download Videos and Images" in a new browser, it sorts ascending.
When I set the order to Descending it stays that way ... if I close my browser and later reboot and open the browser again, it says Descending. Does it not do this for you?
Last edited by ras07 on Fri Nov 29, 2019 6:24 am, edited 1 time in total.

woody565
Posts: 8
Joined: Thu Jul 11, 2019 4:48 pm

Re: RPi Cam Web Interface

Thu Nov 28, 2019 1:00 pm

Hi, I am running this software on a RPi Zero, the stream is fantastic but is it possible to also display the live preview in 1080 or 720 at the same time through the HDMI port?

Thanks

Dan

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

Re: RPi Cam Web Interface

Fri Nov 29, 2019 6:29 am

woody565 wrote:
Thu Nov 28, 2019 1:00 pm
Hi, I am running this software on a RPi Zero, the stream is fantastic but is it possible to also display the live preview in 1080 or 720 at the same time through the HDMI port?
You can't send the stream directly to the HDMI port. Workaround is to install a desktop environment, open up a browser, and run it full-screen.

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

Re: RPi Cam Web Interface

Sat Dec 07, 2019 8:34 pm

I want to make a small change to raspimjpeg's tiimelapse feature.

Where is the most recent source for RaspiMJPEG.c ?

The one in silvanmelchior's archived userland at github is out of date and doesn't support the anno3_ options.

(This has been asked before, e.g. by placidchat on this forum, but I could not find an answer.)

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

Re: RPi Cam Web Interface

Sat Dec 07, 2019 8:47 pm

Found it...
the latest RaspiMJPEG source file seems to live here:
https://github.com/roberttidey/userland ... spiMJPEG.c

AussieSusan
Posts: 36
Joined: Tue Aug 28, 2012 10:48 pm

Re: RPi Cam Web Interface

Mon Dec 09, 2019 1:52 am

(There are so many entries in this thread! Almost needs a Wiki or something of its own. Searched but could not find the answer - sorry if it is buried somewhere.)
I want to run my RPi Zero W with a read-only SD card (or as near as I can to that - I have another where the logs are written to memory disk and just about everything else to a NFS NAS drive) and so I looked at the documentation section 3.4.1 "How do I change the path for video images and pictures" and that suggested a bind mount. However a bind mount still updates the files on the original location (just providing a duplicate on a second mount point).
So I thought I would set up a mount point to /var/www so that the 'html' (and any other folders) would be created on the NAS rather than the SD card. However that failed to work with lots or errors about not being able to create PIPEs.
So, other than doing what the documentation does not recommend (as it will be over-written every time I upgrade; and presumably because I will need to change a number of other references), is there a way to set up this software so that it will not be writing to the SD card all the time?
And if I do need to alter the configuration file paths, is there any documentation about the 'right' way to do this?
Susan

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

Re: RPi Cam Web Interface

Fri Dec 13, 2019 10:14 pm

AussieSusan wrote:
Mon Dec 09, 2019 1:52 am
I looked at the documentation section 3.4.1 "How do I change the path for video images and pictures" and that suggested a bind mount. However a bind mount still updates the files on the original location (just providing a duplicate on a second mount point).
So I thought I would set up a mount point to /var/www so that the 'html' (and any other folders) would be created on the NAS rather than the SD card. However that failed to work with lots or errors about not being able to create PIPEs.
I don't think the doc means to use mount --bind; just mount your r/w NFS share it normally like you did, only mount it to /var/www/html/media instead of /var/www/html .

I have this in my /etc/fstab (writes to a Windows share):

Code: Select all

//192.168.1.11/cams/cam1 /var/www/html/media/ cifs vers=3,credentials=/root/.cifs,iocharset=utf8,rw,file_mode=0777,dir_mode=0777,uid=www-data,gid=www-data 0 0

AussieSusan
Posts: 36
Joined: Tue Aug 28, 2012 10:48 pm

Re: RPi Cam Web Interface

Mon Dec 16, 2019 1:55 am

Thanks @ras07.
I'l give that a shot shortly (last week before my 2-week Christmas break - I just hope I have the time to get back to this then).
Susan

User avatar
Sir_Charles82
Posts: 3
Joined: Mon Oct 21, 2019 10:53 am
Location: Vienna

Re: RPi Cam Web Interface

Mon Dec 16, 2019 6:14 pm

just a short reply: starting all over again with the most recent raspbian lite buster and not using sudo while starting install.sh solved the issue.

Thanks for the hint

nospam
Posts: 56
Joined: Sun Jun 14, 2015 10:38 pm

Re: RPi Cam Web Interface

Tue Dec 17, 2019 12:58 pm

Is there a way to restart the camera process from the CLI after it has crashed WITHOUT rebooting?

Example: camera freezes and motion no longer works. Have to reboot pi to get camera restarted. Using the shell scripts to start and stop doesn't work. What processes and locks are needing to be killed to restart the camera without a hard reboot?

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

Re: RPi Cam Web Interface

Tue Dec 17, 2019 10:40 pm

Sir_Charles82 wrote:
Mon Dec 16, 2019 6:14 pm
just a short reply: starting all over again with the most recent raspbian lite buster and not using sudo while starting install.sh solved the issue.

Thanks for the hint
Glad it's working! I'm not sure why sudo messes it up, but it's easy to trip over - I'll open a Github issue to either fix the problem or else at least warn the user.

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

Re: RPi Cam Web Interface

Tue Dec 17, 2019 11:01 pm

nospam wrote:
Tue Dec 17, 2019 12:58 pm
Is there a way to restart the camera process from the CLI after it has crashed WITHOUT rebooting?
if start.sh doesn't restart it, I don't know if there's a way to do it without rebooting.

Do you know why it's crashing in the first place? I've got systems that run for weeks/months with no intervention. (I've also had systems where the camera crashed a lot, but this invariably came down to power issues - marginal power can definitely crash the camera without crashing the whole OS.)

itsmedoofer
Posts: 362
Joined: Wed Sep 25, 2013 8:43 am

Re: RPi Cam Web Interface

Fri Dec 20, 2019 12:36 pm

I've had minimal issues running this on my ZeroW, I think I was over 90 days uptime when I had to shutdown because of moving house this earlier month.

Like Ras07 said, marginal power can cause issues that are not immediately apparent, especially if you are running headless, when I fired up after moving I was using the wrong PSU, the PI booted OK but couldn't get an image...

I did have some thermal related issues this year, I had my zero running in a shed window, in the sun the poor thing was over 80C, the regular thermal cycling seemed to effect the ribbon connectors, I would start to see lockups or strange artifacts in the image after a week or so, removing the ribbon, cleaning and re-assembling fixed these...

Maybe looking at the TOP output would give you a clue as to what has stalled...

nospam
Posts: 56
Joined: Sun Jun 14, 2015 10:38 pm

Re: RPi Cam Web Interface

Fri Dec 20, 2019 6:44 pm

ras07 wrote:
Tue Dec 17, 2019 11:01 pm
nospam wrote:
Tue Dec 17, 2019 12:58 pm
Is there a way to restart the camera process from the CLI after it has crashed WITHOUT rebooting?
if start.sh doesn't restart it, I don't know if there's a way to do it without rebooting.

Do you know why it's crashing in the first place? I've got systems that run for weeks/months with no intervention. (I've also had systems where the camera crashed a lot, but this invariably came down to power issues - marginal power can definitely crash the camera without crashing the whole OS.)
I've given up trying to debug why all my cameras will crash regularly regardless of power supply, OS version, software version, board version, etc., and the logs aren't helpful. Example

{2019/12/20 11:46:36} Capturing stopped
{2019/12/20 11:46:36} Add /var/www/media/vi_0016_20191220_114619.mp4 to Box Queue at pos 16
{2019/12/20 11:46:39} send smd 1
[2019/12/20 11:46:48] Start capture requested from Pipe
[2019/12/20 11:46:48] Send ca 1
{2019/12/20 11:46:56} Capturing started
{2019/12/20 11:47:06} Finished boxing /var/www/media/vi_0015_20191220_114514.mp4 from Box Queue at pos 15
{2019/12/20 11:47:06} Start boxing /var/www/media/vi_0016_20191220_114619.h264 to /var/www/media/vi_0016_20191220_114619.mp4 Queue pos 16
{2019/12/20 11:47:06} Removed item from Box Queue
{2019/12/20 11:47:24} Watchdog detected problem. Stopping{2019/12/20 11:47:34} SIGINT/SIGTERM received, stopping

That's it. I've tweaked power settings, regularly reboot, clear temp files, faster SD cards, faster CPU's, etc. What I've concluded is that there is an I/O issue writing the files. When there is a lot of motion events on the camera one after another, the cameras crash. The devices I have running on USB SSD drives crash less than the ones on SD cards.

My cameras with outdoor scenes on sunny and windy days where leaves and shadows are constantly moving crash regularly. Cameras with indoor views or static scenes crash less often. I know a crash is imminent then videos start showing "Busy" on the file size in the Downloads menu.

The two biggest issues with the RPi hardware are flaky power issues and using SD cards as the primary storage for the OS. If power is such an issue then the hardware designers need to brush up on what they are doing and fix it...I use other embedded devices and RPi's are the only devices to have these kinds of power issues. m2.SATA cards are now cheaper than good quality SD cards with better read/write speeds and superior read write cycles. I wish they would fix these two things to make these devices more reliable than adding second HDMI slots. I run my RPi's headless. If the intention is to make desktop replacements with dual HDMI then fix the power and storage issues first.

robotics
Posts: 15
Joined: Fri Mar 22, 2019 9:29 pm

buster default install works wih apache but not with nginx

Sat Dec 21, 2019 7:38 pm

I created two identical SDs with Buster for a RPI 3B.

To minimize complications I went with all the defaults.

The install with apache as the server went perfect. I was then able to modify port and add user/password. Still okay

The install with nginx did not work. When I run systemctl status nginx.service I see the following:
Active: failed (Result: exit-code) since Sat 2019-12-21 10:58:57 PST; 9min ago
Docs: man:nginx(8)
Process: 8913 ExecStartPre=/usr/sbin/nginx -t -q -g daemon on; master_process on; (code=exited, status=1/FAILU

Dec 21 10:58:57 raspberry1 systemd[1]: Starting A high performance web server and a reverse proxy server...
Dec 21 10:58:57 raspberry1 nginx[8913]: nginx: [emerg] open() "/etc/nginx/sites-enabled/default" failed (2: No s
Dec 21 10:58:57 raspberry1 nginx[8913]: nginx: configuration file /etc/nginx/nginx.conf test failed
Dec 21 10:58:57 raspberry1 systemd[1]: nginx.service: Control process exited, code=exited, status=1/FAILURE
Dec 21 10:58:57 raspberry1 systemd[1]: nginx.service: Failed with result 'exit-code'.


pi@raspberry1:/etc/nginx $ cd sites-enabled
pi@raspberry1:/etc/nginx/sites-enabled $ ls -l
total 0
lrwxrwxrwx 1 root root 34 Dec 21 10:57 default -> /etc/nginx/sites-available/default
lrwxrwxrwx 1 root root 33 Dec 21 10:58 rpicam -> /etc/nginx/sites-available/rpicam

pi@raspberry1:/etc/nginx/sites-enabled $ cd ../sites-available
pi@raspberry1:/etc/nginx/sites-available $ ls -l
total 4
-rw-r--r-- 1 pi pi 755 Dec 21 11:40 rpicam

Arnav.Sharma
Posts: 1
Joined: Sun Dec 22, 2019 11:17 am

Re: RPi Cam Web Interface

Sun Dec 22, 2019 11:22 am

How can I put a password on my RPi_Cam_Web_Interface?

robotics
Posts: 15
Joined: Fri Mar 22, 2019 9:29 pm

Re: RPi Cam Web Interface

Sun Dec 22, 2019 2:58 pm

You could just run ./install.sh again and put in new password.

AdrianM
Posts: 25
Joined: Sun Mar 27, 2016 12:50 pm

Re: RPi Cam Web Interface

Thu Dec 26, 2019 3:39 pm

BradZed wrote:
Tue Oct 08, 2019 12:52 am
Sryously wrote:
Tue Sep 24, 2019 2:44 pm
ras07 wrote:
Tue Sep 24, 2019 6:04 am

Apache defaults should work fine. Check the connections. I've had very sporadic weird stuff happen with flaky camera cable connections.
Shoot, it was working fine for over an hour last night disconnecting and reconnecting the camera cable! Then I stopped the camera on the web interface. This morning I enable camera and again it works, but for 5 minutes, then nothing. Unplug power and reconnect, works again. Play with picture settings and stuff for like an hour, see how bright I can get the picture and then...I turn on the lights and it's gone again? Did turning on the lights make it do that or just coincidence? LOL I'm using a 2.5Amp power adapter, I have a heatsink on the Zero W. One thing I was noticing, I mentioned I had tried MotionEye before, the address ended with /admin/ instead of /html/ but both still work?

Edit: Forget I mentioned traces of MotionEye seeming to be left over after 3 formats, I think it was Android loading showing a page that wasn't there.
Mate, I've been banging my head against a brick wall for the past two weeks with this zero wh I bought to do the exact same thing you are, and with the same results.

The bottom line is that sooner or later, usually sooner, when recording video with raspivid, something is causing the BCM2835 driver to crash, and given this controls a bunch of important stuff around memory, interrupts and even the USB stack, it being hosed either totally locks up the system, or even more weirdly for me leaves things completely inconsistent.

What I did, after reading through the following thread, is void my warranty and over voltage the unit (over_voltage=4 and force_turbo=1 to /boot/config.txt) and having done that, I've now been running RPi Cam Control and MotionEye without issue for a couple of days.

The thread I got this info: https://www.raspberrypi.org/forums/view ... 4AtKmxIqmc

The more important question for me is whether:

a) a small bunch of units are not quite fabbing up to spec and exhibit issues, possibly with power supply which we know is a sensitive issue with these Pi given overvoltaging seems to help in many cases

b) all Pi 0 have the issue and many/most just move on when it doesn't work and implement a different solution, or perhaps, there's just not that many people using Pi 0's for security camera functionality

c) It's an issue distinct to the Raspbian Jessie/Buster releases, and MotionEye, which uses BuildRoot to build the base operating system

I'd love to investigate this further and try and find an answer, at this point I consider the 0w unsuitable for camera duty, and have purchased several 3a's, as my 3B setup worked for years without so much as a keystroke of attention in the exact same setup.

I also feel the need to bump this problem/solution as I too participated in this topic back in August 2018. Ever since then my Pi Zero has been running RPi cam continuously without any problem. This is with over_voltage=2 and force_turbo=1 added to /boot/config.txt

However, just in the last week I replaced the SD card as the old one became corrupt and so I built it all up from scratch again and, forgetting about the over-voltage stuff, RPi cam would soon lock-up after a random interval. As soon as I remembered what I had to do to fix it, it's been working just fine again.

On another issue, I have been trying to get a script to send notifications to Pushover like I used to have (pity I didn't backup the old SD card!). I have had success with simple messages but when I try attaching a still image of cam.jpg I run into trouble. I'm sure I just attached /dev/shm/mjpeg/cam.jpg before but when I do that now the Pushover service responds with the error "Bad request".

However, if I manually copy the cam.jpg file to another directory e.g. cp /dev/shm/mjpeg/cam.jpg /var/www/html/media/cam.jpg then attach that, it works a treat. But if I try putting the cp in the script like this:

Code: Select all

#!/bin/bash
#On motion detection start (parameter is 1 for on, 0 for off)
fileparams=$1
if [ $fileparams -eq 1 ]
then
 cp /dev/shm/mjpeg/cam.jpg /var/www/html/media/cam.jpg
 curl -s \
  -H 'expect:' \
  --form-string "token=xxxxxxxxxxxxxxxxxxxxxxxxxxxxxx" \
  --form-string "user=xxxxxxxxxxxxxxxxxxxxxxxxxxxxx" \
  --form-string "sound=pushover" \
  --form-string "priority=1" \
  --form-string "html=1" \
  --form-string "message=<a href='http://192.168.1.114/html/cam_pic_new.php?pDelay=100000'>Front door</a>" \
  -F "attachment=@/var/www/html/media/cam.jpg" \
  https://api.pushover.net/1/messages.json > /dev/null 2>&1
fi
It fails to work. Only the last manually copied image shows in the notification so I think it has to do with permissions that prevail when RPicam executes the script. I have tried giving motion_event.sh full R/W permission (777) but that doesn't help. I'm still trying to understand permissions - but I get tied in knots. I've seen plenty of example scripts similar to my own and some seem to cp files without any issues. Anyone see what the problem is?

EDIT of course when I manually copied the cam.jpg it was owned by root so the script couldn't write to it. Changing owner to www-data has solved the issue. Still no idea why attaching the cam.jpg file in its original /dev/shm/mjpeg/ folder doesn't work. Maybe the file isn't accessible during the beginning of the event?

Uskompuf
Posts: 64
Joined: Mon Jan 26, 2015 6:50 am

Re: RPi Cam Web Interface

Thu Jan 02, 2020 2:30 pm

I have a few questions and I was wondering if anyone could point me in the right direction.

I have setup a pi zero W and V1 camera with RPI cam web interface and it's running at 972p 25fps, this seems stable without motion detection.

I wish to view this stream in other applications are full quality, currently I'm using mjpeg stream but that doesn't seem to send full quality image only the preview quality.

So my question is how can I send full quality video from the pi to vlc or similar or if possible directly to youtube. Does YouTube accept a stream in the default camera output?

Thanks

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

Re: RPi Cam Web Interface

Thu Jan 02, 2020 7:45 pm

Uskompuf wrote:
Thu Jan 02, 2020 2:30 pm
I have setup a pi zero W and V1 camera with RPI cam web interface and it's running at 972p 25fps, this seems stable without motion detection.

I wish to view this stream in other applications are full quality, currently I'm using mjpeg stream but that doesn't seem to send full quality image only the preview quality.

So my question is how can I send full quality video from the pi to vlc or similar or if possible directly to youtube. Does YouTube accept a stream in the default camera output?
You can adjust the stream resolution with the Preview quality settings in Camera Settings. To match the 972p you would set the width to 1296. You can also adjust the compression level with the Quality setting. The Divider setting controls the frame rate (so if you set it to 2, your frame rate would be about 12.5 fps). Note that you can chew up a LOT of bandwidth this way - you can very easily saturate your Zero W's wifi bandwidth.

I don't know how to stream it to Youtube - if you figure it out, report back!

ras

CharlyDelta
Posts: 127
Joined: Thu Jul 18, 2013 4:04 am
Location: Montreal
Contact: Facebook

Re: RPi Cam Web Interface annotation from MLX90614

Wed Jan 15, 2020 9:16 pm

Hello.
Now, I want to show both temperature ( env. temp and object temp ) in camera window.


Here is the code:

Code: Select all

 
import smbus
 
class MLX90614():
 
    MLX90614_RAWIR1=0x04
    MLX90614_RAWIR2=0x05
    MLX90614_TA=0x06
    MLX90614_TOBJ1=0x07
    MLX90614_TOBJ2=0x08
 
    MLX90614_TOMAX=0x20
    MLX90614_TOMIN=0x21
    MLX90614_PWMCTRL=0x22
    MLX90614_TARANGE=0x23
    MLX90614_EMISS=0x24
    MLX90614_CONFIG=0x25
    MLX90614_ADDR=0x0E
    MLX90614_ID1=0x3C
    MLX90614_ID2=0x3D
    MLX90614_ID3=0x3E
    MLX90614_ID4=0x3F
 
    def __init__(self, address=0x5a, bus_num=1):
        self.bus_num = bus_num
        self.address = address
        self.bus = smbus.SMBus(bus=bus_num)
 
    def read_reg(self, reg_addr):
        return self.bus.read_word_data(self.address, reg_addr)
 
    def data_to_temp(self, data):
        temp = (data*0.02) - 273.15
        return temp
 
    def get_amb_temp(self):
        data = self.read_reg(self.MLX90614_TA)
        return self.data_to_temp(data)
 
    def get_obj_temp(self):
        data = self.read_reg(self.MLX90614_TOBJ1)
        return self.data_to_temp(data)
 
if __name__ == "__main__":
    sensor = MLX90614()
    print(sensor.get_amb_temp())
    print(sensor.get_obj_temp())
    annotate = open("/dev/shm/mjpeg/user_annotate.txt", 'w')
    annotate.write (temp = '(data*0.02) - 273.15)')
    annotate.close()
This code generate this error:

21.11
21.27
Traceback (most recent call last):
File "tempir.py", line 48, in <module>
annotate.write (temp = '(data*0.02) - 273.15)')
TypeError: write() takes no keyword arguments

Any idea why I can't get the temperature printed in the window ? I tried lot of combinations without success but I think I'm close to getting there, but I need a push now.

Thank you for your help.

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

Re: RPi Cam Web Interface annotation from MLX90614

Thu Jan 16, 2020 4:30 am

CharlyDelta wrote:
Wed Jan 15, 2020 9:16 pm
Traceback (most recent call last):
File "tempir.py", line 48, in <module>
annotate.write (temp = '(data*0.02) - 273.15)')
Your string formatting isn't right in the annotate.write command. Try something like:

Code: Select all

annotate.write ('temp = {}'.format((data*0.02) - 273.15))

CharlyDelta
Posts: 127
Joined: Thu Jul 18, 2013 4:04 am
Location: Montreal
Contact: Facebook

Re: RPi Cam Web Interface

Thu Jan 16, 2020 11:56 am

Thank you, ras07 but unfortunately it's not working. Here's the generated error code:

sudo python tempir.py
18.41
18.49
Traceback (most recent call last):
File "tempir.py", line 48, in <module>
annotate.write ('temp = {}'.format((data*0.02) - 273.15))
NameError: name 'data' is not defined


I'm trying a few other alternatives but it's not my specialty.

If you have any other suggestions, it's appreciated!

Return to “Camera board”