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

Re: RPi Cam Web Interface

Thu Jan 16, 2020 12:17 pm

I based it on your code. That's the fun part. Thank you for the push that got me here!

Found it with

Code: Select all

annotate.write ('Obj = {}'.format (sensor.get_obj_temp()))
Have a good day, ras07 !

awezm
Posts: 5
Joined: Fri Jul 26, 2019 11:28 pm

Re: RPi Cam Web Interface

Sun Jan 19, 2020 12:23 pm

Hello,

How can I redirect the video output and the entire web interface to my custom website url instead of it being on http://ipAddress:port/subfolder?

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

Re: RPi Cam Web Interface

Sun Jan 19, 2020 11:13 pm

awezm wrote:
Sun Jan 19, 2020 12:23 pm
How can I redirect the video output and the entire web interface to my custom website url instead of it being on http://ipAddress:port/subfolder?
That's a DNS and routing issue, and it's quite a bit beyond the scope of this forum/topic. But if you're trying to make it accessible to the outside world you should know that RPi-CWI isn't intended to be secure, and exposing it to the world is a really bad idea without a thorough understainging of the security considerations. In addition it can use some major bandwidth; unless you have a commercial internet feed, your upstream bandwidth likely isn't sufficient.

Unless you really know what you're doing, you shouldn't try to do this.

ras

Bagmulgwan
Posts: 19
Joined: Sun Apr 14, 2013 8:11 am

Re: RPi Cam Web Interface

Mon Jan 20, 2020 4:19 pm

I just got a surveillance camera working with the motion package. It's neat, but continuous surveillance is not really what I want to do with the camera. It's just that everything about this – to my mind, rather complex – project was easy to find and set up, because there are tons of examples on the web.

What I really want is simply a remote camera that I can use to check the state (open/closed) of a garage door somewhere close – but not visible from a window, say. There is no need for motion detection. I just want a button in a browser window that I can click and see whether the door is open or closed. Simple, right? Would anyone here know of such a project – that would help me get started, at least? Thank you in advance!

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

Re: RPi Cam Web Interface

Tue Jan 21, 2020 4:15 am

Bagmulgwan wrote:
Mon Jan 20, 2020 4:19 pm
What I really want is simply a remote camera that I can use to check the state (open/closed) of a garage door somewhere close – but not visible from a window, say. There is no need for motion detection. I just want a button in a browser window that I can click and see whether the door is open or closed. Simple, right? Would anyone here know of such a project – that would help me get started, at least? Thank you in advance!
RPi Cam Web Interface would work fine for this and is easier to set up than Motion. Note that it doesn't work with USB cameras, however, in case that's what you already have.

Bagmulgwan
Posts: 19
Joined: Sun Apr 14, 2013 8:11 am

Re: RPi Cam Web Interface

Tue Jan 21, 2020 7:20 am

ras07 wrote:
Tue Jan 21, 2020 4:15 am
RPi Cam Web Interface would work fine for this and is easier to set up than Motion. Note that it doesn't work with USB cameras, however, in case that's what you already have.
Thank you, but Motion was, in fact, so easy to set up in maybe half an hour that it really was no problem at all. The problem was its complexity, and RPi Cam Web Interface seems just about as complex. I don't want a package that can do 15-20 things; I just want a simple application that lets me check the garage door's state (open/closed) remotely when I want. (In my experience, the more complex an application, the more liable it is to break.)

The "simple application" would be something like this: A button on a web page. When clicked, it runs raspistill, say, and takes one photo. And then shows the photo on the remote screen.

That's all. I can do it now by ssh'ing to the remote RPi, running raspistill once, scp'ing the jpg to my PC and then viewing the image locally. But clicking the button on the web page would be faster.

Bagmulgwan
Posts: 19
Joined: Sun Apr 14, 2013 8:11 am

Re: RPi Cam Web Interface

Tue Jan 21, 2020 5:06 pm

Bagmulgwan wrote:
Tue Jan 21, 2020 7:20 am
The "simple application" would be something like this: A button on a web page. When clicked, it runs raspistill, say, and takes one photo. And then shows the photo on the remote screen.

