Servers by jDrones

New Companion Computer software: Rpanion-server


As part of my ongoing project to support companion computers in Ardupilot, I’ve released a new software suite: Rpanion-server.

It is similar to other software (such as APSync) in that it provides a web-based interface for managing telemetry, video streaming and networking.

It is designed to complement the Pi-Connect boards I’ve manufactured (which ease the integration of Raspberry Pi’s into Ardupilot-powered vehicles). The Pi-Connect is not required to run the software though.

It’s usable, but still in beta. So any bug reports are appreciated!

Telemetry:
Allows the user to select serial port, baud rate and MAVLink version of the connected flight controller. Provides basic information of the flight controller status and allows for dynamic adding/removing of UDP endpoints for telemetry forwarding:

Network
Network connections can be added/edited/removed - both Ethernet and Wi-Fi. It also supports Wi-Fi hotspots.

Video Streaming
Any compatible video device (Raspberry Pi Camera, most USB webcams) is compressed to H.264 format and streamed as a low-latency video stream. User can select device and resolution:

Compatibility
Rpanion-server is built using the NodeJS/React frameworks and should run on any Linux-based device with a NodeJS (12+) install.

It’s been tested as working Raspian and Ubuntu.

Installing/Details
Rpanion-server is released under the GPL licence and the source code (plus installation instructions) are here: https://github.com/stephendade/Rpanion-server.

I’ve also got a prebuilt image for Raspian here: https://rpanion-files.s3-ap-southeast-2.amazonaws.com/Rpanion-server/Rpanion-Server-0.4.0-Raspian.img.xz. It comes configured as a Wi-Fi access point “rpanion”, password “rpanion123” and the Rpanion-server address as http://10.1.1.1:3000

10 Likes

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.

Servers by jDrones