Servers by jDrones

Controlling Parrot drones using SkyController2

Hey, it’s been some time I’m writing a new RC software to run on the Parrot SkyController2 to use with ArduPilot on the supported drones from Parrot. The video above is the current progress. End goal is to control the Parrot Disco fixed wing, but on my travel to Brazil unfortunately it didn’t fit in my bags. So, in order to test the RC implementation I revived an old Bebop 1 I had. The project I’m talking about is called dema-rc and can be found on my github: https://github.com/lucasdemarchi/dema-rc.

The SkyController2, like the drones from Parrot use a custom Linux distro with influences from buildroot and Android. It has its own init system and it’s very streamed down. On SkyController2 for example you don’t have much space left, just a few megabytes. I made a blog post last year about the technical details of side-loading our own software on these kind of Linux boards: https://politreco.com/2019/09/side-load-on-embedded-linux-with-buildroot/. I see lots of projects just building the software statically to overcome dependencies issues, but I believe this is a better approach. Since that blog post I automated the way I build the software, integrating with Gitlab-CI, and making the toolchain available as a docker container (it’s available in my registry on Gitlab, registry.gitlab.com/lucas.de.marchi/dema-rc/armv7hf, but you can also just build your own with the Dockerfile. That container has all the dependencies to build the software plus the rootfs we use for side-loading additional software.

Once you have the toolchain, just configure and build dema-rc (in the case below I installed the toolchain under /opt/):

$ meson setup --cross-file /opt/arm-buildroot-linux-gnueabihf_sdk-buildroot/etc/meson/cross-compilation.conf build-armv7
$ ninja -C build-armv7

You also need bleeding edge version of ArduPilot running, containing this PR: https://github.com/ArduPilot/ardupilot/pull/13607

The best way I found to connect my computer to the Skycontroller2 is to find a compatible usb-ethernet dongle and connect it to the only USB port. Just a few dongles work out of the box, namely the ones that are USB 2.0 10/100 and use the asix chip. The Gigabit and/or USB 3.0 don’t work, even if they have the asix chip. This is the one I bought: https://www.amazon.com/gp/product/B00MYT481C/ref=ppx_yo_dt_b_search_asin_title?ie=UTF8&psc=1

It’s also possible to connect to the SK2 by hoping through the drone if they are running the original flight stack (otherwise it will keep disconnecting). You will need to discover the IP the controller was assigned and also have adb server on the drone. I think using the usb-ethernet is much simpler, more reliable and in future will allow you to feed the GCS with mavlink data and video (this is currently not working). Once you have it connected, to your computer, then you just need adb on your computer:

$ adb connect 192.168.53.1:9050
$ adb shell

This gets you logged in the SkyController2. All the configuration files and scripts you need are in this directory: https://github.com/lucasdemarchi/dema-rc/tree/master/distro/skycontroller2. Copy them using the install.sh script on the same directory. Next you will have to push dema-rc (and dependent libraries) you just built to /data/ftp/internal_000/ardupilot/bin/. See the install.sh script to check the commands to use.

After installing you have to reboot the SkyController2 using the power button. When it powers up again, it will still be using the original software. You have to press the “settings” button so it switches to dema-rc. After that you should see a blue LED blinking rather than a red one when it’s trying to find the drone’s network. The LED stays solid blue when connected. Differently from the original software, it doesn’t matter if the flight stack is running on the other side, it will try to connect (and reconnect in case the network connection is lost) to the SSID configured in /data/ftp/internal_000/ardupilot/bin/dema-rc.

Some limitations of the software in the current state:

  • Buttons are momentary only, so ArduPilot does not parse them correctly. This will be fixed soon by allowing buttons to be configured to toggle min/max when pressed

  • We don’t support local actions on buttons, so we can’t shutdown the controller. Current workaround is to switch back to the original software (by pressing the settings button) and then shut it down.

  • Installation involves a manual process as noted above. In future this will be simplified by packages with auto-extracting script.

  • GCS needs to be connected via its own wifi rather than routing through the SkyController.

5 Likes

Awesome work! Will be really great to use the SkyController2 with ArduPilot and the Parrot Disco. Any chance you will also integrate it to work with the Disco4g (softmod)?

It should be 99% compatible with the disco4g mod. The problems I can imagine are:

  • They directly start/stop the original software stack running on the controller (mppd) to handle the wifi connection. That will need to change.

  • handling the button to switch wifi/4g currently conflicts. I plan to add “local” actions that can be configured. That should solve this problem.

I don’t have a 4g modem to try it now, but maybe in future.

Great work ! Could we have telemetry from usb at this time (otherwise is it planned ?) ?

I plan to add telemetry via the usb-ethernet dongle.

2 Likes

Really great work! I’d love to be able to load ArduPilot on a Bebop2 (which we can already do) and then control it using the SkyController2 especially if the video was also working.

Here in Japan we suffer from a very very limited range of telemetry and live video systems. The Bebop2 and SkyController2 are one of the few systems that are certified for use here.

1 Like

@rmackay9 thanks. I think what I have for bebop 1 applies on bebop2, but I’m not entirely sure. I’m working on some instructions to get it working, could you test on bebop2?

@patrickelectric I see you worked on GCS for parrot drones… do you know what command I have to use to start/stop video there? Do we also have the media-ctl command we use in Disco?

Hi @lucasdemarchi,

You can use the MediaRecord class with the command Video.
This is done by Kirogi here:

how can I build with the not-yet-pulled PR that is required?
once it’s in I assume that “./waf configure --board=disco --static && ./waf build” will do the job.

@Andre-K yes, that’s right. IMO the right thing to do is to get ardupilot using the same toolchain and merge this patch. Then you can simply download it from ardupilot’s server.

@tridge2 if I create the hooks in CI to build ardupilot, could I upload the result to ardupilot’s server? Or would it be better to install the same toolchain in our builder machine?

@tridge ^ … I guess I tagged the wrong person. Another option that may be even better is to build our toolchain on ardupilot’s repo. We could 1) use the same configuration that I have in dema-rc, adding gitlab-ci in addition to travis/semaphore/etc, 2) integrate the toolchaing building in the current CIs (I don’t know how); 3) setup github actions - I have a vague idea how. Then we’d add an action/pipeline to the CI to upload the result to firmware.ardupilot.org. What do you think?

1 Like

any progress? @tridge?

Servers by jDrones