Welcome to our Community
Wanting to join the rest of our members? Feel free to sign up today.
Sign up

SkyController 3 mod for smoother motion

MustangPhil

Well-known member
Joined
Jul 27, 2018
Messages
571
Reaction score
419
Location
France
Hi,

I’m still looking for a solution to modify something to get much smoother reactions from the SkyController 3 on the Anafi.
I played with the joystick parameters in FreeFlight 6 and got good results, but still not perfect (for example brutal stops when the joystick gets near the neutral position).
I got improvements with home made extenders for the joysticks... but still far from perfect for slow motion and smooth changes In directions.

I remember I saw a thread about modification of the SkyController 3 accessing a text file with lots of settings but I can’t find it any longer (used the search function... but no luck).

- Do you know where this thread is ? (Was it for the Anafi ?)
- Did any of you have any luck modding this file to get a cooool expo on the SkyController 3 ?
- Do you know if this text file and its attached set of parameters does something different than the setting for the commands in FF6 setting menu ? (Are there other parameters ?)

Thanks for your help !
 
  • Like
Reactions: astrex
Post #22 is the one I think you are looking for. Not sure how much help it will be though.

 
  • Like
Reactions: MustangPhil
Thanks @Agustine, that’s the thread I was looking for.

I may try this as the text files mentions ‘expo’ parameters for all axis.
It’s just odd no one has ever tried or reported any test on the subject...

The poster mentions a USB connection and a change in a text file. I’ll try to find where it is located...
 
Ok, I finally got it ! The file we are looking for is located in the SkyController 3.

The Original poster must be a german guy that was active on a german forum., but does not answer any longer in the Parrot Pilot Forum.

So I created a account to get access to the files they host on the German "KOPTERFORUM" and found via google the thread mentionning the mapping of the controller commands. Not an easy task, because in German only with "secret questions to check if you are a bot" ... but in German with German Expressions !

In this forum thread, he made a "how to" text file (in English, thanks to him), but it was a little "touchy" so some questions occured. So I took his "How To" txt file and try to "arrange it my way" so I (and may be you) can understand it :

To access the SkyController guts :

