Hello,
I am looking for retrieving info about the link quality when operating the Anafi AI in 4G thanks to Olympe, something similar to LinkSignalQuality of previous versions of Anafis.
Do you have an idea how to retrieve this info ?
Thanks !
I find a function to retrieve connection info :
*event message* olympe.messages.network.Event.State(*default_capabilities=None* , *routing_info=None* , *global_link_quality=None* , *links_status=None* , *cellular_max_bitrate=None* , *direct_connection_mode=None* , *_policy='check_wait'* , *_float_tol=(1e-07, 1e-09)* )
from olympe.messages.network.Event import (
State,
)
self.sub_link_status = self.drone.subscribe(self.on_LinkStatusChanged, expectation=State(_policy="wait"), queue_size=1)
What returns :
OrderedDict([('default_capabilities', {'supported_direct_connection_modes': (<DirectConnectionMode.secure: 1>, <DirectConnectionMode.legacy: 0>), 'cellular_min_bitrate': 0, 'cellular_max_bitrate': 0}), ('routing_info', {'policy': <RoutingPolicy.wlan: 1>, 'current_link': <RoutingLink.wlan: 1>}), ('global_link_quality', {'quality': 0}), ('links_status', {'links': [{'type': <LinkType.wlan: 3>, 'status': <LinkStatus.running: 2>, 'quality': 0, 'error': <LinkError.none: 0>, 'cellular_status': <CellularStatus.unknown: 0>}]}), ('cellular_max_bitrate', {'max_bitrate': 0}), ('direct_connection_mode', <DirectConnectionMode.secure: 1>)])
The doc says quality is a int32, are they bounds for it ? I managed to get 1 at best
Hello @Jatou,
You can use GlobalLinkQuality to retrieve this information.
The link quality is indicated on a scale from 1 (poor) to 5 (excellent), or 0 if unavailable.
The quality
field is inside the LinkInfo
structure, which is part of the LinksStatus
message, provides the same information.
Best regards,
Hugo
Thanks for your answers !