BreeeZe / rpos

Raspberry Pi Onvif Server
http://breeeze.github.io/rpos
MIT License
659 stars 147 forks source link

Cannot start up rpos.js #23

Closed mrlion420 closed 8 years ago

mrlion420 commented 8 years ago

Hi, I followed the instructions shown in text file. I used the following to start raspivid

root@raspberrypi:/home/pi/live/raspi# raspivid -o - -fps 25 -t 0 -b 800000 -n -w 1280 -h 720 | ./testRaspi

"h264" stream, from the file "stdin"
Play this stream using the URL "rtsp://192.168.1.123:8554/h264"

(We use port 80 for optional RTSP-over-HTTP tunneling.)

After this, I ran rpos.js. I have been losing my head over this for two days now. When i ran raspivid, it does not create /dev/video0 device as well.

root@raspberrypi:/home/pi/rpos-0.1.0# sudo node rpos.js
execSync('sudo cat /proc/cpuinfo')
Read IP address from awdl0 failed
Read IP address 192.168.1.123 from eth0
Manufacturer : Raspberry Pi
Model : 2 B
HardwareId : 
SerialNumber : 00000000f212401e
FirmwareVersion : 0.1.0
execSync('sudo modprobe bcm2835-v4l2')
Starting camera settings webserver on http://192.168.1.123:8081/
execSync('sudo v4l2-ctl --set-fmt-video=pixelformat=4')
Failed to open /dev/video0: No such file or directory
child_process.js:484
    throw err;
    ^

Error: Command failed: sudo v4l2-ctl --set-fmt-video=pixelformat=4
Failed to open /dev/video0: No such file or directory

    at checkExecSyncError (child_process.js:441:13)
    at Object.execSync (child_process.js:481:13)
    at Function.utils.execSync (/home/pi/rpos-0.1.0/lib/utils.js:94:66)
    at execV4l2 (/home/pi/rpos-0.1.0/lib/v4l2ctl.js:173:22)
    at Object.SetPixelFormat (/home/pi/rpos-0.1.0/lib/v4l2ctl.js:277:9)
    at Camera.setupCamera (/home/pi/rpos-0.1.0/lib/camera.js:129:27)
    at new Camera (/home/pi/rpos-0.1.0/lib/camera.js:44:14)
    at Object.<anonymous> (/home/pi/rpos-0.1.0/rpos.js:23:14)
    at Module._compile (module.js:435:26)
    at Object.Module._extensions..js (module.js:442:10)
RogerHardiman commented 8 years ago

The command line you have used with raspivid and testRaspi can be used to create a RTSP server. However this is not needed with RPOS as RPOS somes with its own RTSP server.

The /dev/video0 file is created by linux when the kernel drivers are installed and when the official raspberry pi cameras (the one with the ribbon cable) is detected.

Are you sure your camera is plugged in and enabled (it needs to be enabled in the Raspberry Pi setup program)

mrlion420 commented 8 years ago

It was uv4l daemon. I was testing with it a while and it was using /dev/video0 when raspberry pi was booted. I uninstalled uv4l and I can successfully run rpos.js. Now the rpos is working. However, I cannot get it working on my Onvif device manager. It is saying

"The envelope version of the incoming (Soap 11 (http://schemas.xmlsoap.org/soap/envelope/)) does not match that of the encoder (Soap 12 (http://www.w3.org/2003/05/soap-envelope)). Make sure the binding is configured with the same version as expected messages."

I have check the wsdl files in rpos and is it using POST 1.1 ? If so, how I do add in POST 1.2 support?

I have already checked in wireshark and raspberry is indeed sending xml in

"xmlns:soap = http://schemas.xmlsoap.org/soap/envelope/"

mrlion420 commented 8 years ago

I solved it by changing the source file in rpos-0.1.0/node_modules/soap/lib/client.js. Changed http://schemas.xmlsoap.org/soap/envelope/ to http://schemas.xmlsoap.org/soap/envelope.

RogerHardiman commented 8 years ago

RPOS 0.1.0 is quite old now. Version 0.2.0 was released on 10th May and this included some changes to the XML in node_modules/soap_client which I needed to make for ONVIF Device Manager.

I do not know if Breeeze has made an official release of 0.2.0. I just use git clone and get the source direct from Github.