Darquesse166
Posts: 22
Joined: Tue Jun 20, 2017 11:38 pm

Camera Cable Length = 15m possible?

Sat Jul 08, 2017 6:21 am

Hey,

I am building a ROV for school, and have decided to use raspberry pi as my camera. The problem i have encountered is the cable length. What i would like to do is keep the raspberry pi board on the surface, and have the camera on my sub, connected via a 15m cable. Is this possible? i think i read something about a HDMI cable being used instead of the ribbon? Otherwise, i can keep the board on the sub, and use a cable to connect the board to my screen. is this a possible solution? i am using a Touchscreen Display for Raspberry Pi.

Thanks
Darq

scotty101
Posts: 4004
Joined: Fri Jun 08, 2012 6:03 pm

Re: Camera Cable Length

Sat Jul 08, 2017 9:25 am

15m is far too long to get a reliable connection to the camera over.

Could you fit a pi zero on your ROV and have the camera next to it?
Electronic and Computer Engineer
Pi Interests: Home Automation, IOT, Python and Tkinter

cpunk
Posts: 85
Joined: Thu Jun 29, 2017 12:39 pm

Re: Camera Cable Length = 15m possible?

Sat Jul 08, 2017 2:50 pm

If you do put the Pi in the ROV, beware of using WiFi, as water absorbs 2.4 GHz signals especially well. To my knowledge, Raspberry Pi only has 2.4 GHz WiFi (and most likely, 5 GHz would not fare much better - real submarines use VLF (Wikipedia says 3-30 KHz) and there's no hope of homebrewing anything to transmit video over that. :P

Also, salt water is more of a nuisance to radio than fresh water, since it conducts electricity better.

If you absolutely need wireless, consider radio modems of lower frequencies and significant power (e.g. 1W or maybe 2W, but some frequencies and power levels might be illegal in some lands).

If you don't need wireless, use an Ethernet cable as a tether - transmit video over the network. Finding the slimmest properly made Ethernet cable will then be the biggest challenge. :)

If you want Raspivid to transmit over a network, there are many choices. It has its built-in -u command line option (UDP), and you can also install gstreamer and its various plugins, direct the standard output of "raspivid" into the standard input of "gst-launch-1.0" and have it wrap the H264 stream into RTP packets, then receive, unwrap and display them on the other side. :) I have done it, and while the command lines are often complicated and messy, it works reliably. :)

Example transmit side pipeline (expects host IP as command line argument):

Code: Select all

raspivid -f -n -t 0 -w 640 -h 480 -b 1000000 -fps 30 -ex auto -pf baseline -o - | \
gst-launch-1.0 -v fdsrc fd=0 ! h264parse ! rtph264pay config-interval=10 pt=96 ! udpsink host=$1 port=9000
Example receive side pipeline:

Code: Select all

gst-launch-1.0 -v udpsrc port=9000 \
caps='application/x-rtp, media=(string)video, clock-rate=(int)90000, encoding-name=(string)H264' \
! rtph264depay ! avdec_h264 ! videoconvert ! autovideosink sync=false

cpunk
Posts: 85
Joined: Thu Jun 29, 2017 12:39 pm

Re: Camera Cable Length = 15m possible?

Sat Jul 08, 2017 3:22 pm

P.S. As for the camera cable length, I have tested it up to 75 cm. Longer ones were not sold, and the 75 cm ones worked in the conditions I had.

jamesh
Raspberry Pi Engineer & Forum Moderator
Raspberry Pi Engineer & Forum Moderator
Posts: 26826
Joined: Sat Jul 30, 2011 7:41 pm

Re: Camera Cable Length = 15m possible?

Sat Jul 08, 2017 3:27 pm

Camera won;t work at those distances. What you need to do, if you are happy with a wired connection, is an Ethernet cable. Encode to h264 on a Zero in the ROV, transmit the signal up the cable, to another Pi on the surface which does the decode and display.
Principal Software Engineer at Raspberry Pi (Trading) Ltd.
Contrary to popular belief, humorous signatures are allowed.
I've been saying "Mucho" to my Spanish friend a lot more lately. It means a lot to him.

Darquesse166
Posts: 22
Joined: Tue Jun 20, 2017 11:38 pm

Re: Camera Cable Length = 15m possible?

Mon Jul 10, 2017 12:08 am

i am using a wired connection, to GHz signals arent an issue.

