Connect to SkyController3 with Olympe

Hello,

I’m trying to connect to my Anafi SkyController3 via Olympe with the example ‘physical_skyctrl.py’.
Despite that I can ping my SkyController on 192.168.53.1, when I run the example, I got the following output :

` 20/05/2019 21:26:43.279874	_create_pomp_loop               Creating pomp loop
20/05/2019 21:26:43.280233	_create_manager                 New manager has been created!
20/05/2019 21:26:43.280411	_create_manager                 Manager device callbacks has been added to the manager
20/05/2019 21:26:43.280646	_create_net_backend             New net backend has been created
20/05/2019 21:26:43.280803	_create_net_backend             Set backend socket callback OK
20/05/2019 21:26:43.280947	create_timer                    Creating pomp timer
20/05/2019 21:26:43.281107	create_timer                    Creating pomp timer
20/05/2019 21:26:43.281939	_start_net_discovery            Net discovery object has been created
I arsdkctrl: discovery 'net': start
20/05/2019 21:26:43.282231	_backend_socket_cb              backend_pointer <olympe_deps.LP_struct_arsdkctrl_backend_net object at 0x7f566bec2488> socket_fd 10 socket_kind 0 userdate_pointer None
20/05/2019 21:26:43.282435	_start_net_discovery            Net discovery has been started
20/05/2019 21:26:45.283427	_backend_socket_cb              backend_pointer <olympe_deps.LP_struct_arsdkctrl_backend_net object at 0x7f566bea68c8> socket_fd 10 socket_kind 0 userdate_pointer None
20/05/2019 21:26:47.284751	_backend_socket_cb              backend_pointer <olympe_deps.LP_struct_arsdkctrl_backend_net object at 0x7f566bea68c8> socket_fd 10 socket_kind 0 userdate_pointer None
I arsdkctrl: discovery 'net': stop
20/05/2019 21:26:48.345070	connection                      Unable to connect to the device. IP : b'192.168.53.1' 
20/05/2019 21:26:48.345728	_stop_discovery                 Discovery has been stopped
20/05/2019 21:26:48.346157	_stop_discovery                 Discovery object has been destroyed
20/05/2019 21:26:48.346719	_stop_discovery                 No discovery instance to be stopped
20/05/2019 21:26:48.349305	_destroy_net_backend            Net backend has been destroyed
20/05/2019 21:26:48.349778	_destroy_manager                Manager has been destroyed
20/05/2019 21:26:48.350297	destroy_timer                   Pomp loop timer has been destroyed
20/05/2019 21:26:48.350739	destroy_timer                   Pomp loop timer has been destroyed
20/05/2019 21:26:48.351126	_destroy_pomp_loop              Pomp loop has been destroyed `

Does anyone has an idea why it’s not connecting ?
Thank you in advance

Hello,

I can reproduce this issue.
SkyController 3 discovery does not currently work with Olympe. I will look into this.

In the meantime, you should be able to workaround this issue by specifying the “drone_type” you are trying to connect to (ANAFI4K or ANAFI_THERMAL) :

import olympe
import olympe_deps as od
from olympe.messages.skyctrl.CoPiloting import setPilotingSource

drone = olympe.Drone("192.168.53.1", mpp=True, drone_type=od.ARSDK_DEVICE_TYPE_ANAFI4K)
drone.connection()
drone(setPilotingSource(source="Controller")).wait()

Thanks

Nicolas

Hello Nicolas,

Thank you very much for this quick answer and the workaround. It seems to work well, as I have the skyctrl.SkyControllerState.AttitudeChanged messages popping in the console.

However, this state display is polluting a little bit my console, and I have difficulties to read my other outputs. Do I have a way to mute it ?

Thank you in advance

Hello,

By default Olympe logs every message received from the drone with the INFO log level.

One solution could be to decrease the log verbosity or to redirect olympe logs to a file.
See: olympe.Drone constructor documentation

Some messages like “skyctrl.SkyControllerState.AttitudeChanged” that are spamming olympe logs should use the debug log level.

