Page 198 of 203

Re: RPi Cam Web Interface

Posted: Fri Apr 19, 2019 10:27 am
by Florisjan
This is a crosspost from github issues, it's rather urgent so I hope you don't mind.

I upgraded to stretch Linux thepi 4.14.98-v7+ #1200 SMP Tue Feb 12 20:27:48 GMT 2019 armv7l GNU/Linux. Using lighttpd

Now the video stream is gone.

Did apt-get install php7.0, removed rpi cam control and installed latest again. The interface works, it is not responsive though.

Update: I was helped on github and it is very likely that my camera is broken.

Re: RPi Cam Web Interface

Posted: Sun Apr 28, 2019 4:36 am
by shahonseven
Hi,

I don't understand how to use the scheduler, I want to record when motion is detected at 10pm - 12am on monday & tuesday, and another at 5am - 7 am, tuesday & wednesday..

thanks

Re: RPi Cam Web Interface

Posted: Mon Apr 29, 2019 4:11 am
by ras07
shahonseven wrote:
Sun Apr 28, 2019 4:36 am
I don't understand how to use the scheduler, I want to record when motion is detected at 10pm - 12am on monday & tuesday, and another at 5am - 7 am, tuesday & wednesday..
Click on Edit Schedule Settings. Switch the Select Mode selection box to Fixed Times. Enter the times you want, then enter CA 1 for Motion Start, CA 0 for Motion Stop, and MD 1 for Period Start. Be sure to hit Save Settings when you're done. Your schedule should end up something like this:
Capture1.PNG
Capture1.PNG (23.2 KiB) Viewed 4219 times

Re: RPi Cam Web Interface

Posted: Mon Apr 29, 2019 9:34 am
by Svetlin
ras07 wrote:
Thu Apr 11, 2019 6:48 pm
Svetlin wrote:
Thu Apr 11, 2019 7:51 am
Is it possible to start and stop recording from the command line?
You can do many things (including start/stop recording) from the command line by writing to the FIFO queue. For example to start recording: (Note that your directory name may be different depending upon your installation)

Code: Select all

echo 'ca 1' > /var/www/FIFO
And to stop:

Code: Select all

echo 'ca 0' > /var/www/FIFO
While this command will capture 25 seconds of video and then stop:

Code: Select all

echo 'ca 1 25' > /var/www/FIFO
You can see a list of available commands by clicking on the 'Edit schedule settings' button, and then 'Command reference'.
Thank you very much!

Re: RPi Cam Web Interface

Posted: Tue Apr 30, 2019 10:44 am
by shahonseven
ras07 wrote:
Mon Apr 29, 2019 4:11 am
shahonseven wrote:
Sun Apr 28, 2019 4:36 am
I don't understand how to use the scheduler, I want to record when motion is detected at 10pm - 12am on monday & tuesday, and another at 5am - 7 am, tuesday & wednesday..
Click on Edit Schedule Settings. Switch the Select Mode selection box to Fixed Times. Enter the times you want, then enter CA 1 for Motion Start, CA 0 for Motion Stop, and MD 1 for Period Start. Be sure to hit Save Settings when you're done. Your schedule should end up something like this:

Capture1.PNG
thank you, it is working now!

Re: RPi Cam Web Interface

Posted: Fri May 10, 2019 5:25 pm
by snperry85
I have two camera's currently set up. But I'm having issues with one of them stuttering.

Code: Select all

Front Door
RPi 3b
SanDisk Ultra microSDHC UHS1, Class 10, 32GB
RPi 8mp Camera v2
Passive Poe Injectors
Buck Converter - reading 5.1v on GPIO
Ethernet Connection
RPI Cam Web Interface v6.4.50
Resolution 1296 x 972
Blue Iris reports 90+ frame rate, 2138 kb/s bit rate
https://youtu.be/k0m01Fe0JAM 

Code: Select all

