ANAFI disconnects and does not recover

I’ve found that sometimes, my ANAFI will randomly disconnect from the SkyController 3. My ANAFI is up to date with a default configuration (except I have manually selected 5GHz band) and I’m just using the SkyController 3 with the ANAFI.

When the ANAFI is disconnected, it does not reconnect unless I reboot the ANAFI. Even if I power cycle the SkyController 3.

Has anyone run into connection problems like this?

I have experienced almost same problem.(And I don’t solve it yet)

I selected 5GHz band manually using Olympe and cannot connect to ANAFI again.
I recover my ANAFI by hard reset(pressing battery button several seconds).

I think disconnection while switching wifi band is normal phenomenon in my situation(using Olympe).
But I can’t get it why it is not possible reconnect to ANAFI.

For your reference,
According to set_ap_channel() method doc, disconnection might appear when ANAFI swiches its wifi band from 2.4Ghz to 5Ghz(and vice versa).

One more data point, In the SkyController ulog it looks like the ARDiscovery protocol is finding the ANAFI (prints its serial number), and attempts to send a connection request, but there is no response from the ANAFI.

Furthermore I can ping the drone’s IP from the SkyController 3 ADB.

So it’s not necessarily a physical layer connection issue, looks like the drone is present on the 5.8 network and somehow discoverable. Just not responding to connection requests?

Also when it happens, on my phone I can sign into the wifi network of the ANAFI and go to the web site 192.168.42.1 and see the web page of the ANAFI. But FreeFlight 6 still won’t connect. The ANAFI is just stuck in a bad state and hovers forever until it runs out of batteries and returns to launch

Hi Christopher

Are you able to gather some logs on the Anafi when the issue occurs?
From your previous messages it seems that the issue is on the drone side, I want to be sure that the drone receive the connection request made by the Skycontroller is correctly interpreted by the drone.

Regards

Sebastien

About your issue, do you think it could be possible that another “controller” (phone/Olympe…) could be connected at the same time?
The drone support only one SDK connection at a time and when this type of issue occurs we often have another controller that manage to connect to the drone while the first one has been disconnected.

I don’t think so. This is what I get when I try to connect multiple devices at the same time: I get “connection refused” as expected:

I arsdkctrl: discovery 'net': start
I arsdkctrl: discovery 'net': add device name='Skycontroller 3' id='PI040443AA0L213933'
I arsdkctrl_net: Sending json:
I arsdkctrl_net: { "controller_name": "MyController", "controller_type": "Custom Software", "d2c_port": 9988, "qos_mode": 0, "proto_v_min": 1, "proto_v_max": 3 }
I arsdkctrl_net: Received json:
I arsdkctrl_net: { "status": -1, "c2d_port": 0, "qos_mode": 0, "proto_v": 3 }
I arsdkctrl_net: Connection refused

However, when this disconnection problem happens, I do not get a ARDiscovery response at all. i.e. I see “Sending json…” but I don’t get a “Received json…”.

This issue happens with the following setup:

  • PC → SkyController 3 → ANAFI
  • I am using arsdk-ng (using C code) connected to SkyController (192.168.53.1).
  • ANAFI version 1.8.4, hardware HW_02
  • SkyController 3 version 1.8.1 hardware 3

How to reproduce:

  • Just turn ANAFI and SC3 on, and wait.
  • It happens whether ANAFI is flying or not.
  • It happens whether I am running my SDK software or not.
  • It happens outdoors in hot weather, or indoors 20 deg C with the drone sitting on my desk, so environment should not be a factor.

When it happens:

  • ANAFI responds to ping (both SC at 192.168.53.1 and ANAFI at 192.168.42.1)
  • ANAFI web pages can be loaded (both 192.168.53.1 and 192.168.42.1)
  • Video still can be played via RTSP
  • SC shows pulsing white/blue LED light
  • SC buttons and switches do not have any effect

I have tried:

  • Turning the SkyController 3 off, waiting a few seconds, and turning it on again. I can still ping both SC and ANAFI as described above, but still unable to connect with SDK.
  • Disconnect SkyController 3 from PC, turning the SkyController 3 off, waiting a few seconds, connect my phone with FreeFlight 6 and turn on the SkyController 3 again. No PC plugged in at all, just FreeFlight 6. FreeFlight sees the SkyController 3 connected but says drone is disconnected.
  • Connecting my PC directly to the ANAFI via wifi. I can ping 192.168.42.1 and see the web page but connection using SDK still does not work. I can even see video on rtsp://192.168.42.1:554/live

Here’s an FDR from when the ANAFI is in this state: https://drive.google.com/file/d/1agCvzNb6MHqFCWVnuiyjxfrmAQVJ48pX/view?usp=sharing

That’s a strange behaviour, I can see the wifi connection but after the drone doesn’t seems to receive any json request like the listener was not listening.
We will try to reproduce following the steps you provided and keep you updated.

1 Like

I found out a faster way to reproduce this problem:

It happens much more frequently when I do the following stress test: I request all states (send command arsdk_cmd_send_Common_Common_AllStates to the ANAFI) at an aggressive interval such as twice a second or faster.

When doing this I usually run into the problem within 10 minutes. I realize that the best practice with SDK is probably not to request AllStates at all unless necessary. But this stress test is just something I discovered reproduces the problem quickly.

Hi Christopher

We were able to reproduce your issue by spamming the drone with AllStates commands, in this case the AllStates is issuing a lot of answer an requires a some processing on the drone and it manages to block the command loop.
At this point you will experience a SDK disconnection, but the drone is still stuck in the command processing loop.
Depending of the amount of remaining commands in queue, it can take up to 2mn before the command loop is available again to receive a connection request.

We didn’t manage to reproduce it when using Skycontroller3 + FF6.

We are working on a fix that will avoid this issue when too many commands are queued, but in the meantime I suggest verifying that you are not sending too many consecutive commands that could block the control loop.

Regards
Sebastien

1 Like

We were able to reproduce your issue by spamming the drone with AllStates commands, in this case the AllStates is issuing a lot of answer an requires a some processing on the drone and it manages to block the command loop.

Thank you for your response, I removed the unnecessary AllStates calls entirely and was able to fly the ANAFI all day without incident.

It also helped me to set the connection timeout behavior using arsdk_cmd_send_Rth_Set_delay() so that the ANAFI returns home if disconnected for a few seconds, instead of loitering out there forever until it runs out of battery.

This topic was automatically closed 3 days after the last reply. New replies are no longer allowed.