That's all. I can do it now by ssh'ing to the remote RPi, running raspistill once, scp'ing the jpg to my PC and then viewing the image locally. But clicking the button on the web page would be faster.
Finally thought of a faster way: ssh to the remote camera with the -X argument. Run raspistill. Then run links2 on the jpg file. The image appears on my local screen. Done.

Maybe this is fast enough for my modest purpose. No need for a web server on the Raspi, say.

RidleyNelson17
Posts: 1
Joined: Fri Feb 22, 2019 8:48 pm
Location: Minnesota, US, Earth
Contact: Twitter

Re: RPi Cam Web Interface

Thu Feb 13, 2020 1:34 am

Is there any way someone could possibly post a bithub link or any link to that matter to an .img file containing the latest build?

precaash
Posts: 3
Joined: Fri Feb 14, 2020 12:04 pm

Re: RPi Cam Web Interface

Fri Feb 14, 2020 12:17 pm

Hey guys,

I wrote a python script that sends an 'im' command to FIFO when a certain GPIO pin receives a signal and it works.
However I want that the pictures that are taken that way have a different file name: e.g. from "im_0030_20200214_105335.jpg" to "trig_0030_20200214_105335.jpg".

As a first step I want to permanently change the saved file name. I read that I would need to configure the raspimjpeg file (there are two: /etc/raspimjpeg and /var/www/html/raspimjpeg) so I change it with the following command:

Code: Select all

 sudo sed -i 's,image_path /var/www/html/media/im_%i_%Y%M%D_%h%m%s.jpg,image_path /var/www/html/media/trig_%i_%Y%M%D_%h%m%s.jpg,g' raspimjpeg
(Yes, I changed both)
It changes the file content, but once I take a picture the filename still remains as ""im_0030_20200214_105335.jpg"

It feels to me like the changes are not applied. How should I proceed?

Thank you in advance! This forum has already proven helpful to me numerous times! :D

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

Re: RPi Cam Web Interface

Fri Feb 14, 2020 7:39 pm

precaash wrote:
Fri Feb 14, 2020 12:17 pm
I wrote a python script that sends an 'im' command to FIFO when a certain GPIO pin receives a signal and it works.
However I want that the pictures that are taken that way have a different file name: e.g. from "im_0030_20200214_105335.jpg" to "trig_0030_20200214_105335.jpg".

As a first step I want to permanently change the saved file name. I read that I would need to configure the raspimjpeg file (there are two: /etc/raspimjpeg and /var/www/html/raspimjpeg) so I change it with the following command:

Code: Select all

 sudo sed -i 's,image_path /var/www/html/media/im_%i_%Y%M%D_%h%m%s.jpg,image_path /var/www/html/media/trig_%i_%Y%M%D_%h%m%s.jpg,g' raspimjpeg
(Yes, I changed both)
It changes the file content, but once I take a picture the filename still remains as ""im_0030_20200214_105335.jpg"

It feels to me like the changes are not applied. How should I proceed?
I'm not positive, but I'd imagine you'd have to restart the camera to reread the configuration file. This will probably cause timing and other issues, and is generally heavy-handed in a way that may not suit your needs.

