Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Rpi Cam interface not working, possibly permission error #3431

Closed
arkhub opened this issue Mar 22, 2020 · 8 comments
Closed

Rpi Cam interface not working, possibly permission error #3431

arkhub opened this issue Mar 22, 2020 · 8 comments
Labels
Milestone

Comments

@arkhub
Copy link

arkhub commented Mar 22, 2020

Creating a bug report/issue

Required Information

  • DietPi version

G_DIETPI_VERSION_CORE=6
G_DIETPI_VERSION_SUB=28
G_DIETPI_VERSION_RC=0
G_GITBRANCH='master'
G_GITOWNER='MichaIng'

  • Distro version

10.3

  • Kernel version

Linux DietPi 4.19.97+ #1294 Thu Jan 30 13:10:54 GMT 2020 armv6l GNU/Linux

  • SBC device

RPi B (armv6l) (Raspberry Pi 1 Model B)

  • Power supply used

5V 2.5A

  • SDcard used

Generic 8Gb microsd card with adapter

Additional Information (if applicable)

  • Software title

Rpi Cam Control

  • Was the software title installed freshly or updated/migrated?

Fresh Install

  • Can this issue be replicated on a fresh installation of DietPi?

Yes, I've installed it again fresh

Steps to reproduce

  1. Fresh install dietpi using etcher
  2. Finish setup and reboot
  3. Install optimized software -> Rpi Cam
  4. Go to web interface -> http://<ip address/rpicam
  5. Page loaded, pictures shown, but cannot change / edit any option, the interface just doesn't work

Expected behaviour

  • rpi cam control interface should be working (change setting, etc)

Actual behaviour

  • rpi cam control interface not working, even stopping the camera button doesn't work

Extra details

After reviewing error.log in lighttpd, here is the first error encountered
(mod_fastcgi.c.421) FastCGI-stderr: PHP message: PHP Warning: fopen(/var/www/rpicam/scheduleLog.txt): failed to open stream: Permission denied in /var/www/rpicam/config.php on line 66PHP message: PHP Warning: fwrite() expects parameter 1 to be resource, bool given in /var/www/rpicam/config.php on line 68PHP message: PHP Warning: fclose() expects parameter 1 to be resource, bool given in /var/www/rpicam/config.php on line 69PHP message: PHP Warning: fopen(/var/www/rpicam/scheduleLog.txt): failed to open stream: Permission denied in /var/www/rpicam/config.php on line 66PHP message: PHP Warning: fwrite() expects parameter 1 to be resource, bool given in /var/www/rpicam/config.php on line 68PHP message: PHP Warning: fclose() expects parameter 1 to be resource, bool given in /var/www/rpicam/config.php on line 69

@arkhub
Copy link
Author

arkhub commented Mar 22, 2020

Update : changing the permission of rpicam folder into www-data seems to fix the issue (chown -hR www-data:www-data), although I don't know if this the recommended way.

@MichaIng
Copy link
Owner

@arkhub
Permissions should be granted more targeted:

chown -R www-data:www-data /var/www/rpicam

@MichaIng MichaIng added this to the v6.29 milestone Mar 22, 2020
MichaIng added a commit that referenced this issue Mar 22, 2020
+ DietPi-Software | RPi Cam Control: Fix permissions: #3431
+ DietPi-Software | RPi Cam Control: Update permissions based on new official installer: https://github.com/silvanmelchior/RPi_Cam_Web_Interface/blob/master/install.sh
+ DietPi-Software | RPi Cam Control/MotionEye: Enhance uninstall and minor coding
@MichaIng
Copy link
Owner

Fixed: 503549e
Changelog: 2e41b6f

@dsalgueiro
Copy link

dsalgueiro commented Mar 28, 2020

As-is V6.28.0 installation with ProFTP and RPI Cam Web Interface: Cannot view RPI Cam Web Interface page.

With chown -R www-data:www-data /var/www/rpicam

RPI Cam Web Interface now shows up and works

STILL NOT WORKING: 404 error when trying to download any recorded videos or Gzipped videos. Note that preview images do appear. I think this is another related permissions issue.

@MichaIng
Copy link
Owner

@dsalgueiro
Could you please paste:

ls -al /mnt/dietpi_userdata/rpicam

Omit any actual file names in case for your privacy, I am only interested in the user/modes of the contained files. The videos should be stored there and need to be readable by www-data user.

@dsalgueiro
Copy link

dsalgueiro commented Mar 28, 2020

Here's what I get with that:

root@DietPi:~# ls -al /mnt/dietpi_userdata/rpicam
total 62916
drwxrwxr-x 2 www-data www-data     4096 Mar 28 15:49 .
drwxrwxr-x 7 dietpi   dietpi       4096 Mar 27 12:57 ..
-rw-r--r-- 1 www-data www-data 14876171 Mar 28 15:49 vi_0XXXX[rest of file name].h264
-rw-r--r-- 1 www-data www-data    17063 Mar 28 15:49 vi_0XXXX[rest of file name].mp4.v0000.th.jpg
-rw-r--r-- 1 www-data www-data        0 Mar 28 13:45 vi_0XXXX[rest of file name].h264
-rw-r--r-- 1 www-data www-data 10486887 Mar 28 13:59 vi_0XXXX[rest of file name].h264
-rw-r--r-- 1 www-data www-data 17080501 Mar 28 13:59 vi_0XXXX[rest of file name].h264
-rw-r--r-- 1 www-data www-data  7761470 Mar 28 15:42 vi_0XXXX[rest of file name].mp4
-rw-r--r-- 1 www-data www-data 14182900 Mar 28 14:01 vi_0XXXX[rest of file name].h264

I previously deleted several motion triggered recordings and the video / downloads page only shows one video now. I am wondering if the web cam interface page also can't delete the actual recordings.

@MichaIng
Copy link
Owner

@dsalgueiro
Hmm the permissions look fine as www-data is owner of all files and has write access as such. Also strange that it shows one video only, as all present ones have exactly the same permissions. But the shown one is one of those listed in the directory, right?

@dsalgueiro
Copy link

dsalgueiro commented Mar 28, 2020

@dsalgueiro
Hmm the permissions look fine as www-data is owner of all files and has write access as such. Also strange that it shows one video only, as all present ones have exactly the same permissions. But the shown one is one of those listed in the directory, right?

Correct, the only video shown is in the top 2 files, first one is the video, second one is a thumbnail.

This is what shows up in the web browser navigation space that gives the 404 result:
http://10.0.0.44/rpicam/media/vi_0000_20200328_154902.mp4

---Wait a sec. The video file is supposed to be a .h264, not mp4.

When I navigate to
http://10.0.0.44/rpicam/media/vi_0000_20200328_154902.h264

I can download the video when I navigate to the .h264 extension.

Please also note that I can delete the videos from the web interface. I was wrong that the files didn't delete.


Update,

It's all working now.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

3 participants