Raspberry network/ethernet connection

Hi there!

We just finalised the assembly and preliminary testing of the bluerov2 quite successfully I’d say.
Really excellent quality.

As we are trying to convert it to an AUV, we need (among others…) some changes in the IP addressing of the Raspberry.

Currently we connect to the bluerov2 as follows:

The Fathom-X Ethernet interface is connected to a WLAN AP (Access Point).

The notebook PC we use is connected to this AP

(AP IPaddr: 192.168.2.245, PC WLAN IP addr: 192.168.2.1, bluerov IP addr: 192.168.2.2)

The PC has also an Ethernet interface with IP addr 10.1.1.X , and this is an Internet Shared Connection. The problem is that through this configuration I cannot do “sudo apt-get update” etc. I suppose that I need to configure Raspberry’s eth0 to have 192.168.2.1 as Gateway? What is the appropriate way to configure this without harming the operation of QGC etc.?

Also, in both the standard direct Ethernet connection and the connection through WLAN AP, the video streaming quality is not good. Too much artifacts (pixelation) when for example I move my hand in fornt of the camera. Is there a way to avoid this?

(It may be my PC video codec or CPU speed?)

I’m stopping here for now – there may be a lot additional questions in the pipeline :slight_smile:

Vagelis

Hi Vagelis,

Thanks for the post! This is a bit tricky because Windows does not have much flexibility in the way shared connections have IP assignments. You can change the IP of the Raspberry Pi entirely, including the start-up scripts for mavproxy and video streaming. I can describe how to do that if you’d like.

Alternatively, you can enable wifi on the Raspberry Pi so that it connect to the internet via wifi and download updates that way. That’s what we’re hoping to do in the future since internet sharing is hard to set up on both Windows and Linux.

Depending on when you got your BlueROV2, you may have a slightly older version of the video streaming code and we have since fixed the pixelation issue on Windows. I would recommend reflashing your SD card with the most recent image from here: http://ardusub.com/firmware/#images

Instructions for that are here: Raspberry Pi Documentation - Getting Started

Let me know if these things help!

-Rusty

Hi Rusty, and thanks for your response.

I finally managed to connect the companion Raspberry to the internet (and update it) by editing /etc/dhcpcd.conf file and adding to the end the following lines:

interface eth0

static_ip_address=192.168.2.2/24

static routers=192.168.2.1

static domain_name_servers=192.168.2.1

After rebooting (sudo reboot) everything run ok!

In my configuration (described in my first message) I have to make sure that the computer is connected to both the wireless and the wired networks.

I also fixed the pixelation problem by modifying start_video.sh (raspvid options) as follows:

–mode 2

–bitrate 25000000 (not sure if it is really necessary)

-fps 30 (not sure if it is really necessary)

–intra 1

Please let me know what you think!

BR,

Vagelis

 

Vagelis,

This works on Windows?! If so, that’s fantastic and I would definitely like to add this to the image.

Regarding the video pixelation, that will solve it but will drop the frame rate to 15fps. I would recommend trying the following settings as well:

-mode 5
-bitrate 15000000 (or lower, this is what seems to help)
-fps 30 (not really needed)
-intra 1 (no key frames = high bandwidth but no distortion)

Let me know if that helps at all. These are the default settings now but they haven’t always been the defaults.

-Rusty

It really works, you just need to make sure that the PC is connected also to the wireless access point (if you connect the ethernet cable, win10 disconnects from wireless network)

Below I attach a draft schematic of our setup.

Vagelis


1 Like

On the issue of video quality:

I thought that “intra 1” is the key parameter to avoid pixelation.

You mention that lowering “bitrate” parameter will enhance the quality. Is that true?

Is there a documentation of camera modes you are using?

I need to have smooth video in 1080P quality, in order to perform target recognition (through image analysis - used for navigation purposes) and assess the cage net pattern in order to discover holes again through image analysis. All this will take plave in an aquaculture environment.

Vagelis

PS: Maybe we need to start an other topic for the video issues?

Vagelis,

This forum post is the only reference I have for the Raspberry Pi v2 Camera Modes: New 8MP Camera - Q&A thread - Raspberry Pi Forums

We were able to resolve pixelation issues by reducing bitrate from 25M to 15M.

Happy to start another topic to explore the video issues/options further.

-Rusty

Guys - I was working on a project to improve live streaming capabilities at a local university. In our research we came up with upload bitrate recommendations for a variety of viewing resolutions. In the case of what most people would consider “HD” 1080p video, the recommended upload bitrate was 5 Mbps. Nowhere close to 15 Mbps, let alone 25. Why such a high bitrate? Am I missing something?

@mike3 - Good question. We haven’t done a ton of comparison between different bitrates. We chose to go high for a few reasons:

  • We have the bandwidth available through the tether
  • We’ve set the compression to send keyframes very frequently to minimize the chance of video artifacts, which increases required bandwidth
  • We wanted to minimize the amount of compression required to minimize the work that the Raspberry Pi has to do (I’m not sure if this makes sense)

I think 5 Mbps will work but is likely to have slightly reduced image quality. Have you given this a test with the Raspberry Pi yet?

Hi Rusty, as described in your post above, I would like to change the IP address for the Raspberry Pi. Do I need to edit the /etc/dhcpcd.conf file like Vagelis did or is there more to it than that? I need to change the IP because I plan to broadcast 2 QGC signals for separate robots over a single Wi-Fi network to 2 separate computers.

Thanks for your help.

The software has changed a lot since this conversation from a year ago.

With the current software, you can use the webpage at http://192.168.2.2:2770/network to change the Pi’s IP (requires reboot).