I'd recommend a different approach: leave the raspimjpeg file alone, and instead set some kind of flag (could be a temporary file somewhere) in your python script. Then edit (or create) the end_img.sh script in the macros directory to rename the file after it's captured (the script gets the file name on the command line, so you'll need to parse that to figure out what to change). Then clear the flag (erase the temp file or whatever).

Incidentally, two things to note regarding your first solution - the first is that /var/www/html/raspimjpeg is just a symlink to /etc/raspimjpeg, so you wouldn't need to edit both; they are the same file. The second is that settings in uconfig will override settings in raspimjpeg, so could just make the setting changes there rather than mess with raspimjpeg (and that would generally be better). My guess is you would still have to restart the camera though - I think my suggestion would be preferable.

User avatar
Amarand
Posts: 13
Joined: Tue Apr 28, 2015 7:32 pm
Location: Galloway, OH, USA
Contact: Website Yahoo Messenger Facebook YouTube

Re: RPi Cam Web Interface

Mon Feb 17, 2020 4:38 pm

I did a search in this topic for the word "focus" and didn't find anyone asking this question....

I've been successfully using the ArduCAM drop-in programmable focus camera with RPi Cam Control for a few weeks now. Works great.

The focus control all goes through the same ribbon cable, which is nice. I guess other versions have you connect the focus control to the GPIO?

Because only one program can be talking to the camera at once (apparently), I need to "Stop Camera" and then run the Python tools to adjust focus, then "Start Camera" again once the focus is right.

What I'd love to see is a focus control built into the RPi Cam Web Interface, so I can do the focus and preview right in the same app.

Is that something that could eventually happen?

precaash
Posts: 3
Joined: Fri Feb 14, 2020 12:04 pm

Re: RPi Cam Web Interface

Thu Feb 20, 2020 8:48 am

ras07 wrote:
Fri Feb 14, 2020 7:39 pm
precaash wrote:
Fri Feb 14, 2020 12:17 pm
I wrote a python script that sends an 'im' command to FIFO when a certain GPIO pin receives a signal and it works.
However I want that the pictures that are taken that way have a different file name: e.g. from "im_0030_20200214_105335.jpg" to "trig_0030_20200214_105335.jpg".

As a first step I want to permanently change the saved file name. I read that I would need to configure the raspimjpeg file (there are two: /etc/raspimjpeg and /var/www/html/raspimjpeg) so I change it with the following command:

Code: Select all

 sudo sed -i 's,image_path /var/www/html/media/im_%i_%Y%M%D_%h%m%s.jpg,image_path /var/www/html/media/trig_%i_%Y%M%D_%h%m%s.jpg,g' raspimjpeg
(Yes, I changed both)
It changes the file content, but once I take a picture the filename still remains as ""im_0030_20200214_105335.jpg"

It feels to me like the changes are not applied. How should I proceed?
I'm not positive, but I'd imagine you'd have to restart the camera to reread the configuration file. This will probably cause timing and other issues, and is generally heavy-handed in a way that may not suit your needs.

I'd recommend a different approach: leave the raspimjpeg file alone, and instead set some kind of flag (could be a temporary file somewhere) in your python script. Then edit (or create) the end_img.sh script in the macros directory to rename the file after it's captured (the script gets the file name on the command line, so you'll need to parse that to figure out what to change). Then clear the flag (erase the temp file or whatever).

Incidentally, two things to note regarding your first solution - the first is that /var/www/html/raspimjpeg is just a symlink to /etc/raspimjpeg, so you wouldn't need to edit both; they are the same file. The second is that settings in uconfig will override settings in raspimjpeg, so could just make the setting changes there rather than mess with raspimjpeg (and that would generally be better). My guess is you would still have to restart the camera though - I think my suggestion would be preferable.
Thank you very much for your suggestion! I will try it out today and let you know if it works.
EDIT:

So this is what I did:
I created two shell scripts in the macros folder, which take the two latest files of the media folder and change the prefix. (Two latest because of the thumbnail file)

It actually works fairly well, even combined with my GPIO-trigger python script. BUT sometimes it doesn't change the name (sometimes it just remains as im_.....).

I'm puzzled as to why this is happening. It happens randomly inbetween, but also the file name of the last taken image is not changed.

Any suggestion why? I'm renaming it using:

Code: Select all

cd /var/www/html/media

LATEST=$(ls -t | head -2)
sudo rename 's/^im/trig1/' $LATEST
And tbh, I haven't quite understood what you meant by creating this temporary file. What purpose does it have? Thank you in advance!

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

Re: RPi Cam Web Interface

Thu Feb 20, 2020 6:56 pm

precaash wrote:
Thu Feb 20, 2020 8:48 am
I created two shell scripts in the macros folder, which take the two latest files of the media folder and change the prefix. (Two latest because of the thumbnail file)

It actually works fairly well, even combined with my GPIO-trigger python script. BUT sometimes it doesn't change the name (sometimes it just remains as im_.....).

I'm puzzled as to why this is happening. It happens randomly inbetween, but also the file name of the last taken image is not changed.

Any suggestion why? I'm renaming it using:

Code: Select all

cd /var/www/html/media

LATEST=$(ls -t | head -2)
sudo rename 's/^im/trig1/' $LATEST
And tbh, I haven't quite understood what you meant by creating this temporary file. What purpose does it have? Thank you in advance!
I'm not sure what your code is doing ... is rename a script you wrote? It's not a Linux command ... In any case, if you're trying to do all that from your Python trigger script, you might have timing issues - the image file may or may not exist by the time you try to rename it.

All I meant with the temporary file is to use it as a flag to indicate that the image was initiated from your GPIO trigger, as opposed to some other means (motion detection or manually through the UI). Then use the built-in scripting facility in RPI-CWI to do the rest.

In your Python script, create the temp file with something like:

Code: Select all

f = open("/var/www/html/media/triggerFlag","w+")
f.close
(Execute this before sending the im command to the FIFO queue)

Then edit (or create) the end_img.sh script in the macros directory as follows:

Code: Select all

#!/bin/bash
if [ -f "/var/www/html/media/triggerFlag" ]; then
        mv $1 ${1/im_/trig_}
        mv $1.*.th.jpg ${1/im_/trig_}.th.jpg
        rm /var/www/html/media/triggerFlag
fi
The name of the image file gets sent to end_img.sh as command line parameter $1 so it makes it easy to manipulate. If
/var/www/html/media/triggerFlag doesn't exist, then nothing gets renamed.

(Note that this code doesn't quite preserve the original thumbnail file name format; im_0001_20200102_123456.jpg.i0001.th.jpg is going to get renamed to trig_0001_20200102_123456.jpg.th.jpg ... if you care about this you'll need to do a bit more parsing of the file name in the second mv command.)

Aquakitty
Posts: 3
Joined: Thu Feb 13, 2020 4:38 am

Re: RPi Cam Web Interface

Fri Feb 21, 2020 7:14 pm

Hi guys,
I am using RPi_Cam_Web_Interface on a Raspberry Pi Zero W with an authentic Raspberry Pi v2 camera. My problem is I thought the streaming images would be a little bit better quality. I am not sure if this is related, but I am also getting a problem where the camera freezes and I get an mmal: mmal_vc_component_enable: failed to enable component: ENOSPC error, but this only seems to be happening when it is cold, in mornings and evenings to make things even more confusing.

So my questions are two fold:
1) Does this streaming quality (I manually took a still) look normal? To me it looks barely better than a 1.3 mega pixel camera on old flip phones! Changing the resolution to 1080p makes no difference to the pixelization
2) If this is not normal could I possibly have a faulty camera?
I am pretty sure this is just not designed for what I want and am expecting too much, seems like it would be better just for basic surveillance or close ups.

