New Companion Computer software: Rpanion-server

Just flashed the image to test it out. I can see the rpanion wifi, but Windows 10 starts with asking for a PIN, I switch to passphrase, connection with this network not possible. I tested three different wifi adapters. My android phone connects without a problem.
Windows with ethernet works too.
One thing I noticed: the default start address for DHCP leases is the same as the rpanions own address and it always goes back to this address, no matter what I enter there.

Edit: I configured a new AP and activated it, now Windows connects.

Telemetry forwarding works without a problem, tested with a single endpoint.
Regarding video streaming: I have a known working Raspicam V2 connected to the RPi. I can select “mmal service 16.1” as device, but all resolutions are 0x0.

Are you able to run the following command on the Pi and show me the output? It will tell me the video devices and modes detected by your Pi

 gst-device-monitor-1.0

I’ll look into that and get back to you.

I tested video streaming with a USB camera and it is working. Resolutions are selectable and I can view the stream in VLC and Qgroundcontrol. Missionplanner is refusing to show the gstreamer stream for now.
Here is the output without the USB cam connected:

gst-device-monitor-1.0
Probing devices…

Device found:

    name  : Raspberry Pi Camera Module
    class : Video/Source
    caps  : video/x-h264, width=(int)[ 1, 1920 ], height=(int)[ 1, 1080 ], f                                                                                                                                                             ramerate=(fraction)[ 0/1, 1000/1 ], stream-format=(string)byte-stream, alignment                                                                                                                                                             =(string)au, profiles=(string){ high, main, baseline };
    gst-launch-1.0 rpicamsrc ! ...

Device found:

    name  : mmal service 16.1
    class : Video/Source
    caps  : video/x-raw, format=(string)YUY2, width=(int)[ 32, 2592, 2 ], he                                                                                                                                                             ight=(int)[ 32, 1944, 2 ], framerate=(fraction)[ 1/1, 90/1 ];
            video/x-raw, format=(string)UYVY, width=(int)[ 32, 2592, 2 ], he                                                                                                                                                             ight=(int)[ 32, 1944, 2 ], framerate=(fraction)[ 1/1, 90/1 ];
            video/x-raw, format=(string)I420, width=(int)[ 32, 2592, 2 ], he                                                                                                                                                             ight=(int)[ 32, 1944, 2 ], framerate=(fraction)[ 1/1, 90/1 ];
            video/x-raw, format=(string)YV12, width=(int)[ 32, 2592, 2 ], he                                                                                                                                                             ight=(int)[ 32, 1944, 2 ], framerate=(fraction)[ 1/1, 90/1 ];
            image/jpeg, width=(int)[ 32, 2592, 2 ], height=(int)[ 32, 1944,                                                                                                                                                              2 ], framerate=(fraction)[ 1/1, 90/1 ];
            image/jpeg, width=(int)[ 32, 2592, 2 ], height=(int)[ 32, 1944,                                                                                                                                                              2 ], framerate=(fraction)[ 1/1, 90/1 ];
            video/x-raw, format=(string)BGRx, width=(int)[ 32, 2592, 2 ], he                                                                                                                                                             ight=(int)[ 32, 1944, 2 ], framerate=(fraction)[ 1/1, 90/1 ];
            video/x-raw, format=(string)BGR, width=(int)[ 32, 2592, 2 ], hei                                                                                                                                                             ght=(int)[ 32, 1944, 2 ], framerate=(fraction)[ 1/1, 90/1 ];
            video/x-raw, format=(string)RGB, width=(int)[ 32, 2592, 2 ], hei                                                                                                                                                             ght=(int)[ 32, 1944, 2 ], framerate=(fraction)[ 1/1, 90/1 ];
            video/x-raw, format=(string)NV21, width=(int)[ 32, 2592, 2 ], he                                                                                                                                                             ight=(int)[ 32, 1944, 2 ], framerate=(fraction)[ 1/1, 90/1 ];
            video/x-raw, format=(string)NV12, width=(int)[ 32, 2592, 2 ], he                                                                                                                                                             ight=(int)[ 32, 1944, 2 ], framerate=(fraction)[ 1/1, 90/1 ];
            video/x-raw, format=(string)YVYU, width=(int)[ 32, 2592, 2 ], he                                                                                                                                                             ight=(int)[ 32, 1944, 2 ], framerate=(fraction)[ 1/1, 90/1 ];
            video/x-h264, stream-format=(string)byte-stream, alignment=(stri                                                                                                                                                             ng)au, width=(int)[ 32, 2592, 2 ], height=(int)[ 32, 1944, 2 ], framerate=(fract                                                                                                                                                             ion)[ 1/1, 90/1 ];
    properties:
            udev-probed = true
            device.bus_path = /sys/devices/virtual/video4linux/video2
            sysfs.path = /sys/devices/virtual/video4linux/video2
            device.subsystem = video4linux
            device.product.name = "mmal\ service\ 16.1"
            device.capabilities = :capture:video_overlay:
            device.api = v4l2
            device.path = /dev/video2
            v4l2.device.driver = "bm2835\ mmal"
            v4l2.device.card = "mmal\ service\ 16.1"
            v4l2.device.bus_info = platform:bcm2835-v4l2
            v4l2.device.version = 267083 (0x0004134b)
            v4l2.device.capabilities = 2233466885 (0x85200005)
            v4l2.device.device_caps = 85983237 (0x05200005)
    gst-launch-1.0 v4l2src device=/dev/video2 ! ...

