Wifi RSSI reads to 0 for unknown reasons

This is my test app (shortened):

    def get_state_safe(self, state):
        ''' Survive possible exception (e.g. when value is not available yet). Ask before fetch '''
        if not self.drone.connection_state():
            return None
        if self.drone.check_state(state):
            return self.drone.get_state(state)
        return None

    def report_status(self):
        if self.drone.connection_state():
            rssi = self.get_state_safe(wifi.rssi_changed)
            rssi_state = rssi["rssi"] if rssi is not None else '??'
        self.logger.info(f"wifi state: rssi: {rssi_rssi}")

report_status is called once per second from a timer.

Generally it works, but it freaks out from time to time, reporting an RSSI value of 0 dBm.

2022-10-14 11:32:03,300 [INFO] wifitest.py: wifi rssi: ??
2022-10-14 11:32:04,294 [INFO] wifitest.py: wifi rssi: ??
2022-10-14 11:32:05,295 [INFO] wifitest.py: wifi rssi: 0
2022-10-14 11:32:06,295 [INFO] wifitest.py: wifi rssi: -26
2022-10-14 11:32:07,307 [INFO] wifitest.py: wifi rssi: -29
2022-10-14 11:32:08,307 [INFO] wifitest.py: wifi rssi: -27
2022-10-14 11:32:09,307 [INFO] wifitest.py: wifi rssi: -28
2022-10-14 11:32:10,308 [INFO] wifitest.py: wifi rssi: -28
2022-10-14 11:32:11,308 [INFO] wifitest.py: wifi rssi: 0
2022-10-14 11:32:12,309 [INFO] wifitest.py: wifi rssi: -34
2022-10-14 11:32:13,323 [INFO] wifitest.py: wifi rssi: -51
2022-10-14 11:32:14,324 [INFO] wifitest.py: wifi rssi: -51
2022-10-14 11:32:15,324 [INFO] wifitest.py: wifi rssi: 0
2022-10-14 11:32:16,325 [INFO] wifitest.py: wifi rssi: -53
2022-10-14 11:32:17,326 [INFO] wifitest.py: wifi rssi: -51
2022-10-14 11:32:18,328 [INFO] wifitest.py: wifi rssi: -52
2022-10-14 11:32:19,327 [INFO] wifitest.py: wifi rssi: -51
2022-10-14 11:32:20,327 [INFO] wifitest.py: wifi rssi: -53
2022-10-14 11:32:21,328 [INFO] wifitest.py: wifi rssi: -51
2022-10-14 11:32:22,328 [INFO] wifitest.py: wifi rssi: -51
2022-10-14 11:32:23,331 [INFO] wifitest.py: wifi rssi: 0
2022-10-14 11:32:24,329 [INFO] wifitest.py: wifi rssi: -52
2022-10-14 11:32:25,330 [INFO] wifitest.py: wifi rssi: -52
2022-10-14 11:32:26,333 [INFO] wifitest.py: wifi rssi: 0
2022-10-14 11:32:27,336 [INFO] wifitest.py: wifi rssi: -51
2022-10-14 11:32:28,337 [INFO] wifitest.py: wifi rssi: -50
2022-10-14 11:32:29,368 [INFO] wifitest.py: wifi rssi: -51
2022-10-14 11:32:30,357 [INFO] wifitest.py: wifi rssi: -56
2022-10-14 11:32:31,357 [INFO] wifitest.py: wifi rssi: -51
2022-10-14 11:32:32,358 [INFO] wifitest.py: wifi rssi: -51
2022-10-14 11:32:33,359 [INFO] wifitest.py: wifi rssi: 0
2022-10-14 11:32:34,374 [INFO] wifitest.py: wifi rssi: -53

The following video captures this application run on a Raspberry PI. In parallel I’m running wavemon in a PI console. wavemon does capture the RSSI way more often than once per second, it should see the “0” if there would be really one.

I never noticed to see RSSI=0 if I use the value reported by vmeta in the video stream.

The question is: Why does the SDK report “0” out of the sudden?

To add another aspect to this question: I was trying to play a bit with the “set_xxx” functions w.r.t. Wifi. I really have doubts, that this might be a good idea at all, especially if you are currently connected with the drone via Wifi.

Example: I “just” tried to change the environment

    def wifi_set_environment(self, environment):
        if self.drone.connection_state():
            self.logger.info(f"set_environment {environment}")
            assert self.drone(wifi.set_environment(environment)).wait().success()
        else:
            self.logger.error("drone not connected")

The result was, that I lost connectivity (obviously).

2022-10-15 09:19:47,696 [ERROR]         ulog - arsdk - net Too many ping failures
Traceback (most recent call last):
  File "/home/pi/vx-anafi-pi/wifitest.py", line 193, in <module>
    test.loop()
  File "/home/pi/vx-anafi-pi/wifitest.py", line 75, in loop
    self.wifi_set_environment(1)
  File "/home/pi/vx-anafi-pi/wifitest.py", line 82, in wifi_set_environment
    assert self.drone(wifi.set_environment(environment)).wait().success()
AssertionError

Could you please elaborate: What is the recommended procedure to change Wifi parameters via the SDK?

UPDATE: set_environment and set_ap_channel work kind of now. You MUST NOT wait and assert on success.

set_country seems to not disturb connectivity.

Setting the AP channel within the existing band doesn’t break connectivity. Changing the band does. I think this is acceptable.

Spontaneous RSSI=0 readings persist

Changing the wifi settings while your connected to the drone over wifi is perious and should not be done in operation (on the field). Olympe has ZERO knowledge/behaviour specific to a particular command message.

On the contrary, the SkyController has more intelligence and may help you recover the drone connectiviy if you set and forget the security key for example.

If I remember correctly the RSSI value is computed by the Parrot drone firmware from the low level Wifi chip counters value. To compute a meaningful value for the RSSI, the drone needs to see a minimum of wifi traffic. When the video streaming is not enabled, the SDK traffic may not be sufficient to compute the RSSI. In this case, the drone set the RSSI to 0 which is a known invalid value that must not be interpreted by higher level functions.

Changing the wifi settings while your connected to the drone over wifi is perious and should not be done in operation (on the field). Olympe has ZERO knowledge/behaviour specific to a particular command message.

Yes, I can imagine that.

Thanks. That might explain that I never saw this “rssi=0” in vmeta while streaming. Not a big thing.

This topic was automatically closed after 30 days. New replies are no longer allowed.