Raspberry Pi Stereo Camera Live Stream
Stereo camera mode requires Raspberry Pi Compute Module as it exposes both CSI ports.
This section is based on the Raspberry Pi Foundation cmio-camera instructions from https://www.raspberrypi.org/documentation/hardware/computemodule/cmio-camera.md Image below copied from Raspberry Pi Foundation.
Connect jumper wires:
CD1_SDA (J6 pin 37) <---> GPIO0 (J5 pin 1)
CD1_SCL (J6 pin 39) <---> GPIO1 (J5 pin 3)
CAM1_IO1 (J6 pin 41) <---> GPIO4 (J5 pin 9)
CAM1_IO0 (J6 pin 43) <---> GPIO5 (J5 pin 11)
CD0_SDA (J6 pin 45) <---> GPIO28 (J6 pin 1)
CD0_SCL (J6 pin 47) <---> GPIO29 (J6 pin 3)
CAM0_IO1 (J6 pin 49) <---> GPIO30 (J6 pin 5)
CAM0_IO0 (J6 pin 51) <---> GPIO31 (J6 pin 7)
Copy dual-camera device tree blob:
scp dt-blob-dualcam-pin4pin5.dtb root@rpi:/boot/dt-blob.bin
Follow instructions here: http://www.element14.com/community/community/raspberry-pi/raspberry-pi-compute-module/blog/2014/06/26/raspberry-pi-compute-module--getting-started
http://archive.raspberrypi.org/debian/pool/main/r/raspi-config/raspi-config_20150131-4_all.deb
raspi-config
http://archive.raspberrypi.org/debian/pool/main/r/raspberrypi-firmware/raspberrypi-bootloader_1.20150421-1_armhf.deb http://archive.raspberrypi.org/debian/pool/main/r/raspberrypi-firmware/libraspberrypi0_1.20150421-1_armhf.deb http://archive.raspberrypi.org/debian/pool/main/r/raspberrypi-firmware/libraspberrypi-bin_1.20150421-1_armhf.deb
Edit file /etc/default/tmpfs
RAMTMP=yes
wget http://nodejs.org/dist/v0.10.17/node-v0.10.17-linux-arm-pi.tar.gz
tar xzf node-v0.10.17-linux-arm-pi.tar.gz --directory /opt
/opt/node-v0.10.17-linux-arm-pi/bin/node index.js
The web server listens on port 3000. Edit /etc/rc.local to forward port 80 to port 3000.
# Allow HTTP traffic
iptables -A INPUT -m state --state NEW -p tcp --dport 80 -j ACCEPT
# Camera streamer listens on port 3000, forward port 80 there.
iptables -t nat -A PREROUTING --src 0/0 -p tcp --dport 80 -j REDIRECT --to-port 3000
iptables -t nat -A OUTPUT -d localhost -p tcp --dport 80 -j REDIRECT --to-port 3000
Point your web browser to http://rpi
echo 300 > /proc/sys/vm/dirty_writeback_centisecs
echo 500 > /proc/sys/vm/dirty_expire_centisecs