Ok, fixed the Ras Pi Camera issue (https://github.com/stephendade/Rpanion-server/commit/cc74d38627b7ec9e139c75cc6bca610dab144d85). You’ll need to do a git pull in the ~/Rpanion-server folder on the Pi to get the update.

Raspicam video streaming is now working. A great feature for the future would be camera image rotation, someone :wink: might have the camera mounted upside down…

Sure - I’ve now added that in :slight_smile:

Hi Stephen, really fast work! The rotation dropdown is there after a git pull, but rotation only works for the usb cam, not the raspicam.

Oops … fixed now!

Thanks for the finding these issues too :slight_smile:

No problem! I really like that you focus on the key elements for a companion computer. I did not have much luck with the other solutions available. They either try to do too much or are more or less abandonware.

Yes, it is working. I am now trying to install rpanion-server in a Lubuntu VM running on Windows 10 for my bigger rover.

Hi Stephen,

I tested some more and noticed: the video streaming seems to use the same low bitrate for all resolutions. So using a higher resolution does not translate to a better picture. Is it possible to add a dropdown selection for the bitrate?

Sure - I’ve now added that in.

Ok. That was quick! I will try to test it as quickly!

Hi Stephen, I did a git pull and now I get:

./src/basePage.jsModule not found: Can't resolve 'react-spinners/ClipLoader' in '/home/pi/Rpanion-server/src'

Sorry, slight case off dumb… I just installed react-spinners and it is compiling again.
And everything works. Great work, thank you!

I found another issue. I am now running Rpanion-server on a RPi 3B+. The wired adapter and connections are seperated from the wireless adapters and connections, but now I have two wireless adapters. There seems to be no way to create a connection for a specific adapter, or to deactivate an adapter completly. I would like to use the RPi onboard adapter as a client in my home wifi and the Alfa adapter as an AP.

And in case anybody needs it, here is a working MissionPlanner 1.3.70 GStreamer Pipeline for Rpanion:

rtspsrc location=rtsp://Rpanion-IP:8554/video latency=0 ! application/x-rtp ! rtph264depay ! avdec_h264 ! videoconvert ! video/x-raw,format=BGRA ! appsink name=outsink

Adding a queue seems to reduce latency:

rtspsrc location=rtsp://Rpanion-IP:8554/video latency=0 ! queue ! application/x-rtp ! rtph264depay ! avdec_h264 ! videoconvert ! video/x-raw,format=BGRA ! appsink name=outsink

I’ve now added a feature to map a connection to a specific adapter.

Added button to deactivate current connection on adapter.

I’ve also fixed a few bugs for when a user has multiple Wifi adapters.

Thanks! I’ve added that to the video page.

Thank you! You are really quick!
I pulled the changes and everything is working, except the wifi security. As I wrote above I use the onboard wifi to connect to my home network and the Alfa AWUS036ACH as an AP. I enter a key and select WPA-PSK for the AP, but the wifi network is created as an open network. The IP I enter also always gets reverted to 10.42.0.1.
Update: I deleted the network, created it again, network open…, deactivated it, changed the IP, reactivated it and now it is secured and uses the IP I entered.
But Windows refuses to connect to the network again.
Perhaps it is a power issue on the RPi
side. I will test with lipo power again.

That’s a bug. Good find though - it took some time to figure out the cause. Basically, the Pi was activating the network before Rpanion-server could add in the security and IP settings for the network.

It’s now been fixed, so give it a go.

I’ve been unable to replicate this issue. Are you able to test with a few different Windows laptops?

And for everyone - I’ve now added logging to Rpanion-server. You’ll find the log in ./Rpanion-server/logs/app.log. This should help with reporting any bugs or issues.

Hi Stephen, everything seems to be working now. Windows does not mind connecting to the rovers AP anymore and the client wifi also connects.

@stephendade
Hi Stephen, I pulled the latest changes and sadly nothing is working anymore. All I get is the menu and the page title with a turning circle for the flightcontroller, network and video page.
Flight Logs is showing two buttons and a checkbox above an empty table. Clicking “enable logging”
results in the following error message:
“Error setting logging: SyntaxError: Unexpected token P in JSON at position 0”.