Adding uart connectivity

Maybe this isn’t the right place, but I’d like to discuss some ideas to get more uart connectivity on pixhawk platforms. Presently I’m working on system where I would like to have the following uart usage.

Serial radio (i.e. RFD900x)
Mavlink gimbal (i.e. alexmos)
Mavlink camera (i.e. flir, micasense, etc)
companion computer
Leddar one rangefinder
FrSky telemetry
Blheli_32 telemetry

Thats 5 more than available on the pixhawk. Here are some of the ideas I’ve had to deal with this:

Use the companion computer to route mavlink messages. Gimbal, camera, ADSB, serial radio, and leddar one could all live behind the companion computer. This brings up a couple potential problems though. First of all the messages will need to make extra hops to get to their final destination, so adding latency and increasing the chance of losing one. Not a major problem, but worth mentioning. More significantly, managing the various data streams and rates per device becomes a headache. It would be a bad idea to just send everything everywhere since low throughput links (i.e. serial radio) could easily become saturated with meaningless traffic (i.e. gimbal messages). Telemetry would need to be requested from the pixhawk at the lowest common multiple of all the various requests and sent out accordingly. Maybe such software already exists to manage this?

Run frsky telemetry from the companion computer. This would require porting the telemetry code to the companion computer and modifying it to grab appropriate values from the mavlink stream. Doable, but still a pain.

Blheli_32 telemetry from companion computer. I don’t know how this would be synchronized with the telemetry requests going to the ESCs.

UAVCAN GPS. This seems like a good option to free up a port. Is it possible to do rtk/ppk with the present uavcan GPS stuff?

Add “virtual” serial ports to ardupilot. The companion computer could send/receive bytes on one of it’s physical uarts and encapsulate them inside mavlink frame for delivery to the “virtual” uarts in ardupilot. SERIAL_CONTROL seems to already implement this, but in reverse. Likely would be problems on timing sensitive protocols. Could this work to delivery blheli_32 telemetry? Requires ardupilot mods to support, I might do this.

UAVCAN virtual serial ports?

Those are my ideas so far. I was just hoping to get a discussion started, and maybe hear about some other solutions that have been developed.

If you have a companion computer then you can run MavProxy, and if you can run mavproxy then you can add as many serial ports as you can to the companion computer.(Direct or USB) So gimbal-camera-rfd-adsb can go to the companion computer. FrSky telemetry can be implemented in a small arduino so it can be on a mavlink serial port, which can go to the companion computer as well.

I am aware of mavproxy, but I don’t believe it intelligently manages the streaming data, does it?

Suppose the companion computer requests ATTITUDE_QUATERNION at 100Hz. My understanding is that mavproxy will then send this message to all “out” connections at 100Hz.

You are right. It needed more sophisticated routing :frowning:
And if we put Companion to FC to a separated serial ? Still can share camera-gimbal-adsb and frksy…

You can move the GPS and the rangefinder as well as ADSB to CAN. At least that frees up 3 serial ports

How do I put the ADSB and rangefinder on CAN? I realize there are some CAN rangefinders out there, but I am stuck with the leddar one due to physical integration considerations.

Which ADSB products support CAN?

Use these to convert your serial devices to CAN