Image
Enlarged

Image
Small

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

Re: RPi Cam Web Interface

Sat Feb 22, 2020 3:41 am

Aquakitty wrote:
Fri Feb 21, 2020 7:14 pm
My problem is I thought the streaming images would be a little bit better quality. I am not sure if this is related, but I am also getting a problem where the camera freezes and I get an mmal: mmal_vc_component_enable: failed to enable component: ENOSPC error
Keep in mind that while camera will take stills at 8 megapixels, it will only shoot video at a max of 1080p (which is about 2MP). That said, I agree that the picture you posted doesn't look very good. To me it actually looks out of focus.

The lens on the Pi camera is threaded, and you can focus it by screwing it in and out. One of mine actually came with a little knob (and no instructions) that I eventually discovered fits over the lens to turn it to focus. But you can also do it with a pair of tweezers if you're careful. Sometimes they have a small dab of thread lock that you have to gently break loose before it will turn. I'd give this a try; it's possible that yours is just out of focus.

The freezing is probably unrelated. Here are a few things to try:

1. Make sure the ribbon cable (both ends) is clean, seats well, and the connectors are locked.
2. Make sure the camera is enabled in raspi_config (although it wasn't, the error woudln't be sporadic, it would be all the time).
3. Try increasing the GPU memory split (also in raspi_config) to 144.