So if i understand right, the connection is camera -> Zero -> ethernet cable -> Normal Pi -> display
Is that right?

Also, what exactly is zero, is it just a simplified pi board?

Thanks

cpunk
Posts: 85
Joined: Thu Jun 29, 2017 12:39 pm

Re: Camera Cable Length = 15m possible?

Mon Jul 10, 2017 8:35 am

Yep, they are simplified boards... but unfortunately, Pi 0 and Pi 0W don't have Ethernet... so it's more like:

camera - Pi 3 - ethernet cable - Pi 3 - display

(this does increase the minimum size of the ROV considerably, which seems unavoidable in this case)

jamesh
Raspberry Pi Engineer & Forum Moderator
Raspberry Pi Engineer & Forum Moderator
Posts: 26826
Joined: Sat Jul 30, 2011 7:41 pm

Re: Camera Cable Length = 15m possible?

Mon Jul 10, 2017 8:42 am

Camera -> Pi -> H264 encode -> Pi ethernet port -> ethernet stream -> Pi ethernet port -> H264 decode -> display
Principal Software Engineer at Raspberry Pi (Trading) Ltd.
Contrary to popular belief, humorous signatures are allowed.
I've been saying "Mucho" to my Spanish friend a lot more lately. It means a lot to him.

6by9
Raspberry Pi Engineer & Forum Moderator
Raspberry Pi Engineer & Forum Moderator
Posts: 9232
Joined: Wed Dec 04, 2013 11:27 am
Location: ZZ9 Plural Z Alpha, aka just outside Cambridge.

Re: Camera Cable Length = 15m possible?

Mon Jul 10, 2017 9:16 am

jamesh wrote:Camera -> Pi -> H264 encode -> Pi ethernet port -> ethernet stream -> Pi ethernet port -> H264 decode -> display
eg https://www.gertbot.com/toaste.html, although there are many other solutions kicking around.
Software Engineer at Raspberry Pi Trading. Views expressed are still personal views.
I'm not interested in doing contracts for bespoke functionality - please don't ask.

Darquesse166
Posts: 22
Joined: Tue Jun 20, 2017 11:38 pm

Re: Camera Cable Length = 15m possible?

Mon Jul 10, 2017 10:28 am

So i need to have two pi 3 boards, one on the surface, and one inside the ROV?

"H264 encode"
is this just coding?

Thanks

jamesh
Raspberry Pi Engineer & Forum Moderator
Raspberry Pi Engineer & Forum Moderator
Posts: 26826
Joined: Sat Jul 30, 2011 7:41 pm

Re: Camera Cable Length = 15m possible?

Mon Jul 10, 2017 10:42 am

Yes, and there are many examples around on how to stream H264 between PIs

H264 is a compressed video format, used on things like BluRay disks, and a lot of streaming services. The Pi has a HW Encode/Decode built in.
Principal Software Engineer at Raspberry Pi (Trading) Ltd.
Contrary to popular belief, humorous signatures are allowed.
I've been saying "Mucho" to my Spanish friend a lot more lately. It means a lot to him.

User avatar
topguy
Posts: 6607
Joined: Tue Oct 09, 2012 11:46 am
Location: Trondheim, Norway

Re: Camera Cable Length = 15m possible?

Mon Jul 10, 2017 10:46 am

The Pi Zero still have a USB port you can connect an USB-Ethernet adapter to if you want. But if price/size/power is not a big issue then a Pi3 will be more practical to work with,

The camera records h.264 (Mpeg4) encoded video, but more precisely the encoding happens in the GPU of the Pi.
The decoding can then easily also be done by the GPU on the receiving end.

Darquesse166
Posts: 22
Joined: Tue Jun 20, 2017 11:38 pm

Re: Camera Cable Length = 15m possible?

Mon Jul 10, 2017 10:49 am

ok, i think im all good now.

Thanks heaps for all the help. :D

Darquesse166
Posts: 22
Joined: Tue Jun 20, 2017 11:38 pm

Re: Camera Cable Length = 15m possible?

Fri Jul 21, 2017 10:12 am

continuing on,

i found this, https://www.youtube.com/watch?v=r80dcfzClD4 and used those codes to stream across the ethernet cable. so all good in that regard.

What i was wondering, how would i need to change these codes to allow me to take photos while streaming? i did have a python script that allowed me to do this by pressing a button, if i can incorporate it somehow

Thanks

Return to “Camera board”