Home        Store        Docs        Blog

Sonar connection via the RPi ethernet?


#1

Hello everyone,
I have a rather Linux-related problem:
I’d like to use a BlueView P900E-20 Sonar with the BlueROV2 (advanced electronics). It communicates with a standart ethernet connection. So I attached a USB-to-ethernet adapter to the RPi onboard and plugged it in - so far so good. The question is:
How can I configure the RPi to “share” its second ethernet connection through the tether?

I already tried to bridge eth0 and eth1 by editing the file /etc/network/interfaces. I got that going, could connect to the BlueView and recieve data, BUT I couldn’t get the data from the RPi anymore. I could only connect to the RPi OR to the BlueView. Did I just mess up with the IPs while bridging?
Does anyone have another idea of getting connection to the BlueView? I also tried to directly connect through the free twisted pairs, but the tether seems to be too long for a stable connection (that’s why there is the Fathom-X board I guess…). Also I thought about installing a simple ethernet hub inside the BlueRov, attaching the RPi and the BlueView to that one. But it will not be easy to get it inside the electronics-cylinder when using it for real.

Any suggestions for the ethernet-“sharing” in linux? Or other ideas?

Thanks and greetings,
OldPowel


(Kevin) #2

Hi @OldPowel, welcome!

Wow, that’s great you have a BlueView to play with! I know @rjehangir and @paul-unterweiser have done some experimentation with getting additional sonars on the BR2.

My recommendation is to install an ethernet hub inside the BR2 and connect everything to that. I just haven’t done much research into which one to get yet, but yes, space is a concern.


(Rusty) #3

Hi @OldPowel - cool! I’d love to see a BlueView working on the BlueROV2.

I haven’t tried to bridge the Ethernet ports before so I’m not sure how well that will work. Another option to consider is to use an additional Fathom-X board. They are designed to allow multiple Fathom-X interfaces on the same two wires, and then you won’t need an Ethernet switch. You could also mount that in a separate enclosure to keep it separate from the rest of the ROV.

Do you know more details about the BlueView’s communication such as IP, port, UDP/TCP?

-Rusty


#4

Hi @kevink, hi @rjehangir ,
thanks for your fast replies!
I will try out an ethernet hub today, perhaps that’d be really the easiest solution.
And a second Fathom-X would be the most professional and stable one. But more expensive too!
Still, it should be possible to get the connection through the RPi, shouldn’t it? I keep searching for a way to do that for a few hours.

The Sonar communicates over an adjustable IP with a fixed port 1149. Is that what you asked for?

I’ll keep you updated,
greetings
OldPowel

UPDATE:
The Hub works perfectly.
I’ll keep you updated.


(Jacob) #5

You can use port forwarding. There are many tools you can use to accomplish this. I have had some success testing the examples in the answers here and here. Do you know if the sonar is using udp or tcp?

Here you can forward anything coming in over port 1149 on the Pi to port 5555 on the surface computer:

ncat -l 192.168.2.2 1149 --sh-exec "ncat 192.168.2.1 5555"

Same thing using UDP instead of TCP:

ncat -ul 192.168.2.2 1149 --sh-exec "ncat -u 192.168.2.1 5555"

You may need to use the sonar’s ip address instead, or find out what port the data is coming over on the Pi.


(Jeff Snyder) #6

OldPowel,

What are the chances that your BlueView has the VDSL modem integrated inside? We are currently building up our BlueROV2 and I’m already looking down the road to how we are going to integrate either a Tritech Gemini (that we currently have) or possibly turn our attention towards the new generation Gemini sonars or the BluePrint Oculus series of sonars. My thought was to use the embedded long-haul VDSL modems that Tritech supplies (and they are very similar to what BlueView uses), thus enabling the ethernet-bandwidth across a single twisted pair. The Fathom-X tether has spare, unused twisted pairs so perhaps using one of those with the VDSL modem sets that BlueView, Tritech, or (hopefully) BluePrint provide would be a solution?

Jeff


#7

You are right, there are VDSL-Versions of the BlueView P900e. Unfortunately, ours isn’t one. Like I wrote in the first post, I already tried to use two of the spare twisted pairs of the tether and it didn’t work stable.
With a VDSL-modem it should definitely work for a 100m tether, since normal ethernet connection between to PCs works perfectly using the spare twisted pairs (~90MBit/s).

OldPowel


(Rusty) #8

@OldPowel - Not that the maximum cable length per the Ethernet standard is about 90 meters. It definitely works beyond that, but it’s not specifically rated for it.


#9

