On the opensource project uasmqtt now it’s possible to ‘tunnel’ MAVLink packets. That means it’s not only to control the smartphone from the ground and get it’s data. Through the same message queue mechanism MAVLink packets can send and received.
To get a proof of concept the AircamQC app was extended to get a bluetooth connection to the Quanum Nova/CX-20 APM quadrocopter. Also a small utility was created to listen on a TCP socket and transfer these data to the MQTT broker (TCPmavlink2uasmqtt).
At the picture you can see the working example. The picture itself was taken through the AircamQC app and triggered by the AircamQC Viewer app.
MAVLink packets are different in it’s size and have a starting id (0xFE). The payload length up to 254 bytes is following direct after the starting id. There are also some other importand status bytes so that a packet size is calculated by 6 bytes header + payload + 2 bytes checksum.
The drawback on this approach is the performance. It’s really slow for some reason. A better approach is not to interpred the MAVLink packet stream but to create proper topic structure and json content.
Then the smartphone app can act like a ‘companion computer’ and talk with the copter through MAVLink with all necessary information at the right time, like the heardbeat. But to another aircraft or groundstation the smartphone can talk in it’s own MQTT ‘language’ which should not be too time critical.
The experiment set-up is shown in the following picture.