FOSCAM FI8918W and Motion
Question
I purchased the FI8918W because of the good ratings that I was reading about and I checked the Motion Wiki to see if was a device that someone had already tested with Motion and I was happy to see it was..
See the link below:
http://www.lavrsen.dk/foswiki/bin/view/Motion/WorkingDevices#Foscam
I have tried for about a day to get this thing working and I have had zero luck. It appears that the camera is prompting for username\password even thought the username\password is passed in the URL..
Here is the Motion option line I am using:
netcam_url http://192.168.0.60:80/videostream.cgi?user=admin?pwd=admin
I also posted this same question in the Foscam forums as well.
http://foscam.us/forum/post22554.html#p22554
This URL works great in Chrome but appears it breaks from a Linux command line.. See below.
[root@localhost motion]# curl http://192.168.0.60:80/videostream.cgi?user=admin?pwd=admin
<HTML><HEAD><TITLE>401 Unauthorized</TITLE></HEAD>
<BODY BGCOLOR="#cc9999"><H4>401 Unauthorized</H4>
Authorization required.
</BODY></HTML>
[root@localhost motion]# wget http://192.168.0.60:80/videostream.cgi?user=admin?pwd=admin
--2013-02-28 19:46:29-- http://192.168.0.60/videostream.cgi?user=admin?pwd=admin
Connecting to 192.168.0.60:80... connected.
HTTP request sent, awaiting response... 401 Unauthorized
Authorization failed.
I can only assume this is what Motion is executing to get a snapshot from the camera.
I'm hoping someone can help soon else I will need to go with a different camera mfg.
Thanks in advance.
Here is the error that Motion is throwing in the log up to the point it get and access denied and gives up.
[0] [NTC] [ALL] [Feb 28 19:48:42] motion_startup: Using log type (ALL) log level (ALL)
[0] [NTC] [ALL] [Feb 28 19:48:42] become_daemon: Motion going to daemon mode
[0] [NTC] [ALL] [Feb 28 19:48:42] become_daemon: Created process id file /var/run/motion/motion.pid. Process ID is 28894
[0] [NTC] [ALL] [Feb 28 19:48:42] motion_startup: Motion running as daemon process
[0] [NTC] [ENC] [Feb 28 19:48:42] ffmpeg_init: ffmpeg LIBAVCODEC_BUILD 3554148 LIBAVFORMAT_BUILD 3546472
[0] [NTC] [ALL] [Feb 28 19:48:42] main: Thread 1 is from /etc/motion/cam3.conf
[0] [NTC] [ALL] [Feb 28 19:48:42] main: Thread 1 is device: http://192.168.0.60:80/videostream.cgi?user=admin?pwd=admin input -1
[0] [NTC] [ALL] [Feb 28 19:48:42] main: Stream port 8083
[0] [NTC] [ALL] [Feb 28 19:48:42] main: Waiting for threads to finish, pid: 28894
[0] [NTC] [STR] [Feb 28 19:48:42] httpd_run: motion-httpd testing : IPV4 addr: 0.0.0.0 port: 8080
[0] [NTC] [STR] [Feb 28 19:48:42] httpd_run: motion-httpd Bound : IPV4 addr: 0.0.0.0 port: 8080
[0] [NTC] [STR] [Feb 28 19:48:42] httpd_run: motion-httpd/3.3.0 running, accepting connections
[0] [NTC] [STR] [Feb 28 19:48:42] httpd_run: motion-httpd: waiting for data on 0.0.0.0 port TCP 8080
[1] [NTC] [ALL] [Feb 28 19:48:42] motion_init: Thread 1 started , motion detection Enabled
[1] [ALR] [NET] [Feb 28 19:48:42] netcam_start: Network Camera thread starting... for url (http://192.168.0.60:80/videostream.cgi?user=admin?pwd=admin)
[1] [DBG] [NET] [Feb 28 19:48:42] netcam_url_parse: Entry netcam_url_parse data http://192.168.0.60:80/videostream.cgi?user=admin?pwd=admin
[1] [DBG] [NET] [Feb 28 19:48:42] netcam_url_parse: Parse case 0 data http://192.168.0.60:80/videostream.cgi?user=admin?pwd=admin
[1] [DBG] [NET] [Feb 28 19:48:42] netcam_url_parse: Parse case 1 data http
[1] [DBG] [NET] [Feb 28 19:48:42] netcam_url_parse: Parse case 6 data 192.168.0.60
[1] [DBG] [NET] [Feb 28 19:48:42] netcam_url_parse: Parse case 7 data :80
[1] [DBG] [NET] [Feb 28 19:48:42] netcam_url_parse: Parse case 8 data 80
[1] [DBG] [NET] [Feb 28 19:48:42] netcam_url_parse: Parse case 9 data /videostream.cgi?user=admin?pwd=admin
[1] [INF] [NET] [Feb 28 19:48:42] netcam_start: Netcam_http parameter 'on' converts to flags: HTTP/1.0: 0 HTTP/1.1: 1 Keep-Alive ON.
[1] [INF] [NET] [Feb 28 19:48:42] netcam_start: now calling netcam_setup_html()
[1] [INF] [NET] [Feb 28 19:48:42] netcam_http_build_url: Netcam has flags: HTTP/1.0: 0 HTTP/1.1: 1 Keep-Alive ON.
[1] [INF] [NET] [Feb 28 19:48:42] netcam_http_build_url: Camera connect string is ''GET /videostream.cgi?user=admin?pwd=admin HTTP/1.1^M
[1] [INF] [NET] [Feb 28 19:48:42] netcam_http_request: about to try to connect, time #0
[1] [INF] [NET] [Feb 28 19:48:42] netcam_connect: with keepalive set, invalid socket.This could be first time, created a new one with fd 6
[1] [INF] [NET] [Feb 28 19:48:42] netcam_connect: SO_KEEPALIVE is OFF
[1] [INF] [NET] [Feb 28 19:48:42] netcam_connect: SO_KEEPALIVE set on socket.
[1] [INF] [NET] [Feb 28 19:48:42] netcam_connect: re-using socket 6 since keepalive is set.
[1] [INF] [NET] [Feb 28 19:48:42] netcam_read_first_header: Received first header ('HTTP/1.1 401 Unauthorized')
[1] [INF] [NET] [Feb 28 19:48:42] netcam_read_first_header: HTTP Result code 401
[1] [NTC] [NET] [Feb 28 19:48:42] netcam_read_first_header: Removed netcam Keep-Alive flagdue to apparent closed HTTP connection.
[1] [NTC] [NET] [Feb 28 19:48:42] netcam_setup_html: connected, going on to read image.
[1] [DBG] [NET] [Feb 28 19:48:42] netcam_check_buffsize: expanding buffer from [0/0] to [0/4096] bytes.
[1] [NTC] [NET] [Feb 28 19:48:42] netcam_read_html_jpeg: disconnecting netcam since keep-alive not set.
[1] [NTC] [NET] [Feb 28 19:48:42] netcam_read_html_jpeg: leaving netcam connected.
[1] [DBG] [NET] [Feb 28 19:48:42] netcam_output_message: Not a JPEG file: starts with 0x53 0x65
[1] [INF] [NET] [Feb 28 19:48:42] netcam_error_exit: netcam->jpeg_error 1
[1] [CRT] [NET] [Feb 28 19:48:42] netcam_start: libjpeg decompression failure on first frame - giving up!
Environment
Motion version: |
3.3.0 |
ffmpeg version: |
|
Libraries: |
ffmpeg, mysql, postgresql |
Server OS: |
Fedora 3.7.7-201.fc18.i686 |
--
ArchSpangler - 01 Mar 2013
Answer
Hi
Your URL looks wrong.
There should be only one ?-mark after the URL path, and then further parameters are separated by &
Example
http://host_name/path/Command?parameter1=value¶meter2=value¶meter3=value
So try and replace the 2nd ? Mark by an &
--
KennethLavrsen - 01 Mar 2013
I suggest using these settings:
netcam_url http://CAMERA_IP/videostream.cgi
netcam_userpass admin:password
netcam_keepalive on
--
PhilipTait - 28 Jul 2013