Back Porch
RPi Zero v1.3
SanDisk Ultra microSDHC UHS1, Class 10, 32GB
RPi 8mp Camera v2
Passive Poe Injectors
Buck Converter - reading 5.1v on GPIO
MicroUSB Ethernet adapter soldered to the board ( no difference between plugged in and soldered. )
Ethernet Connection
RPI Cam Web Interface v6.4.50
Resolution 1280 x 720
Blue Iris reports 22 frame rate, 632 kb/s bit rate
https://youtu.be/6JfcvsmB7c4
Speed test for the BP camera.

Code: Select all

[email protected]:~ $ speedtest-cli
Retrieving speedtest.net configuration...
Testing from AT&T U-verse (xxx.xxx.xxx.xxx)...
Retrieving speedtest.net server list...
Selecting best server based on ping...
Hosted by AT&T (San Antonio, TX) [28.35 km]: 50.47 ms
Testing download speed..........................................................                                     ......................
Download: 1.86 Mbit/s
Testing upload speed............................................................                                     ....................................
Upload: 4.09 Mbit/s
[email protected]:~ $ speedtest-cli
Retrieving speedtest.net configuration...
Testing from AT&T U-verse (xxx.xxx.xxx.xxx)...
Retrieving speedtest.net server list...
Selecting best server based on ping...
Hosted by VTX 1 (San Antonio, TX) [28.35 km]: 62.445 ms
Testing download speed..........................................................                                     ......................
Download: 3.06 Mbit/s
Testing upload speed................................................................................................
Upload: 6.53 Mbit/s
I have a third camera I've been playing with as well that hasn't presented this problem.

Code: Select all

NoIR
RPi Zero v1.3
SanDisk Ultra microSDHC UHS1, Class 10, 32GB
RPi 8mp NoIR Camera v2
Buck Converter - reading 5.1v on GPIO
USB Wifi Dongle
RPI Cam Web Interface v6.4.50
Resolution 1296 x 972
Blue Iris reports 75 frame rate, 1415 kb/s bit rate

The back porch camera will start out with none or very little perceivable stutter. The stutter gets worse as time progresses. If I go above 720p, it starts stuttering from the start. The stutter is present on the feed when I watch it using the web server, so it is not Blue Iris causing the stutter. Going lower in resolution would not be ideal, as I pretty much need the field of view in the video.

Both camera's are connected by TPLink AV1000 Powerline Adaptors. The adaptors report 300+ mb/s transfer rate between each other.

I have used these as camera's for years. I've used MotionEye and PiKrellCam before this go and they never had any stuttering with the same equipment except I used crappy sd cards then.

I would be greatful for any ideas on how to resolve the stuttering on the pi zero. Thank you.

EDIT: Using an ir thermometer I get a max reading of 113 F in the camera housing. The RPi Zero shows 110F with the buck converter at 107F. That's no where close to the max operating temps.

EDIT2: It seems the biggest difference I can find between the two Pi Zero camera's is the internet connection. The Wifi dongle is testing at 18+ mb/s compared to the ethernet adapter pulling much less with the camera's in the same location. A PS4 on the same switch as the BP camera pulls in 60+ mb/s on its speed test. Might be better to go back to WIFI on the BP camera.

Re: RPi Cam Web Interface

Posted: Fri May 10, 2019 6:19 pm
by ras07
snperry85 wrote:
Fri May 10, 2019 5:25 pm
I have two camera's currently set up. But I'm having issues with one of them stuttering.
If you record a video through RPi CWI and then download it and play it locally, does it still stutter?

Re: RPi Cam Web Interface

Posted: Fri May 10, 2019 6:58 pm
by snperry85
ras07 wrote:
Fri May 10, 2019 6:19 pm
snperry85 wrote:
Fri May 10, 2019 5:25 pm
I have two camera's currently set up. But I'm having issues with one of them stuttering.
If you record a video through RPi CWI and then download it and play it locally, does it still stutter?
I was hoping it wouldn't and my solution would be to go back to wifi on this camera. Alas, I get stutter the same when downloading and playing in VLC.


