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.