BreeeZe / rpos

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

Installation instructions? #40

Closed jov58 closed 5 years ago

jov58 commented 6 years ago

I found this project because I want to have a few Raspberries (preferably Zero W's) with Pi camera's around my house, connected to Surveillance Station on my SynologyDS1511+. I am fairly new to Linux.

But the installation instructions confuse me. I find something here, but also here. Do I have to combine these or use only one of them?

jov58 commented 6 years ago

OK, I came to a working system on a Raspberry Pi 3 running a fresh Jessie (not Lite) image:

  1. Install live555 with the instructions on this page.
  2. Install nodejs with the instructions on that same page.
  3. Follow the instructions on this page, starting at the third line from step 2, also at sudo apt-get install liblivemedia-dev.
  4. Add the Raspberry as a ONVIF camera with port 8081.

I also noticed that you have to cd to the rpos directory before running rpos.js. Something like sudo node /home/pi/rpos/rpos.js while in another directory than rpos, does not work. I added these two lines to /etc/rc.local to have rpos started at boot:

   cd /home/pi/rpos
   sudo node rpos.js &

and it works :) ! I can restart from Surveillance Station.

BTW, I always get this error at the moment Surveillance Station contacts the Raspberry:

rtspServer: RTCPInstance::RTCPInstance error: totSessionBW parameter should not be zero!

Output on the Raspberry Pi 3 when connected to Surveillance Station:

Read IP address 192.168.16.138 from wlan0
Manufacturer : Raspberry Pi
Model : 3
HardwareId :
SerialNumber : 0000000012345678
FirmwareVersion : 2.0.0
Starting camera settings webserver on http://192.168.16.138:8081/
Binding DeviceService to http://192.168.16.138:8081/onvif/device_service
Binding MediaService to http://192.168.16.138:8081/onvif/media_service
Binding PTZService to http://192.168.16.138:8081/onvif/ptz_service
discovery_service started
Starting Live555 rtsp server
media_service started
device_service started
ptz_service started

rtspServer: RTCPInstance::RTCPInstance error: totSessionBW parameter should not be zero!

=============================

On a Raspberry Pi Zero W it's almost the same, albeit rather slow. I used a fresh Jessie Lite image here. And right before running the git command during point 3 above, you have to do this:

sudo apt-get update && sudo apt-get install -y git

Surveillance Station accepts the Pi Zero as an ONVIF camera, but then it fails: it can't activate it (see the error below). In the properties of the camera (on Surveillance Station) I've selected lowest bandwidth everywhere and deselected any fancing looking stuff, in case it might be some timing problem - it didn't help. I didn't yet try to change any parameter on the Pi Zero.

Output on the Raspberry Pi Zero W when connected to Surveillance Station:

Read IP address 192.168.16.130 from wlan0
Manufacturer : Raspberry Pi
Model : Zero W
HardwareId :
SerialNumber : 0000000087654321
FirmwareVersion : 2.0.0
Starting camera settings webserver on http://192.168.16.130:8088/
Binding DeviceService to http://192.168.16.130:8088/onvif/device_service
Binding MediaService to http://192.168.16.130:8088/onvif/media_service
Binding PTZService to http://192.168.16.130:8088/onvif/ptz_service
discovery_service started
device_service started
Starting Live555 rtsp server
media_service started
ptz_service started
rtspServer: VIDIOC_STREAMON: Invalid argument
VIDIOC_DQBUF: Invalid argument

Comments on what I did are welcome! As are ideas to get it working on the Pi Zero W ...

RogerHardiman commented 5 years ago

Hi Sorry for the 12 month delay in getting back to you on this. I don't own a Pi Zero W so I cannot try this myself. What I can see from your error is that the RTSP server had problems talking to the v4l2 driver and /dev/video0

rtspServer: VIDIOC_STREAMON: Invalid argument VIDIOC_DQBUF: Invalid argument

So maybe there was an issue with the camera or an issue with the bcm2835-v4l2 driver.

I wondered if you had given it another try in the last year and if there was any new updates?

jacobalberty commented 5 years ago

I have it working with the bcm2835-v4l2 driver and the mpromonet/v4l2rtspserver on a pi zero w, only caveat I found is I'm not sure 128mb is enough gpu ram, I upped it to 256mb

RogerHardiman commented 5 years ago

good to hear it is working now on the Pi Zero W. Maybe the original poster had an old linux/bcm driver so I'll close this Issue report down.

michaelbolanos commented 5 years ago

I get this, can anyone assist please?

~/rpos $ sudo node rpos.js module.js:549 throw err; ^

Error: Cannot find module '/home/pi/rpos/rpos.js' at Function.Module._resolveFilename (module.js:547:15) at Function.Module._load (module.js:474:25) at Function.Module.runMain (module.js:693:10) at startup (bootstrap_node.js:188:16) at bootstrap_node.js:609:3