EDIT: The video stutters when I play the .h264 I downloaded in VLC. But the stutter disappears when Youtube processes the video or when uploaded to google drive and played from there. If I download the video uploaded to google drive and play in VLC, the stutter is back. .. I'm super freaking lost now.

https://youtu.be/JANYmzCyLM4

testvid.h264 download
https://drive.google.com/open?id=1Lgw0R ... kexZijLIlW

Re: RPi Cam Web Interface

Posted: Sat May 11, 2019 12:23 am
by ras07
[/quote]
If you record a video through RPi CWI and then download it and play it locally, does it still stutter?
[/quote]

I was hoping it wouldn't and my solution would be to go back to wifi on this camera. Alas, I get stutter the same when downloading and playing in VLC.

EDIT: The video stutters when I play the .h264 I downloaded in VLC. But the stutter disappears when Youtube processes the video or when uploaded to google drive and played from there. If I download the video uploaded to google drive and play in VLC, the stutter is back. .. I'm super freaking lost now.

https://youtu.be/JANYmzCyLM4

testvid.h264 download
https://drive.google.com/open?id=1Lgw0R ... kexZijLIlW
[/quote]

That is very strange.

I'm at a complete loss as well ... if it was me I think I'd re-image the Pi's SD card and start over. (Which is sure frustrating when you have things set up the way you want them, but I really don't have any other ideas.)

Re: RPi Cam Web Interface

Posted: Sun May 12, 2019 1:45 pm
by Manisch
Hi there,

can someone help me and once again dumb down how to embed the live stream to my homepage (Wordpress)? :D

So I uploaded two files:

1. named "min.php" with the content:

Code: Select all

<!DOCTYPE html>
<html>
  <head>
    <title>RPi Cam Preview</title>
    <script src="script_min.js"></script>
  </head>
  <body onload="setTimeout('init();', 100);">
    <center>
      <div><img id="mjpeg_dest" /></div>
    </center>
 </body>
</html>
2. named "script_min.js"

Code: Select all

var mjpeg_img;
 
function reload_img () {
  mjpeg_img.src = "cam_pic.php?time=" + new Date().getTime();
}
function error_img () {
  setTimeout("mjpeg_img.src = 'cam_pic.php?time=' + new Date().getTime();", 100);
}
function init() {
  mjpeg_img = document.getElementById("mjpeg_dest");
  mjpeg_img.onload = reload_img;
  mjpeg_img.onerror = error_img;
  reload_img();
}
- Where exactly do I add the IP to my webcam?
- which code do I embed in the actual page/position, where I want to place the stream?

Besides that:
My Camera is "rebooting" quite often. Has anyone had similar issues?
It's a Joy iT Cam for Raspberry Pi.

Re: RPi Cam Web Interface

Posted: Sun May 12, 2019 5:56 pm
by snperry85
Thanks for the suggestion. I've physically rebuilt this thing 4 times atleast. Bought a bunch of new sd cards to replace them in all my pi's. I ended up reinstalling another service because I have a trip coming up.

Going to do more trouble shooting when I get back. One thing I'll try is to do a fresh install without any updates (I may have been screwing myself by always updating the firmware).

It could be something to do with the mp4 boxing mode. Maybe I was unknowingly affecting the settings. I have no idea what it is but another program says "video_mp4box_fps - keep this value set to zero unless you want to create fast or slow motion videos. When zero, mp4 boxing fps will be the same as video_fps which is normally what you want. But this value can be set to a non zero value different from video_fps if you want fast or slow motion videos." Which the video could kind of be described as going from fast to slow motion in a loop.

ras07 wrote:
Sat May 11, 2019 12:23 am

That is very strange.

