Monitor drone while flying using SkyController

Hello,

I recently bought a Parrot Anafi with the intention to monitor its sensor data(Batterie, GPS, height, speed etc) to build an interactive dashboard showing the gathered data. I already found the Olympe SDK and tried to connect to the drone while I was controlling it using the Skycontroller 3 and the FreeFlight app.

Unfortunately, I was unable to connect to the drone while I was controlling it using the Skycontroller(connection refused) and I assume that the drone only supports one connection at a time (https://developer.parrot.com/docs/olympe/arsdkng_drone_manager.html#olympe.messages.drone_manager.connection_refused).

Furthermore, I tried to connect the SkyController to my computer in order to copilot the drone as described here: https://developer.parrot.com/docs/olympe/userguide.html#connect-to-a-skycontroller. Although, I was able to ping the associated RNDIS IP, I was not able to connect to the drone. (I think the example code is not working)

Is there a possibility to gather sensor data and control the Drone using the Skycontroller at the same time?

Regards,

0bscur3

Hi @0bscur3,

Even if you were able to make 2 devices join the drone SSID (this is actually the maximum authorized by your Anafi), only one device at a time can establish an SDK connection to the drone. The first device to establish an SDK connection (your SkyController 3) wins while the second (Linux/Olympe) get a connection refused.

You are right, the example is currently buggy. You should be able to workaround this issue by specifying the “drone_type” you are trying to connect to :

import olympe
import olympe_deps as od
from olympe.messages.skyctrl.CoPiloting import setPilotingSource

drone = olympe.Drone("192.168.53.1", mpp=True, drone_type=od.ARSDK_DEVICE_TYPE_ANAFI4K)
drone.connection()
drone(setPilotingSource(source="Controller")).wait()

Alternatively :

  1. Olympe -> SkyController 3 -> Anafi : using the example above, just replace “controller” by “SkyController” for the “piloting source”.

  2. You might be able to connect the video stream of your drone (using PDrAW) while independently piloting it with your SkyController 3. The video stream contains some drone metadata (battery percentage, GPS coordinates, …). @Nicolas, can you please confirm that ?

Regards,

Nicolas

1 Like

Yes, but this imposes a number of constraints over the setup if you want to have both FreeFlight and PDrAW active at the same time:

  1. You must use an Android phone/tablet (as iOS requires a USB role-switch, and thus won’t work through a USB hub)
  2. You must connect your computer to the SkyController 3 via a USB-Eth device plugged on a USB Hub on the SkyController 3. This is the tricky part, as the SkyController 3 will only recognize some usb-ethernet adapters (see this topic for more infos)
  3. If you run PDrAW to get the live stream (and its metadata), you won’t be able to do replay in the FreeFlight gallery (as the drone can’t do live+replay at the same time, and live has the priority)

Schematically, you should have something like this:

+-----------------+    +---------+
| SkyController 3 |    | USB HUB |----[ Android Phone/Tablet]
| USB-A port.     |----|         |----[ USB-Eth dongle ]----[Your computer]
+-----------------+    +---------+

Note: If you find an USB-Eth adapter which works, you can then either connect it directly to your computer (the SkyController will start a DHCP server and serve IPs in the 192.168.53.0/24 range), or connect the SkyController to an existing network (if a DHCP server exists on the network, the SkyController will get its IP address from this server)

This gets much simpler if you don’t need FreeFlight 6, as you can then directly connect the SkyController to your computer with the USB Type-C port as described in the Olympe documentation.

Regards,
Nicolas.

1 Like

Hello @Nicolas, @ndessart,

thanks for the fast and very helpful response. As it is not an absolute requirement to have the FreeFlight app, I decided to go with the Pdraw route and see if I can get the stream metadata and write it to a log file. I would prefer this method, because I do not need a wired connection to the SkyController. Unfortunately, I am a little bit overwhelmed by the c/c++ code.

Therefore, I also tried my second preference, to connect to the SkyController using the USB C cable. I was able to connect to the drone and get some status information, but I have struggle to understand how I can listen for certain events (not as a response of a command) so that I can forward them to my dashboard. Is there a possibility to create a listener, or do I have to query the drone regularly?

Last question, is there an example on how to stream and play the live video from the drone using Olympe?

Hello, I am interested in what @0bscur3 originally posted about. I would like to control my Anafi from the controller and app while simultaneously monitoring GPS data through Olympe without needing the USB hub. I am not interested in sending commands to the aircraft from the laptop but rather just monitoring data.

Is it possible to modify the drone.connection() command to the aircraft so that it thinks it is connecting to the controller? It appears that the json that olympe sends looks like this:

I arsdkctrl_net: { “arstream2_client_stream_port”: “55004”, “arstream2_client_control_port”: “55005”, “arstream2_supported_metadata_version”: “1”, “controller_name”: “arsdk-ng”, “controller_type”: “desktop”, “d2c_port”: 9988, “device_id”: “”, “qos_mode”: 0 }

If I just changed “controller_type”: to “Controller” would that work? Or would I also have to modify the port variables?

Otherwise is there any way for me to monitor GPS data from my laptop while flying through the app?

I suppose I could do packet sniffing through wireshark but that seems like a pain to implement.

-Kato0443

Hi,

The Drone and the SkyController only accepts one SDK client each, so you won’t be able to use Olympe to connect to it when you have a full Drone<–Controller<–FreeFlight connection.

The way I described in my previous post, with a video-only client in a computer is the only way to get some telemetry data from the drone with this setup. The live video stream contains a lot of metadata which can be used to monitor the flight.

Regards,
Nicolas.

@Nicolas

Hi there,

  • So the conclusion is that the sensor data (Battery, GPS, Height, Speed) can be fetched in real-time using the metadata of Video Stream. Is that right?

  • Does Parrot AR 2, Parrot Bepop and Parrot 2 also contain this metadata?

  • Actually, I am an absolute beginner to Drones. I am creating a Software that requires the real-time transmission of above mentioned sensor data. Could you please enlist the steps, I shall do it achieve it?

Thanks in advance.