I just started having a similar issue with one of my Zero W's. Mine's outside as well, and it seems like it may be related to cold and damp weather. If I come to any resolution I'll post back.

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

Re: RPi Cam Web Interface

Sat Feb 22, 2020 4:19 pm

[Image][/url]

This is what I get with a V2 NoIr camera on a Zero W card. I actually adjusted the focus and this is the best I get. I also have the same camera in a nesting box and I let it work all winter long even in very cold weather (-30) without any problem.
I bought several V2 cameras and often it comes with a little gizmo to adjust the focus.

Image

precaash
Posts: 3
Joined: Fri Feb 14, 2020 12:04 pm

Re: RPi Cam Web Interface

Tue Feb 25, 2020 9:40 am

ras07 wrote:
Thu Feb 20, 2020 6:56 pm
precaash wrote:
Thu Feb 20, 2020 8:48 am
I created two shell scripts in the macros folder, which take the two latest files of the media folder and change the prefix. (Two latest because of the thumbnail file)

It actually works fairly well, even combined with my GPIO-trigger python script. BUT sometimes it doesn't change the name (sometimes it just remains as im_.....).

I'm puzzled as to why this is happening. It happens randomly inbetween, but also the file name of the last taken image is not changed.

Any suggestion why? I'm renaming it using:

Code: Select all

cd /var/www/html/media

LATEST=$(ls -t | head -2)
sudo rename 's/^im/trig1/' $LATEST
And tbh, I haven't quite understood what you meant by creating this temporary file. What purpose does it have? Thank you in advance!
I'm not sure what your code is doing ... is rename a script you wrote? It's not a Linux command ... In any case, if you're trying to do all that from your Python trigger script, you might have timing issues - the image file may or may not exist by the time you try to rename it.

All I meant with the temporary file is to use it as a flag to indicate that the image was initiated from your GPIO trigger, as opposed to some other means (motion detection or manually through the UI). Then use the built-in scripting facility in RPI-CWI to do the rest.

In your Python script, create the temp file with something like:

Code: Select all

f = open("/var/www/html/media/triggerFlag","w+")
f.close
(Execute this before sending the im command to the FIFO queue)

Then edit (or create) the end_img.sh script in the macros directory as follows:

Code: Select all

#!/bin/bash
if [ -f "/var/www/html/media/triggerFlag" ]; then
        mv $1 ${1/im_/trig_}
        mv $1.*.th.jpg ${1/im_/trig_}.th.jpg
        rm /var/www/html/media/triggerFlag
fi
The name of the image file gets sent to end_img.sh as command line parameter $1 so it makes it easy to manipulate. If
/var/www/html/media/triggerFlag doesn't exist, then nothing gets renamed.

(Note that this code doesn't quite preserve the original thumbnail file name format; im_0001_20200102_123456.jpg.i0001.th.jpg is going to get renamed to trig_0001_20200102_123456.jpg.th.jpg ... if you care about this you'll need to do a bit more parsing of the file name in the second mv command.)
Hi thanks again for your reply!
The "rename" is a package I installed. I believe it's a perl regex. And yes you were right, it was a timing issue, but after (rather in a ugly way) tweaking it I managed to have a rename accuracy of 90% :D :D

The flag thing isn't quite important in my case since I would only use the trigger mode anyways, but thanks for the suggestion!

So this is what I ended up with:
When I start the trigger mode a text prompt pops up and asks the user for a folder name. The images taken through the trigger are renamed and moved to the user-specified folder.
This is the "end_trigger1.sh" script:

Code: Select all

cd /var/www/html/media

LATEST11=$(ls -t im*.jpg | head -2)
rename 's/^im/trig1/' $LATEST11

LATEST12=$(ls -t trig1*.jpg | head -2)
mv $LATEST12 $1/
And the python script looks like this:

Code: Select all

from gpiozero import Button
from signal import pause
import os
import sys

mkdir = "cd /var/www/html/media && mkdir %s && cd .." % (str(sys.argv[1]))
os.system(mkdir)