Currently, only the following messages are logged in debug for this reason:
(“ardrone3.PilotingState.AltitudeChanged”,
“ardrone3.PilotingState.AttitudeChanged”,
“ardrone3.PilotingState.FlyingStateChanged”,
“ardrone3.PilotingState.GpsLocationChanged”,
“ardrone3.PilotingState.PilotedPOI”,
“ardrone3.PilotingState.PositionChanged”,
“ardrone3.PilotingState.SpeedChanged”,
“ardrone3.GPSSettingsState.HomeChanged”,

This filtering is done in arsdkng/messages.py: https://github.com/Parrot-Developers/olympe/blob/2eb0cd7a2fffe82657ebed4955c0439f47ed8520/src/olympe/arsdkng/messages.py#L341

“skyctrl.SkyControllerState.AttitudeChanged” should be added to that list in the next release of the SDK.

Thanks

Hey, I tried to run the basic connect to skycontroller 3 script as in doc [here].(https://developer.parrot.com/docs/olympe/userguide.html#connect-to-a-skycontroller)

But i get the following error,

arsdkctrl: discovery ‘net’: start
I arsdkctrl: discovery ‘net’: add device name=‘Skycontroller 3’ id=‘PI040443AA8G050160’
I arsdkctrl_net: Sending json:
I arsdkctrl_net: { “arstream2_client_stream_port”: “55004”, “arstream2_client_control_port”: “55005”, “arstream2_supported_metadata_version”: “1”, “controller_name”: “arsdk-ng”, “controller_type”: “desktop”, “d2c_port”: 9988, “device_id”: “”, “qos_mode”: 0 }
I arsdkctrl_net: Received json:
I arsdkctrl_net: { “arstream2_server_stream_port”: 5004, “arstream2_server_control_port”: 5005, “c2d_update_port”: 51, “c2d_user_port”: 21, “status”: 0, “c2d_port”: 2233, “qos_mode”: 0, “proto_v”: 1 }
Traceback (most recent call last):
File "ctypes/callbacks.c", line 234, in ‘calling callback function’
File “/home/lenikhilsingh/code/parrot-groundsdk/scripts/olympe_deps.py”, line 70, in
type
((lambda callback: lambda *args: callback(*args))(bound_fields[name]))
File “/home/lenikhilsingh/code/parrot-groundsdk/packages/olympe/src/olympe/arsdkng/drone.py”, line 408, in _recv_cmd_cb
raise RuntimeError(“Unknown message id {}”.format(message_id))
RuntimeError: Unknown message id 2499805188
Traceback (most recent call last):
File "ctypes/callbacks.c", line 234, in ‘calling callback function’
File “/home/lenikhilsingh/code/parrot-groundsdk/scripts/olympe_deps.py”, line 70, in
type
((lambda callback: lambda *args: callback(*args))(bound_fields[name]))
File “/home/lenikhilsingh/code/parrot-groundsdk/packages/olympe/src/olympe/arsdkng/drone.py”, line 408, in _recv_cmd_cb
raise RuntimeError(“Unknown message id {}”.format(message_id))
RuntimeError: Unknown message id 2432696335
Traceback (most recent call last):
File "ctypes/callbacks.c", line 234, in ‘calling callback function’
File “/home/lenikhilsingh/code/parrot-groundsdk/scripts/olympe_deps.py”, line 70, in
type
((lambda callback: lambda *args: callback(*args))(bound_fields[name]))
File “/home/lenikhilsingh/code/parrot-groundsdk/packages/olympe/src/olympe/arsdkng/drone.py”, line 408, in _recv_cmd_cb
raise RuntimeError(“Unknown message id {}”.format(message_id))
RuntimeError: Unknown message id 2634022921
Traceback (most recent call last):
File "ctypes/callbacks.c", line 234, in ‘calling callback function’
File “/home/lenikhilsingh/code/parrot-groundsdk/scripts/olympe_deps.py”, line 70, in
type
((lambda callback: lambda *args: callback(*args))(bound_fields[name]))
File “/home/lenikhilsingh/code/parrot-groundsdk/packages/olympe/src/olympe/arsdkng/drone.py”, line 408, in _recv_cmd_cb
raise RuntimeError(“Unknown message id {}”.format(message_id))
RuntimeError: Unknown message id 2634022919
Traceback (most recent call last):
File "ctypes/callbacks.c", line 234, in ‘calling callback function’
File “/home/lenikhilsingh/code/parrot-groundsdk/scripts/olympe_deps.py”, line 70, in
type
((lambda callback: lambda *args: callback(*args))(bound_fields[name]))
File “/home/lenikhilsingh/code/parrot-groundsdk/packages/olympe/src/olympe/arsdkng/drone.py”, line 408, in _recv_cmd_cb
raise RuntimeError(“Unknown message id {}”.format(message_id))
RuntimeError: Unknown message id 2684354563
GPS position before take-off : OrderedDict([(‘latitude’, 500.0), (‘longitude’, 500.0), (‘altitude’, 500.0)])
Vehicle State is : OrderedDict([(‘state’, <FlyingStateChanged_State.landed: 0>)])
END OF SCRIPT

I arsdkctrl: discovery ‘net’: remove device name=‘Skycontroller 3’ id=‘PI040443AA8G050160’
I arsdkctrl: internally disconnect device name=‘Skycontroller 3’ type=SKYCTRL_3 id=‘PI040443AA8G050160’
I arsdkctrl: discovery ‘net’: stop

This is log level 2, if you want any other log levels please let me know!
As soon as the remote connects the connection breaks, can you help me with this? @ndessart

@Jerome can you help with this please? Or if you can connect me with someone, it will lots of help thank you!

Hi @cPabz,

Olympe 1.2.0 has been released and the SkyController example has been updated.
Could you update (repo sync), rebuild Olympe following the installation procedure from there and report back here any further issue you might have after that? Thank you!

Regards,

Nicolas