I'm at a complete loss as well ... if it was me I think I'd re-image the Pi's SD card and start over. (Which is sure frustrating when you have things set up the way you want them, but I really don't have any other ideas.)

Re: RPi Cam Web Interface - mp4 file not found

Posted: Sun May 19, 2019 10:19 pm
by karmicjay_z
Sorry, newbie here.. I apologize for any mistakes. Appreciate any help, suggestions. Thanks
I installed the RPI Cam web interface on the latest version of Raspbian. Everything is working fine except when I try to click on the thumbnail to preview a recorded video. I get a message..
The requested URL /html/media/vi_xxxxxxxxxxxx.mp4 was not found on this server
I checked in the /var/www/html folder and it does have the media folder with all the recorded files.
I am guessing there is an incorrect mapping in the configuration?
I used the defaults, so I am not sure what I might have done wrong. :-(

Re: RPi Cam Web Interface

Posted: Wed May 22, 2019 7:29 pm
by CharlyDelta
Hello...

What does not work in these settings. I want the new records to delete the old ones when the card (16GB) is full.

Thank you for your help


https://servimg.com/view/19470218/2

Image

Re: RPi Cam Web Interface - mp4 file not found

Posted: Fri May 24, 2019 7:24 am
by ras07
karmicjay_z wrote:
Sun May 19, 2019 10:19 pm
Everything is working fine except when I try to click on the thumbnail to preview a recorded video. I get a message..
The requested URL /html/media/vi_xxxxxxxxxxxx.mp4 was not found on this server
I checked in the /var/www/html folder and it does have the media folder with all the recorded files.
Sounds like it might be an ownership/permissions problem. By default the files should be owned by www-data, which is also the owner of the Apache process.(ls -l will show you the file owner, and ps aux will display all the running processes - you should have a bunch called /usr/sbin/apache2 -k start owned by www-data).

Re: RPi Cam Web Interface

Posted: Fri May 24, 2019 7:42 am
by ras07
CharlyDelta wrote:
Wed May 22, 2019 7:29 pm
I want the new records to delete the old ones when the card (16GB) is full.
https://servimg.com/view/19470218/2
Image
It looks like you have it set to delete files when they reach 80 GB, which is bigger than your card. If you want to delete old files when the card reaches 80% full, set PurgeSpace_ModeEx to Min Space % and set PurgeSpace_Level to 20.

Re: RPi Cam Web Interface

Posted: Fri May 24, 2019 11:02 am
by CharlyDelta
Thanks, I'll change these settings.

Re: RPi Cam Web Interface

Posted: Thu May 30, 2019 4:47 pm
by solarsamuel
btidey and yozza,

Thank you for the excellent info.

I'm looking to blink an LED. The python file is called "blink.py" and is in the macros folder with proper permissions. It works fine when I run the following in the terminal: python blink.py

Is it possible to directly activate blink.py instead of go through a shell script? How does one go about this? Also, can you please provide the gpio.sh code from the previous posts?

I've tried the line below, but it doesn't work. Permissions should be all set.

Replaced onclick="send_cmd('sy gpio.sh')" with onclick="send_cmd('sy blink.py')". Does it need to be "sy python blink.py"?

Code's below and here's a link: https://www.tunnelsup.com/raspberry-pi- ... gpio-pins/

from gpiozero import LED
from time import sleep

led = LED(17) # Choose the correct pin number

while True:
led.on()
sleep(1)
led.off()
sleep(1)

Best Regards,
Sam

Re: RPi Cam Web Interface

Posted: Tue Jun 04, 2019 7:43 pm
by solarsamuel
Hello,

I think I'm having an issue similar to Yozza, but I think all the permissions are correct. Implementing on a raspberry pi zero w.

I don't specifically need to call the macro gpio.sh, right? I'm calling it button1.sh

button1.sh runs fine in terminal and I get my LED to blink. button1.sh code is below, referenced from here: https://elinux.org/RPi_GPIO_Code_Samples#Shell

I'm trying to get it to execute with button1 press in the GUI, but it's not working. I tried echo 'test' >> macrotest.txt with the command line and it worked, but not with the GUI button press.

File setup:

/www/var/html contains the userbuttons file, which references button1.sh

/www/var/html contains index.php. Changed line 59 to sy button1.sh

Used ls -l to see the permissions of the files and folders. Screenshots attached.
macros.JPG
macros.JPG (46.14 KiB) Viewed 3078 times
html.JPG
html.JPG (63.96 KiB) Viewed 3078 times

button1.sh code below. Turns the LED on for 1 second, then off.

#!/bin/sh

# GPIO numbers should be from this list
# 0, 1, 4, 7, 8, 9, 10, 11, 14, 15, 17, 18, 21, 22, 23, 24, 25

# Set up GPIO 17 and set to output
echo "17" > /sys/class/gpio/export
sleep 1
echo "out" > /sys/class/gpio/gpio17/direction

# Write output
echo "1" > /sys/class/gpio/gpio17/value

# Clean up
sleep 1
echo "17" > /sys/class/gpio/unexport

Can anyone help me out with this?

Re: RPi Cam Web Interface

Posted: Tue Jun 04, 2019 9:01 pm
by ras07
solarsamuel wrote:
Tue Jun 04, 2019 7:43 pm
I think I'm having an issue similar to Yozza, but I think all the permissions are correct. Implementing on a raspberry pi zero w.
...
I'm trying to get it to execute with button1 press in the GUI, but it's not working. I tried echo 'test' >> macrotest.txt with the command line and it worked, but not with the GUI button press.
I don't see anything obviously wrong with the permissions, but to rule out any issues, you can

Code: Select all

sudo su www-data
and make sure you can run the scripts from there.

Assuming that doesn't reveal any problems, can you post the contents of your userbuttons file?

Re: RPi Cam Web Interface

Posted: Sat Jun 08, 2019 6:27 pm
by Mettauk
Adding buttons to switch a GPIO pin (High/Low)

It works fine via the command line as either direct

Code: Select all

./IR_ON.sh
or

Code: Select all

python ir_cut_ON.py
but I cannot get the web interface buttons to do anything.
Within the interface there is an option to add up to six "userbuttons" and run sh macros.

I've done this as

Code: Select all

#User buttons definitions
#maximum of six buttons
#button name,macro,button styles,other attributes
IR On,IR_ON.sh,btn btn-warning btn-sm,style="width:10%" autofocus
IR Off,IR_OFF.sh,btn btn-warning btn-sm,style="width:10%" autofocus
Then added two shell scripts.
IR_ON.sh

Code: Select all

#!/usr/bin/env bash
#echo "This is the bash script" &&
sudo /usr/bin/python /var/www/html/ir_cut_ON.py
The python script is

Code: Select all

#!/usr/bin/env python
#IR cut filter switch ON
import RPi.GPIO as GPIO
import time
GPIO.setmode(GPIO.BCM)
GPIO.setwarnings(False)
GPIO.setup(23,GPIO.OUT)
#print "IR cut on"
time.sleep(1)
GPIO.output(23,GPIO.HIGH)
All files have been assigned to www-data with rwxr-xr-x

I can't get this working. Anyone see an obvious error?

Re: RPi Cam Web Interface

Posted: Sat Jun 08, 2019 6:46 pm
by ras07
Mettauk wrote:
Sat Jun 08, 2019 6:27 pm
Adding buttons to switch a GPIO pin (High/Low)

I've done this as

Code: Select all

#User buttons definitions
#maximum of six buttons
#button name,macro,button styles,other attributes
IR On,IR_ON.sh,btn btn-warning btn-sm,style="width:10%" autofocus
IR Off,IR_OFF.sh,btn btn-warning btn-sm,style="width:10%" autofocus
Then added two shell scripts.
IR_ON.sh

Code: Select all

#!/usr/bin/env bash
#echo "This is the bash script" &&
sudo /usr/bin/python /var/www/html/ir_cut_ON.py
...
All files have been assigned to www-data with rwxr-xr-x

I can't get this working. Anyone see an obvious error?
The sudo call may be the problem. The script should execute as user www-data, which by default doesn't have sudo rights (and shouldn't have them, for security reasons).