1/ you need to download and install a free specific app on your computer (for Windows or Mac) that allows you to connect to an Android Device (the SkyController 3). This App and its attached driver is called "ADB and FastBoot". It will allow to communicate in command line functions with the SC3.
2/ ANAFI Off - SkyController Off - No Phone or anything connected to the USB port.
3/ First turn On the ANAFI
4/ Then open (turn On) the SkyController. You can check the connection WiFi connextion between the Anafi and the SC3 is ok because the SC3 led turns steady dark blue.
5/ Connect your computer WiFi Adapter with the Anafi Wifi Network (for example on a Windows 10 PC, you should click on the lower rigth wifi icon, check for available WiFi network choose ANAF and type the WiFi Password that is usually written in the Anafi grey oval box.
6/ Double click to start the ADB and Fastboot application on your computer, it opens a command line window prompt waiting for you to type commands
7/ type : ADB connect 192.168.42.9:9050
8/ Now for me it does not work yet, and for other forumers neither, it still say "no device" but some got it to work... I'll try to find why and go on reporting here...
9/ When connected, access to the correct directory on the SC3 typing : cd /data/lib/mppd/
10/ Edit the file using the Vi editor (to avoid a mess with end of lines that are not coded the same in Windows and in Linux/Android (so Vi editor should also be installed) :
vi mapping_anafi4k.cfg
11/ Modify and Save your changes on the mapping_anafi4k.cfg (example choosing the expo parameters 1, 2 or 3 for the axis.
12/ Switch everything off
13/ Switch on the Anafi, then the SC3 connected to your usual phone with FF6
14/ Test fly !

I still do not get why or when to use the USB connection between the PC and the SC3 (if the access is granted via WiFi, ... why should we use the cable ?)
In its "how to" file, he mentions another method with another IP adress ... that's something I'll check also...
For your info, here is the whole "How To" he wrote to invert throttle axis on the SC3 :
------------------------------------------------------------------------------------------------------------------------------
1a) On Linux or Mac OSX (ADB binary needed):
———————————
Start with: Controller OFF, Anafi OFF, Controller NOT connected to phone.

Switch on Controller, connect Controller via USB to linux or OSX machine.
wait some secs until it is booted and RNDIS Network is up.

connect ADB:
adb connect 192.168.53.1:9050
———————————

(1b) On Windows or Linux or Mac OSX: (ADB binary needed)
———————————
Start with: Controller OFF, Anafi OFF, Controller NOT connected to phone.
Switch on Controller, switch on Anafi, connect your computer to Anafi WiFi, wait until Controller shows Connection (= steady blue)

connect ADB (using the Anafi as Wireless Access point):
connect 192.168.42.9:9050

———————————

(2) then get shell accessconnect ADB on MPP3:
adb shell

(3) change to config file directory typing the command line :
cd /data/lib/mppd/

(4) edit settings: (SIMPLE vi introduction: An Extremely Quick and Simple Introduction to the Vi Text Editor)
vi mapping_anafi4k.cfg

e.g. for inverting of throttle ( == axis 1) the file should looklike this:


invert = (
{
axis = 0;
inverted = 0;
},
{
axis = 1;
inverted = 1;
},
{
axis = 2;
inverted = 0;
},


(5) save thisand exit vi, switch off controller

(6) THEN switch on Controller, attach phone, switch on Anafi, VOILÀ, should work as desired from now on.
-------------------------------------------------------------------------------------------------------------------------------------------------------------------------
 
  • Like
Reactions: zandoli and yarrr
Just throwing this out to you. I have no clue. LOL
In order to be able to talk to the controller with USB cable you might need to Install the RNDIS Driver that is used with UgCS so your computer can see the controller. Then I am just guessing you would have to telnet ( ADB and FastBoot )into the controller to make any changes. Way over my head. ;)
 
Thanks for your advice ... I’ll try that also...

It may help because my only problem now is to connect to the SC3.

All the rest seems easy to me (I’m familiar with Vi Editor on PCs), and the mapping file seems well documented...
 
Similar process to what we have previously used to change button mappings on the controller. See attached file
 

Attachments

  • _howto_change_button_mapping.txt
    2.7 KB · Views: 17
  • Like
Reactions: MustangPhil
Yes, it’s the same ‘how to’ file from the original poster.

My problem in this (1b) Solution for windows, is when I type :
ADB connect 192.168.42.9:9050
It starts the server daemon but does not find the SC3...

Did you successfully connect to the SC3 and am I missing something ?
 
Last edited:
I am trying this out (via my phone).

On my setup the network is setup like so.

Anafi 192.168.42.1
SC3 192.168.42.99

Also I did a port scan on the SC3 and the only open ports are 161 (snmp), 180 (rls), 554 (rtsp), 6007.

Port scans might not show ports which do not respond to scans.
 
  • Like
Reactions: MustangPhil
Managed to get ADB running on an old laptop I have (no WIFI adapters for my desktop!).

Sadly do not think the 9050 port is open for ADB.

Tried connecting with a raw terminal connection to various ports - I get something on the 161 SNMP port (can send it various commands and get responses).

Nothing on port 180 and get a bunch of gibberish on port 6007.

Doing a quick search looks like the port 9050 and adb related stuff is how the Bebop was hacked using the ARDRone3 SDK stuff - which is technically what the Anafi runs on.
 
@AnafiPilot1 You must be right regarding the 9050 port used by Parrot.

I also found informations about the active/idle time of the ‘traditional’ port activity managed by Parrot : It seems RNDIS is active in Parrot mini-drones for a Maximum total time of 1 minute.
When I tried to connect, it was always after a longer time.
I should be quicker before the process and the ports are no longer active in the SC3.
It may explain why you did not get any ‘life’ on port 9050 ?

From my understanding also, the address and port when the SC3 is directly connected to a computer via USB is 192.168.53.1:9050 ?

Here is a screenshot found on the subject :

B152E7FE-4BD7-4AF6-8168-E1C7663EA4C6.jpeg
 
Last edited:
  • Like
Reactions: edwardfcy1970
... follow up progress ...

I installed Windows 10 RNDIS microsoft driver. Now the SkyController 3 that was showing up in Windows 10 devices as "no driver installed" ... has a RNDIS driver.
I found on the Parrot Developper Forum, an info from Parrot, saying that the SC3 IP adress when connected to a usb c port would be 192.168.53.1 ...if the SC3 does not detect a DHCP server on the connected PC (mine has one of course !).
So I checked on the Windows Network Icon, saw I had a USB "RNDIS networkork card" connected under another IP adress (192.168.53.80)
I tried to Ping it ... and it responds ... so the SC3 connected via USB (without ANAFI running) seems to be connected.
When I try to connect to the 9050 port with ADB, it's refused.
When I netstat to get all listening ports, the 192.168.53.80 adress is listening to other ports, but not the 9050 even if I switch OFF and ON the SC3 to catch it before the iddle time ...

Any idea ? (on the German Forum, some seem to have succeeded in the connection and shell...)

AdresseRNDISpingOK.jpg


A Screenshot from a guy in the german forum (second attempt seems OK) :
ConnexionOK.jpg
 
First I cannot detect the SC3 via USB, my USB-A to USB-C lead might not be working that way round correctly I will have to try and get a USB-A to USB-A lead. Is this what you are using to connect to the computer via USB?

I retested the SC3 within 20 seconds of switching on - still no ADB connection.

Reading the Bebop stuff, it looks like the SC used with them models is running a basic version of Android, hence why ADB is used to connect to it. Are we sure the SC3 is android based as well?

Also there is the possibility that Parrot have removed ADB access with firmware since the information you have found.
 
  • Like
Reactions: MustangPhil
@AnafiPilot1 : I used also a USB-A (on the PC) and a USB-C (on the SkyController 3).
That’s how it is meant to work for the Anafi if I understand well the informations I got on the Parrot Developper Forum.

With this type of cable connection, as you can see on the first picture above, I could ping the SkyController 3 after I installed the RNDIS driver (as proposed by our Master... @Agustine ;o).
So I’m convinced that the cable is Ok.

The only difficulty I had was to find the IP address of the SkyController 3. That’s where a thread in the developper forum helped me understanding that if more that one network is present on the PC or if the SC3 detects an already running DHCP server, it will not run its own and pick an address on the existing network.
I guess that’s why my RNDIS adapter got the 192.168.53.80 address for the SC3 instead of the usual 192.168.53.1 when the SC3 is alone on the network and starts its own DHCP server.

Now the question is : Why can’t we access the 9050 port of the SC3 ?
You may be right, this function may have disappeared during a firmware update...

Now, the only solution to me is to post the question on the Parrot Dev Forum and see if I get an answer (this forum is not dedicated to this type of file modification on the SC3... but at least they can tell me if it’s allowed...)
 
Maybe a dumb question but is that port open? I know when my kid plays his games with friends he needs to have the some ports open up. Maybe not related but I thought I would ask.
 
  • Like
Reactions: MustangPhil
Thanks for your suggestion @Agustine, but in fact the problem is that the SC3 9050 port is not "listening".
You can't open the port on the SC3 (Parrot can choose a port and decide that it is open)
Your kid needs you to open some ports from your modem/internet box so incoming information or outgoing information can flow throuh this port.
I posted the question in the Parrot Developper Forum, I'll see if the port is natively open and listening (and ready for us to mess with it) or if I am doing something wrong.

The recent security increase in Parrot communication and the future remote ID that will be running worldwide makes me think I can put it above my ear and go smoke it elsewhere (... maybe a french expression, but self explanatory ?)
 
  • Haha
Reactions: Jagerbomb52
@AnafiPilot1 : I used also a USB-A (on the PC) and a USB-C (on the SkyController 3).
That’s how it is meant to work for the Anafi if I understand well the informations I got on the Parrot Developper Forum.

With this type of cable connection, as you can see on the first picture above, I could ping the SkyController 3 after I installed the RNDIS driver (as proposed by our Master... @Agustine ;o).
So I’m convinced that the cable is Ok.

The only difficulty I had was to find the IP address of the SkyController 3. That’s where a thread in the developper forum helped me understanding that if more that one network is present on the PC or if the SC3 detects an already running DHCP server, it will not run its own and pick an address on the existing network.
I guess that’s why my RNDIS adapter got the 192.168.53.80 address for the SC3 instead of the usual 192.168.53.1 when the SC3 is alone on the network and starts its own DHCP server.

Now the question is : Why can’t we access the 9050 port of the SC3 ?
You may be right, this function may have disappeared during a firmware update...

Now, the only solution to me is to post the question on the Parrot Dev Forum and see if I get an answer (this forum is not dedicated to this type of file modification on the SC3... but at least they can tell me if it’s allowed...)
OK OK OK ! - I was using my lead the other way around - I had the USB-C in to the computer and USB-A in to the SC3. I always thought that the USB-C on the SC3 was a charge only port and not data!

Will test again with RNDIS and see if I end up the same place as you.
 
  • Like
Reactions: MustangPhil
I have been reading the SC stuff related to the Bebop - looks like axis mapping and filters can be adjust during runtime by the app talking to the SC.


Maybe the best approach would be look at modding FF6 to change the filters/axis.
 
  • Like
Reactions: MustangPhil
Built a version of FF6 with debugging logging on, and found this in the logs.

Code:
10-09 14:36:29.808 23734 23734 W arsdkengine.gamepad: Invalid product or expo, dropping axis interpolator [uid: 2331, product: 2331, axis: 0, expo: LINEAR]
10-09 14:36:29.808 23734 23734 W arsdkengine.gamepad: Invalid product or expo, dropping axis interpolator [uid: 67867, product: 2331, axis: 1, expo: LINEAR]
10-09 14:36:29.809 23734 23734 W arsdkengine.gamepad: Invalid product or expo, dropping axis interpolator [uid: 133403, product: 2331, axis: 2, expo: LINEAR]
10-09 14:36:29.809 23734 23734 W arsdkengine.gamepad: Invalid product or expo, dropping axis interpolator [uid: 198939, product: 2331, axis: 3, expo: LINEAR]
10-09 14:36:29.809 23734 23734 W arsdkengine.gamepad: Invalid product or expo, dropping axis interpolator [uid: 264475, product: 2331, axis: 4, expo: LINEAR]
10-09 14:36:29.809 23734 23734 W arsdkengine.gamepad: Invalid product or expo, dropping axis interpolator [uid: 330011, product: 2331, axis: 5, expo: EXPO_4]

Looks like Axis (ROLL, PITCH, YAW, GAZ, CAMERA_TILT are set to LINEAR and CAMERA_ZOOM is set to EXPO_4 (STRONGEST_EXPONENTIAL)

In FF6 codebase for the SC3 found these relevant functions which set the EXPO level.

Code:
    .line 47
    new-array v0, v0, [Lcom/parrot/drone/groundsdk/device/peripheral/gamepad/AxisInterpolator;

    sget-object v6, Lcom/parrot/drone/groundsdk/device/peripheral/gamepad/AxisInterpolator;->LINEAR:Lcom/parrot/drone/groundsdk/device/peripheral/gamepad/AxisInterpolator;

    aput-object v6, v0, v1

    sget-object v1, Lcom/parrot/drone/groundsdk/device/peripheral/gamepad/AxisInterpolator;->LIGHT_EXPONENTIAL:Lcom/parrot/drone/groundsdk/device/peripheral/gamepad/AxisInterpolator;

    aput-object v1, v0, v2

    sget-object v1, Lcom/parrot/drone/groundsdk/device/peripheral/gamepad/AxisInterpolator;->MEDIUM_EXPONENTIAL:Lcom/parrot/drone/groundsdk/device/peripheral/gamepad/AxisInterpolator;

    aput-object v1, v0, v3

    sget-object v1, Lcom/parrot/drone/groundsdk/device/peripheral/gamepad/AxisInterpolator;->STRONG_EXPONENTIAL:Lcom/parrot/drone/groundsdk/device/peripheral/gamepad/AxisInterpolator;

    aput-object v1, v0, v4

    sget-object v1, Lcom/parrot/drone/groundsdk/device/peripheral/gamepad/AxisInterpolator;->STRONGEST_EXPONENTIAL:Lcom/parrot/drone/groundsdk/device/peripheral/gamepad/AxisInterpolator;

    aput-object v1, v0, v5

    sput-object v0, Lcom/parrot/drone/groundsdk/device/peripheral/gamepad/AxisInterpolator;->$VALUES:[Lcom/parrot/drone/groundsdk/device/peripheral/gamepad/AxisInterpolator;

    return-void

and

Code:
    .line 335
    :cond_0
    sget-object p4, Lcom/parrot/drone/sdkcore/arsdk/ArsdkFeatureMapper$ExpoType;->EXPO_4:Lcom/parrot/drone/sdkcore/arsdk/ArsdkFeatureMapper$ExpoType;

    goto :goto_0

    .line 332
    :cond_1
    sget-object p4, Lcom/parrot/drone/sdkcore/arsdk/ArsdkFeatureMapper$ExpoType;->EXPO_2:Lcom/parrot/drone/sdkcore/arsdk/ArsdkFeatureMapper$ExpoType;

    goto :goto_0

    .line 329
    :cond_2
    sget-object p4, Lcom/parrot/drone/sdkcore/arsdk/ArsdkFeatureMapper$ExpoType;->EXPO_1:Lcom/parrot/drone/sdkcore/arsdk/ArsdkFeatureMapper$ExpoType;

    goto :goto_0

    .line 326
    :cond_3
    sget-object p4, Lcom/parrot/drone/sdkcore/arsdk/ArsdkFeatureMapper$ExpoType;->EXPO_0:Lcom/parrot/drone/sdkcore/arsdk/ArsdkFeatureMapper$ExpoType;

    goto :goto_0

    .line 323
    :cond_4
    sget-object p4, Lcom/parrot/drone/sdkcore/arsdk/ArsdkFeatureMapper$ExpoType;->LINEAR:Lcom/parrot/drone/sdkcore/arsdk/ArsdkFeatureMapper$ExpoType;

Java codes looks like this.
Code:
AxisInterpolator axisInterpolator = null;
                    int i7 = C14123.f246x5389c45[expoType.ordinal()];
                    if (i7 == 1) {
                        axisInterpolator = AxisInterpolator.LINEAR;
                    } else if (i7 == 2) {
                        axisInterpolator = AxisInterpolator.LIGHT_EXPONENTIAL;
                    } else if (i7 == 3) {
                        axisInterpolator = AxisInterpolator.MEDIUM_EXPONENTIAL;
                    } else if (i7 == 4) {
                        axisInterpolator = AxisInterpolator.STRONG_EXPONENTIAL;
                    } else if (i7 == 5) {
                        axisInterpolator = AxisInterpolator.STRONGEST_EXPONENTIAL;
                    }
                    GamepadControllerBase.this.addAxisInterpolatorEntry(j, droneModel, (long) (1 << i5), axisInterpolator);

Code:
    public final void setAxisInterpolator(@NonNull Drone.Model model, long j, @NonNull AxisInterpolator axisInterpolator) {
        ArsdkFeatureMapper.ExpoType expoType;
        int i = C14123.f245xd2929d6d[axisInterpolator.ordinal()];
        if (i == 1) {
            expoType = ArsdkFeatureMapper.ExpoType.LINEAR;
        } else if (i == 2) {
            expoType = ArsdkFeatureMapper.ExpoType.EXPO_0;
        } else if (i == 3) {
            expoType = ArsdkFeatureMapper.ExpoType.EXPO_1;
        } else if (i != 4) {
            expoType = i != 5 ? null : ArsdkFeatureMapper.ExpoType.EXPO_4;
        } else {
            expoType = ArsdkFeatureMapper.ExpoType.EXPO_2;
        }
        sendCommand(ArsdkFeatureMapper.encodeSetExpo(model.mo21165id(), Long.numberOfTrailingZeros(j), expoType));
    }

I am stretching my skill levels with this, but I will try a build where I force EXPO_4 (STRONGEST_EXPONENTIAL) on all Axis, and see if that changes.

My main struggle which I just have not been able to do is add debug codes to write to the log when the code to set EXPO level is fired, so I can see if it is actually setting EXPO level or not. So this leaves me with having to do test builds and testing to see if anything changes.

Anyway hope this helps others who are trying to achieve this!
 
Last edited:
That looks really interresting ! you seem to get your hands on the right parameter !!!
Sorry I can't help you much on this ;o) but of course, I will follow your progresses on the subject !
 

New Posts

Members online

Forum statistics

Threads
5,295
Messages
45,050
Members
7,965
Latest member
Peanut