mycmd1 = "echo 'im' >/var/www/html/FIFO && ./macros/end_trig1.sh %s" % (str(sys.argv[1]))
mycmd2 = "echo 'im' >/var/www/html/FIFO && ./macros/end_trig2.sh %s" % (str(sys.argv[1])) 
button1 = Button(2)
button2 = Button(3)

def capture1():
	os.system(mycmd1)
def capture2():
	os.system(mycmd2)
	
button1.when_pressed = capture1
button2.when_pressed = capture2
pause()
If anyone has more questions on how to pass a variable (in this case the folder name) all the way from the interface up to shell and python script, feel free to ask!

Also another lesson I learned: always edit the sudoers.d file with

Code: Select all

sudo visudo /etc/sudoers.d/...
or you might end up destroying your sudoers.d file.
Plus lesson: Always. Back. Up. (because I accidentally deleted the /var folder. Yes.. I know)

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

Re: RPi Cam Web Interface

Tue Feb 25, 2020 5:21 pm

ras07 wrote:
Sat Feb 22, 2020 3:41 am
Aquakitty wrote:
Fri Feb 21, 2020 7:14 pm
My problem is I thought the streaming images would be a little bit better quality. I am not sure if this is related, but I am also getting a problem where the camera freezes and I get an mmal: mmal_vc_component_enable: failed to enable component: ENOSPC error
...
The freezing is probably unrelated. Here are a few things to try:

1. Make sure the ribbon cable (both ends) is clean, seats well, and the connectors are locked.
2. Make sure the camera is enabled in raspi_config (although it wasn't, the error woudln't be sporadic, it would be all the time).
3. Try increasing the GPU memory split (also in raspi_config) to 144.

I just started having a similar issue with one of my Zero W's. Mine's outside as well, and it seems like it may be related to cold and damp weather. If I come to any resolution I'll post back.
Turns out my problem was solved by just reseating the cable. I've tried to secure it a little better in hopes that it doesn't work its way loose again from the ambient temperature swings.

guitartoys
Posts: 3
Joined: Fri Feb 28, 2020 6:05 pm

Re: RPi Cam Web Interface

Fri Feb 28, 2020 6:19 pm

Hi,

I've got it installed and running happily. This thing is sweet. I am using them in an HO Train setup, inside tunnels and under covers to be able to see video of the train coming down the track. I'm also designing a rail-car to hold one so you run one down the track for a track level view.

My question is this. I really need to dumb this down quite a bit for a user. I basically want to set up Chrome with an auto-launch, and only have the video screen (live streaming when turned on) in the window. I don't want any of the config screen or any other buttons present.

Maybe just a main screen, with the video, and maybe a single button that then takes you to the normal web interface. Seems pretty easy to do, just wanted to see if anyone has done this already.

Thanks.

Aquakitty
Posts: 3
Joined: Thu Feb 13, 2020 4:38 am

Re: RPi Cam Web Interface

Fri Feb 28, 2020 6:47 pm

Hmmm that definitely looks better than mine. After trial and error I realised I need to screw the camera in, which is nearly impossible to do without doing damage, because none of mine came with that handy tool. I bought another camera just to try it and it has the same quality issues. I need to get a hold of that tool and try to screw it in more.

FTR both my cams are labelled "2.1" so they are supposed to already be in "infinity" mode.


CharlyDelta wrote:
Sat Feb 22, 2020 4:19 pm
[Image][/url]

This is what I get with a V2 NoIr camera on a Zero W card. I actually adjusted the focus and this is the best I get. I also have the same camera in a nesting box and I let it work all winter long even in very cold weather (-30) without any problem.
I bought several V2 cameras and often it comes with a little gizmo to adjust the focus.

Image
ras07 wrote:
Sat Feb 22, 2020 3:41 am
Aquakitty wrote:
Fri Feb 21, 2020 7:14 pm
My problem is I thought the streaming images would be a little bit better quality. I am not sure if this is related, but I am also getting a problem where the camera freezes and I get an mmal: mmal_vc_component_enable: failed to enable component: ENOSPC error
Keep in mind that while camera will take stills at 8 megapixels, it will only shoot video at a max of 1080p (which is about 2MP). That said, I agree that the picture you posted doesn't look very good. To me it actually looks out of focus.