As long as the perms are right you may be able to just remove the sudo and it might work fine.

If you switch to the www-data user by executing

Code: Select all

sudo su www-data
and then trying all your scripts from there, you can often diagnose various rights/permission problems that aren't evident otherwise.

Re: RPi Cam Web Interface

Posted: Mon Jun 10, 2019 11:16 am
by Mettauk
ras07 wrote:
Sat Jun 08, 2019 6:46 pm
The sudo call may be the problem....

If you switch to the www-data user by executing

Code: Select all

sudo su www-data
and then trying all your scripts from there, you can often diagnose various rights/permission problems that aren't evident otherwise.
Thanks for your help, no luck so far, but I found this error in the Apache2 error log from clicking the two web facing buttons

Code: Select all

[Mon Jun 10 12:08:00.228495 2019] [:error] [pid 374] [client 192.168.1.71:49833] PHP Notice:  Use of undefined constant buttonCount - assumed 'buttonCount' in /var/www/html/index.php on line 49
[Mon Jun 10 12:08:00.229905 2019] [:error] [pid 374] [client 192.168.1.71:49833] PHP Notice:  Use of undefined constant buttonCount - assumed 'buttonCount' in /var/www/html/index.php on line 49
I tried using ww-data to run the scripts via command line and clearly there is a permissions issue as I get

