IP-Cam Picture? Authorization Required!

Support and queries relating to all previous versions of ZoneMinder
Locked
User avatar
acrid
Posts: 68
Joined: Sun Aug 24, 2003 10:26 pm
Location: Germany

IP-Cam Picture? Authorization Required!

Post by acrid »

I bought a cheap SOHO IP-Cam to play around with.
With http://<username>:<password>@192.168.0.120/IMAGE.JPG in the browser i see the image, and only the image.

In ZM I use
Hostname: <username>:<password>@192.168.0.120 (tried it even with http://)
Port: 80
Path: /IMAGE.JPG

And I don't see anything. The network->"I will use network cams"-thing is on.

in /var/log/messages I get:
Oct 22 05:50:44 videoserver zmc-m3[22402]: ERR [Invalid response status 401: Authorization Required]

:(
User avatar
zoneminder
Site Admin
Posts: 5215
Joined: Wed Jul 09, 2003 2:07 pm
Location: Bristol, UK
Contact:

Post by zoneminder »

The zmc process just uses the same authentication process as a browser so unless it's something other than basic auth I can't see what the problem might be. You might try ramping up the debug on the capture process by doing

Code: Select all

kill -USR1 <pid>
and seeing if that gives you anything useful.

Phil
User avatar
acrid
Posts: 68
Joined: Sun Aug 24, 2003 10:26 pm
Location: Germany

still no f... clue

Post by acrid »

kill -USR1 sets debug level to 1, but i can't get anything useful out of the logs.
i switched http from 1.1 to 1.0 and even used the same user agent string. and the DB has the correct settings.

what i forgot last time:

Code: Select all

wget http://<username>:<password>@192.168.0.120/IMAGE.JPG
works perfect (yes, it is an image :) )

i tried to find the "get_image_form_ip_cam"-line in the scripts to generate some output. but failed. maybe someone can help me out here.

i'm running out of ideas...

thanks in adavantage
User avatar
zoneminder
Site Admin
Posts: 5215
Joined: Wed Jul 09, 2003 2:07 pm
Location: Bristol, UK
Contact:

Post by zoneminder »

Doing subsequent kill -USR1 operations will increase the debug level progressively. You should be able to see if either working or failing in there.

Phil,
User avatar
acrid
Posts: 68
Joined: Sun Aug 24, 2003 10:26 pm
Location: Germany

more log...

Post by acrid »

i killed the process till the debug level was 9. couldn't get it any higher :)

Code: Select all

Nov  7 23:04:23 videoserver zmc-m5[26587]: DB3 [Connected to host, socket = 15]
Nov  7 23:04:23 videoserver zmc-m5[26587]: DB3 [Request sent]
Nov  7 23:04:25 videoserver zmc-m5[26587]: DB3 [Expecting 94 bytes]
Nov  7 23:04:25 videoserver zmc-m5[26587]: DB3 [Read 94 bytes]
Nov  7 23:04:25 videoserver zmc-m5[26587]: DB4 [Captured header (94 bytes): 'HTTP/1.0 401 Authorization Required^M WWW-Authenticate: BASIC realm="Administrator or User"^M ^M ']
Nov  7 23:04:25 videoserver zmc-m5[26587]: ERR [Invalid response status 401: Authorization Required]
User avatar
acrid
Posts: 68
Joined: Sun Aug 24, 2003 10:26 pm
Location: Germany

solved it

Post by acrid »

there were several things i changed, and now everything works perfect.
i resetted the camera, that there was no auth needed anymore. but it didn't work anyway.

i found out that "http://..." is not a good idea. i guess that's because of splitting <username>:<password>. with "http://..." i got the auth log errors.
for all my testing i was waiting in the log file for some "INF: Capturing at 15 frames" (instead of opening the monitor tab), but this message doesn't appear for remote cams... :oops:

the camera.jpg was not the size i set in the preferences... it's only a thumbnail (255x219 i think). i'm using video.cgi now - this connecTec camera seems to be pretty much the same as the DCS.

another important thing was that there is no problem with switching my grabber card to 8bit greyscale, even if there is a colour image. that's different for network cams. :idea:
zoneminder only listens to a digital image stream. and surely won't convert it...

thanx for helping - shame on me :D
kpmin
Posts: 20
Joined: Sat Jul 31, 2004 7:25 pm

Post by kpmin »

Acrid, is your setting for DCS-900 working fine?

IF it is, could you please elaborate on how you did it. I have the samd DCS-900, and I am having a difficulty in setting that up.

I get the following error in the /var/log/messages
zmc-m3[4770]: ERR [Invalid response status 401: Authorization Required]


If I do the following, the comands execute fine.

wget http://admin:admin@192.168.1.6/image.jpg
wget http://admin:admin@192.168.1.6/video.cgi

On the setting, I have the following

Remote Host Name <admin>:<admin>@192.168.1.6
Remote Host Port 80
Remote Host Path /video.cgi
Remote Image Colours 24 bit color
Capture Width (pixels) 360
Capture Height (pixels) 240
Orientation Normal

Also, when I connect the DCS-900 thru web browser with Java, it displays the video fine.

Could you please help on where I need to look?

THank you.
User avatar
zoneminder
Site Admin
Posts: 5215
Joined: Wed Jul 09, 2003 2:07 pm
Location: Bristol, UK
Contact:

Post by zoneminder »

I assume you that when you say you're putting <admin> in the Monitor settings that you aren't including the angle brackets? So if your user is admin and has a password of password you are actually putting in admin:password@ and not <admin>:<password>@.

Phil,
User avatar
acrid
Posts: 68
Joined: Sun Aug 24, 2003 10:26 pm
Location: Germany

Post by acrid »

i don't have a dcs-900... but a cheap copy i guess :)
maybe the problem is the picture size... it's not 360x240 but 320x240.
if i try it with 360 it doesn't work.

cheers
kpmin
Posts: 20
Joined: Sat Jul 31, 2004 7:25 pm

Post by kpmin »

Thank you very much for the reply, Phil & acrid.

Phil, actually I was putting the angle braket arount the id and password. Please pardon my igonrance. I did not know that.

So, I changed the setting to
Remote Host Name admin:admin@192.168.1.6

Acrid, I changed the setting to 320 by 240.

After the 2 settings change, now I get the different errors.

From the /var/log/messages, I get
zmc-m3[7465]: ERR [Can't shmget, probably not enough shared memory space free: Invalid argument]

At first sight, it does not look like it is from not having enough shared memory. I put the shared memory increase statement in /etc/rc.d/rc.local. So I get the following
[root@lserver tmp]# cat /proc/sys/kernel/shmmax
134217728
[root@lserver tmp]# cat /proc/sys/kernel/shmall
134217728
[root@lserver tmp]#


From the /tmp/zmdc.log, I get
'zmc -m 3' starting at 04/11/21 20:52:46, pid = 7037
'zmc -m 3' started at 04/11/21 20:52:46
'zmc -m 3' crashed at 04/11/21 20:52:46, exit status 255
Starting pending process, zmc -m 3
'zmc -m 3' starting at 04/11/21 20:53:06, pid = 7077
'zmc -m 3' started at 04/11/21 20:53:06
'zmc -m 3' crashed at 04/11/21 20:53:06, exit status 255

I attached the Logitect Web Cam Pro 4000 this zm locally using usb, with total 2 cameras, and the Logitech cam is working fine.

I will read more the doc and look around the Forum and FAQ to see if I can resolve this problems.

If you can give some hints or suggestions, I also appreciate it greatly.

Again I thank you for your help.
kpmin
Posts: 20
Joined: Sat Jul 31, 2004 7:25 pm

Post by kpmin »

After I changed the setting as suggested above, and rebooted the system, the DCS-900 is working fine. So, my 2 camera(Logitech and Dlink) are woking fine.

THe following is the working setting.

Remote Host Name admin:admin@192.168.1.6
Remote Host Port 80
Remote Host Path /video.cgi
Remote Image Colours 24 bit color
Capture Width (pixels) 320
Capture Height (pixels) 240
Orientation Normal

Again, I thank you Phil, and Acrid.
Locked