That's right, and I've spent a long time figuring out how to achieve what I want. In a normal domestic surveillance system you have so many options, anything from PoE cameras, to WiFi cameras, to USB webcams connected to more powerful computer(s), to individual Pi Zeroes with one CSI camera each. My situation is quite different in a number of ways; I have limited power (solar panels), limited bandwidth (mobile network), limited space and limited CPU cycles. And the boat is made from steel, so WiFi, Z-Wave and other wireless technologies may not work well. Everything has to be small, power efficient, CPU efficient, low bandwidth and connected by wires. The whole system needs to idle at very low power consumption (way under 10W). Etc etc etc.
So for example, in a house I would maybe have run individual Pi's with a camera each, all running Motion
and all streaming HD video on demand over WiFi and the Internet. On the boat I only want one
Pi that is "always on", and it should be idling at very low CPU usage. All cameras should sleep unless requested (with motion detection done by PIRs and accelerometers instead of Motion), and only still images are captured, with very little data being streamed out over the internet connection.
But how? With only one CSI connector it seems impossible.
Well, there's a company in Turkey
who have developed an ingenious board which is perfect
for my needs. It's called the IVPort
and it splits the single CSI connector into four which can be switched between (multiplexed) using a few GPIO pins. When channels are off, the cameras can be unpowered (settable by a jumper on the board), so only one camera at a time will be "on" (and even that can be turned off of course). This means there will need to be a short delay between turning a camera on and capturing an image, to give the camera time to adjust the exposure, but in tests it seems a third of a second is plenty, which I am more than happy with.
So, in Node-RED, I will have certain sensors and events trigger still capture from certain cameras (which camera gets used is set simply by switching two GPIOs, 00,01,10,11). A loop ensures that a sequence is taken for a pre-set time (say one picture every five seconds for one minute), and those images are immediately passed on over the VPN (if available) to my cloud server, and via email to myself. This loop can include any number of cameras, so nothing is missed. If additional light (visible or IR) is needed, Node-RED will switch it on for me (the light dimmers will be on a Modbus network). I even have (currently dormant) plans to make the mast-top camera(s) titlable with a servo
. And I can also set Node-RED to send me a still capture from each camera on a schedule, so I'd get a daily visual status update, or email it and request a capture from certain camera(s).
This is the plan, and I already have the first camera working exactly like this, but I'm waiting for the delivery of the IVPort I ordered (only two ports, to start with), so haven't been able to test that part yet. Pretty sure it will work though!
In case anyone is wondering about the power consumption; I currently have the enclosure powered from my bench supply here, set at 12.5V (current breakpoint to switch to UPS power is 12.4V in, though I might lower that to 12.2V later). Total current draw with the SLA battery on float charge is under 500mA, so about 6W. That's with the following equipment installed:
- Sierra Wireless RV50 3G/4G router (always on)
- Netgear GS-105 5-port gigabit switch (always on)
- Raspberry Pi 2 Model B (always on)
- OpenUPS BMS board (always on)
- 12V -> 5V DC/DC converter (always on)
- One CSI connected camera (normally off)
- One 8x8cm axial fan (normally off)
The Pi is running Raspbian with Domoticz, Mosquitto and Node-RED, as well as a number of minor daemons (upsd, sshd, gpsd, rsyslogd, ntpd, iptables, nginx). CPU usage idles below 0.4%. It pushes updates via email and SMS when certain events occur and it also listens to incoming SMS and email messages and responds with requested information (it checks its email account every two minutes). It is also connected to a cloud server over a VPN (endpoint on the RV50), but at present I'm not streaming any data over it.