Code: Select all

[email protected]:~/html$ ./IR_ON.sh
Traceback (most recent call last):
  File "/var/www/html/ir_cut_ON.py", line 7, in <module>
    GPIO.setup(23,GPIO.OUT)
RuntimeError: No access to /dev/mem.  Try running as root!
or

Code: Select all

[email protected]:~/html$ ./ir_cut_ON.py
Traceback (most recent call last):
  File "./ir_cut_ON.py", line 7, in <module>
    GPIO.setup(23,GPIO.OUT)
RuntimeError: No access to /dev/mem.  Try running as root!
both throw the same error as No access to /dev/mem/
How do I fix this?

EDIT
FIXED!
I changed the permissions for www-data

Code: Select all

sudo usermod -G gpio www-data
which fixed the problem on command line and the web interface buttons!

Re: RPi Cam Web Interface

Posted: Mon Jun 10, 2019 1:55 pm
by albka1986
How can I get URL of raw MPEG streaming ?
I tried http://192.168.88.240/cam_pic_new.php and http://192.168.88.240/mini.php and http://192.168.88.240/min.php. But these sites return 404 Error.
In web interface I see me video. But I need the url for streaming in my Android app.

Re: RPi Cam Web Interface ... button to control a motor RESOLVED

Posted: Tue Jun 11, 2019 2:28 am
by CharlyDelta
Hello...


I know how to add buttons and edit the userbuttons file. Now, by clicking on a button, I would like to operate a DC motor with an L293.

Don't mind about wiring. How do I configure those buttons to do this? A path to a solution would help me a lot.




Image

Re: RPi Cam Web Interface

Posted: Tue Jun 11, 2019 9:23 am
by Gary Littlemore
The raw stream can be found on http://YourIP/html/cam_pic_new.php
albka1986 wrote:
Mon Jun 10, 2019 1:55 pm
How can I get URL of raw MPEG streaming ?
I tried http://192.168.88.240/cam_pic_new.php and http://192.168.88.240/mini.php and http://192.168.88.240/min.php. But these sites return 404 Error.
In web interface I see me video. But I need the url for streaming in my Android app.