I didn’t manage to get an ethernet connection trough the RPi USB Ports, so I bought a “renkforce 3 port fast ethernet switch”. It’s small enough to find a place in the crowded electronic tube and provides a stable connection when using the Fathom-X board. It provides 100MBIT/S and doesn’t limit the connection, because the Fathom-X is only capable of 80MBIT/S. It consumes max. 500mA, so I will use the 5V power output of the RPi USB. Alternativly, I could drain the power from either the 3DR or the UBEC power module.

Greetings
OldPowel

Update:
Tests have shown, that the BlueView datarate goes down, when using it together with the RPi (and QGroundControl) over a switch. Still, the connection ist stable as long as the CPU of your Laptop can handle all the data coming in. A slow one of mine sometimes lost connection to the RPi which is critical during real operation! A faster Laptop doesn’t have these problems.


(Marcus) #10

Hi,
We are looking to purchase a BlueView M900-2550 (130 degree) sonar. So your connection is sonar> ethernet>switch>8 wire full ethernet tether? Whats your maximum tether length achieved?

And you’ve found that using the Fathom-X wasn’t a stable connection with the sonar?

Thanks


(Rusty) #11

Hi Marcus,

The BlueViews use a lot of bandwidth in the tether. I think it would probably work alright with a shorter tether but could have issues with a longer one. In that case, you can use a standard Ethernet connection or try to use a separate Fathom-X connection in a separate twisted pair, although we haven’t actually tested that before. I can have one of my engineers look into that possibility.

-Rusty


(Marcus) #12

ok thanks Rusty. Am also waiting to hear back from the supplier. Will share what we learn.

Cheers


(Abyss Solutions) #13

Hi all,

Thought I’d re-check this thread to see if anyone managed to get an ethernet bridge working on the companion computer? Am hoping to use a USB-to-Ethernet adapter instead of a second fathom X because of the reduced form factor. Have had a brief look into it today, but will be diving into the problem tomorrow!

@kevink said it back in '17, but it’s still relevant… space is a concern!

-Jordan


(Kevin) #14

@Jordan We haven’t gotten an Ethernet bridge to work on the Raspberry Pi, we have been using some small Tenda 5-port Ethernet Switches for some Ethernet payloads we were testing a few months ago. At the time we were only test the white standard 5-port Ethernet switch (S105), but I see now they added on a Gigabit switch as well (SG105). The standard switch was like $8 on Amazon.

We removed the white plastic case and just installed the PCB on top of the Fathom-X. The power input is 5V so we hacked off a short section of the included power adapter for the barrel plug and connected a UBEC to it.

b_201506081600303635


(Abyss Solutions) #15

@kevink thanks for that update - looks like a good solution for someone who needs >1 extra Ethernet port.

If someone is only in need for a single extra eth port, I actually managed to get the bridging working this morning!
This could be a better option for single port expansion as there are some pretty small USB-to-Ethernet adapters out there.

<>><><<><><><><><<><<><><><><><><><<><><><><><><><><><><><><><><>

WARNING: I recommend putting a screen & keyboard on the companion computer to implement this instead of just SSHing in. If this doesn’t work first time, you will have to put a screen etc on anyway to get the network working again.

In order to allow a second Ethernet connection from the pi to the up2 to be established, the following USB-to-Ethernet adapter is used: link

Firstly install bridge-utils

$  sudo apt-get install bridge-utils

Use a text editor to append the following code to the bottom of /etc/network/interfaces

allow-hotplug eth0
allow-hotplug eth1

iface eth1 inet manual

#Bridge Setup
iface br0 inet static
     bridge_ports eth0 eth1
     address 192.168.2.2
     netmask 255.255.255.0
     gateway 192.168.2.1

In order to bring the bridge up on every reboot, we need to make a cronjob as root user. Type the following into terminal:

$ sudo crontab -e

Append this code at the bottom of the cron tab, and it will bring the bridge up on startup every time


$ @reboot sudo ifup br0; sudo ifconfig eth0 down; sleep 10; sudo ifconfig eth0 up

NOTE: This is a hack. Usually the bridge br0 should hold the 192.168.2.2 ip address, and eth0 and eth1 are just interfaces on the bridge. You would usually zero IP the interfaces e.g. ifconfig eth0 0.0.0.0 in order for the bridge to work properly - There’s a good explanation here, or here. I couldn’t get this to work within the existing bluerov software architecture because (as far as I could see) it relies on eth0 having a static ip. For whatever beautiful reason if you don’t zero eth0 it all still works BUT not unless you bring eth0 down, and then back up again …this is what happens in the crontab.

Enjoy!

-Jordan