The lens on the Pi camera is threaded, and you can focus it by screwing it in and out. One of mine actually came with a little knob (and no instructions) that I eventually discovered fits over the lens to turn it to focus. But you can also do it with a pair of tweezers if you're careful. Sometimes they have a small dab of thread lock that you have to gently break loose before it will turn. I'd give this a try; it's possible that yours is just out of focus.

The freezing is probably unrelated. Here are a few things to try:

1. Make sure the ribbon cable (both ends) is clean, seats well, and the connectors are locked.
2. Make sure the camera is enabled in raspi_config (although it wasn't, the error woudln't be sporadic, it would be all the time).
3. Try increasing the GPU memory split (also in raspi_config) to 144.

I just started having a similar issue with one of my Zero W's. Mine's outside as well, and it seems like it may be related to cold and damp weather. If I come to any resolution I'll post back.

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

Re: RPi Cam Web Interface

Fri Feb 28, 2020 7:00 pm

Aquakitty wrote:
Fri Feb 28, 2020 6:47 pm
Hmmm that definitely looks better than mine. After trial and error I realised I need to screw the camera in, which is nearly impossible to do without doing damage, because none of mine came with that handy tool. I bought another camera just to try it and it has the same quality issues. I need to get a hold of that tool and try to screw it in more.
It's possible to adjust the focus by screwing it in and out with a pair of tweezers if you're careful and patient, but the tool is sure easier.

guitartoys
Posts: 3
Joined: Fri Feb 28, 2020 6:05 pm

Re: RPi Cam Web Interface

Sat Feb 29, 2020 2:29 am

Hello again,

I found the instructions to make the new user: sudo htpasswd /usr/local/.htpasswd newusername, which I did

I then found that I needed to create the userLevel file, which I did by editing the Example file, and then saving it with the new name. I added both the admin and the new user.

I can log into the the webcam, using either of the users (admin, train) so that's working.

However, I can't seem to get it to where the it limits the access. I have userLevel with train:0 in it.

I see that I need to add the user to .htaccess, but don't know where that file is supposed to be located.

Can a brother get some help?

Thanks.

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

Re: RPi Cam Web Interface

Sat Feb 29, 2020 3:10 am

guitartoys wrote:
Sat Feb 29, 2020 2:29 am
I found the instructions to make the new user: sudo htpasswd /usr/local/.htpasswd newusername, which I did

I then found that I needed to create the userLevel file, which I did by editing the Example file, and then saving it with the new name. I added both the admin and the new user.

I can log into the the webcam, using either of the users (admin, train) so that's working.

However, I can't seem to get it to where the it limits the access. I have userLevel with train:0 in it.

I see that I need to add the user to .htaccess, but don't know where that file is supposed to be located.
Not quite sure what you're trying to accomplish ... can you describe what your objective is? Makes it easier to advise.

guitartoys
Posts: 3
Joined: Fri Feb 28, 2020 6:05 pm

Re: RPi Cam Web Interface

Sat Feb 29, 2020 5:51 am

I just wanted to create a user, which has level zero access, so all they see is the video display in the browser.

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

Re: RPi Cam Web Interface

Sat Feb 29, 2020 7:07 pm

guitartoys wrote:
Sat Feb 29, 2020 2:29 am
I found the instructions to make the new user: sudo htpasswd /usr/local/.htpasswd newusername, which I did

I then found that I needed to create the userLevel file, which I did by editing the Example file, and then saving it with the new name. I added both the admin and the new user.

I can log into the the webcam, using either of the users (admin, train) so that's working.

However, I can't seem to get it to where the it limits the access. I have userLevel with train:0 in it.

I see that I need to add the user to .htaccess, but don't know where that file is supposed to be located.
You shouldn't need to do anything to .htaccess (I know the wiki mentions something about it but I think that's out of date). All you need is the userLevel file.

If userLevel doesn't exist, all users get full access. Maybe it's not named right, or isn't in the right directory, or doesn't have the right permissions?

Also note that there isn't a way to switch users, so you have to completely shut down your browser (all windows, not just the one viewing the cam) to switch authentication.

Return to “Camera board”