I tried to change Anafi wifi band to 5ghz using the code below but it didn’t go well.
The result of the code is same as the first post.
(I realize same thing happens to switching to 2.4GHz)
The point I can’t understand is why sometimes my drone switches to 5Ghz and sometimes not under SAME CONDITION.
I’ve also tried hard reset(by pressing battery button) and factory reset(by using
olympe.messages.common.Factory.Reset).
Have someone ever succeeded in switching Anafi wifi band to 5GHz using olympe?
Are there any bugs or problems in set_ap_channel() method?
I need your help please…!!
def main():
#connect to drone
DRONE_IP_ADDRESS='192.168.42.1'
DRONE_IP1=os.environ.get('DRONE_IP1', DRONE_IP_ADDRESS)
drone1 = olympe.Drone(DRONE_IP1)
drone1.connect()
#set environment to 'indoor'
drone1(set_environment(environment=0, _timeout=10)).wait()
#set country to JAPAN.
drone1(
set_country(selection_mode=0, code='JP', _timeout=10)
>> country_changed(selection_mode=0, code='JP', _timeout=10)
).wait()
#change wifi band to 5ghz
drone1(
set_ap_channel(type=3, band=1, channel=40, _timeout=60)
>> ap_channel_changed(type=3, band=1, channel=40, _timeout=60)
).wait()
drone1.disconnect()
if __name__=='__main__':
main()
The output(couldn’t switch to 5GHz) is below.
For reason of character limit, I truncated very first part of the output.
2022-07-19 13:38:55,374 [INFO] olympe.drone.ANAFI-L105158 - _recv_cmd_cb - gimbal.relative_attitude_bounds(gimbal_id=0, min_yaw=0.0, max_yaw=0.0, min_pitch=-135.0, max_pitch=105.0, min_roll=-38.0, max_roll=38.0, list_flags='')
2022-07-19 13:38:55,375 [INFO] olympe.drone.ANAFI-L105158 - _recv_cmd_cb - gimbal.absolute_attitude_bounds(gimbal_id=0, min_yaw=0.0, max_yaw=0.0, min_pitch=-90.0, max_pitch=90.0, min_roll=0.0, max_roll=0.0, list_flags='')
2022-07-19 13:38:55,375 [INFO] olympe.drone.ANAFI-L105158 - _recv_cmd_cb - gimbal.max_speed(gimbal_id=0, min_bound_yaw=0.0, max_bound_yaw=0.0, current_yaw=0.0, min_bound_pitch=0.0, max_bound_pitch=180.0, current_pitch=30.0, min_bound_roll=0.0, max_bound_roll=180.0, current_roll=30.0, list_flags='')
2022-07-19 13:38:55,376 [INFO] olympe.drone.ANAFI-L105158 - _recv_cmd_cb - camera.max_zoom_speed(cam_id=0, min=0.0, max=10.0, current=0.2345000058412552, list_flags='')
2022-07-19 13:38:55,377 [INFO] olympe.drone.ANAFI-L105158 - _recv_cmd_cb - camera.zoom_velocity_quality_degradation(cam_id=0, allowed=1, list_flags='')
2022-07-19 13:38:55,378 [INFO] olympe.drone.ANAFI-L105158 - _recv_cmd_cb - gimbal.calibration_state(state='required', gimbal_id=0, list_flags='')
2022-07-19 13:38:55,379 [INFO] olympe.drone.ANAFI-L105158 - _recv_cmd_cb - gimbal.offsets(gimbal_id=0, update_state='inactive', min_bound_yaw=0.0, max_bound_yaw=0.0, current_yaw=0.0, min_bound_pitch=-5.0, max_bound_pitch=5.0, current_pitch=0.0, min_bound_roll=-5.0, max_bound_roll=5.0, current_roll=0.0, list_flags='')
2022-07-19 13:38:55,379 [INFO] olympe.drone.ANAFI-L105158 - _recv_cmd_cb - camera.autorecord(cam_id=0, state='active', list_flags='')
2022-07-19 13:38:55,380 [INFO] olympe.drone.ANAFI-L105158 - _recv_cmd_cb - dri.dri_state(mode='disabled')
2022-07-19 13:38:55,380 [INFO] olympe.drone.ANAFI-L105158 - _recv_cmd_cb - rth.ending_hovering_altitude(current=2.0, min=1.0, max=10.0)
2022-07-19 13:38:55,380 [INFO] olympe.drone.ANAFI-L105158 - _recv_cmd_cb - ardrone3.SettingsState.ProductGPSVersionChanged(software='3.01R', hardware='')
2022-07-19 13:38:55,381 [INFO] olympe.drone.ANAFI-L105158 - _recv_cmd_cb - common.SettingsState.AllSettingsChanged()
2022-07-19 13:38:55,383 [INFO] olympe.drone.ANAFI-L105158 - _send_command_impl - mission.custom_msg_enable() has been sent to the device
2022-07-19 13:38:55,445 [INFO] olympe.drone.ANAFI-L105158 - _on_connected - <olympe.arsdkng.cmd_itf.ConnectedEvent object at 0x7f6669c73700>
2022-07-19 13:38:55,447 [INFO] olympe.pdraw.ANAFI-L105158 - _create_pomp_loop - Creating pomp loop
2022-07-19 13:38:55,448 [INFO] olympe.pdraw.ANAFI-L105158 - _create_pomp_loop - Creating pomp loop
2022-07-19 13:38:55,451 [INFO] olympe.drone.ANAFI-L105158 - _send_command_impl - wifi.set_environment(environment=0) has been sent to the device
2022-07-19 13:38:55,583 [INFO] olympe.drone.ANAFI-L105158 - _recv_cmd_cb - wifi.environment_changed(environment='indoor')
2022-07-19 13:38:55,734 [INFO] olympe.drone.ANAFI-L105158 - _recv_cmd_cb - wifi.country_changed(selection_mode='manual', code='FR')
2022-07-19 13:38:55,913 [WARNING] olympe.media - _get_all_media - HTTP 541: http://192.168.42.1:80/api/v1/media/medias b'Media Not Yet Indexed'
2022-07-19 13:38:56,754 [INFO] olympe.drone.ANAFI-L105158 - _recv_cmd_cb - wifi.rssi_changed(rssi=-33)
2022-07-19 13:38:56,914 [WARNING] olympe.media - _get_all_media - HTTP 541: http://192.168.42.1:80/api/v1/media/medias b'Media Not Yet Indexed'
2022-07-19 13:38:57,754 [INFO] olympe.drone.ANAFI-L105158 - _recv_cmd_cb - wifi.rssi_changed(rssi=-35)
2022-07-19 13:38:57,914 [ERROR] olympe.media - _get_all_media - The webserver is unavailable
2022-07-19 13:38:57,915 [WARNING] olympe.media - aconnect - Media are not yet indexed
2022-07-19 13:38:58,754 [INFO] olympe.drone.ANAFI-L105158 - _recv_cmd_cb - wifi.rssi_changed(rssi=-31)
2022-07-19 13:38:59,754 [INFO] olympe.drone.ANAFI-L105158 - _recv_cmd_cb - wifi.rssi_changed(rssi=-37)
2022-07-19 13:38:59,873 [INFO] olympe.drone.ANAFI-L105158 - _link_quality_cb - Link quality: tx=55, rx=100, rx_useful=98
2022-07-19 13:39:00,754 [INFO] olympe.drone.ANAFI-L105158 - _recv_cmd_cb - wifi.rssi_changed(rssi=-31)
2022-07-19 13:39:01,755 [INFO] olympe.drone.ANAFI-L105158 - _recv_cmd_cb - wifi.rssi_changed(rssi=-28)
2022-07-19 13:39:02,754 [INFO] olympe.drone.ANAFI-L105158 - _recv_cmd_cb - wifi.rssi_changed(rssi=-30)
2022-07-19 13:39:03,754 [INFO] olympe.drone.ANAFI-L105158 - _recv_cmd_cb - wifi.rssi_changed(rssi=-34)
2022-07-19 13:39:04,754 [INFO] olympe.drone.ANAFI-L105158 - _recv_cmd_cb - wifi.rssi_changed(rssi=-30)
2022-07-19 13:39:04,873 [INFO] olympe.drone.ANAFI-L105158 - _link_quality_cb - Link quality: tx=-1, rx=100, rx_useful=100
2022-07-19 13:39:05,462 [INFO] olympe.drone.ANAFI-L105158 - _send_command_impl - wifi.set_country(selection_mode=0, code='JP') has been sent to the device
2022-07-19 13:39:05,483 [INFO] olympe.drone.ANAFI-L105158 - _recv_cmd_cb - wifi.environment_changed(environment='indoor')
2022-07-19 13:39:05,631 [INFO] olympe.drone.ANAFI-L105158 - _recv_cmd_cb - wifi.country_changed(selection_mode='manual', code='JP')
2022-07-19 13:39:05,782 [INFO] olympe.drone.ANAFI-L105158 - _recv_cmd_cb - wifi.rssi_changed(rssi=-29)
2022-07-19 13:39:09,873 [INFO] olympe.drone.ANAFI-L105158 - _link_quality_cb - Link quality: tx=50, rx=100, rx_useful=100
2022-07-19 13:39:09,927 [INFO] olympe.drone.ANAFI-L105158 - _recv_cmd_cb - wifi.rssi_changed(rssi=-34)
2022-07-19 13:39:10,067 [INFO] olympe.drone.ANAFI-L105158 - _recv_cmd_cb - wifi.rssi_changed(rssi=0)
2022-07-19 13:39:11,754 [INFO] olympe.drone.ANAFI-L105158 - _recv_cmd_cb - wifi.rssi_changed(rssi=-32)
2022-07-19 13:39:12,755 [INFO] olympe.drone.ANAFI-L105158 - _recv_cmd_cb - wifi.rssi_changed(rssi=-34)
2022-07-19 13:39:13,754 [INFO] olympe.drone.ANAFI-L105158 - _recv_cmd_cb - wifi.rssi_changed(rssi=-33)
2022-07-19 13:39:14,754 [INFO] olympe.drone.ANAFI-L105158 - _recv_cmd_cb - wifi.rssi_changed(rssi=-35)
2022-07-19 13:39:14,873 [INFO] olympe.drone.ANAFI-L105158 - _link_quality_cb - Link quality: tx=-1, rx=100, rx_useful=93
2022-07-19 13:39:15,479 [INFO] olympe.drone.ANAFI-L105158 - _send_command_impl - wifi.set_ap_channel(type=3, band=1, channel=40) has been sent to the device
2022-07-19 13:39:19,873 [INFO] olympe.drone.ANAFI-L105158 - _link_quality_cb - Link quality: tx=50, rx=100, rx_useful=100
2022-07-19 13:39:22,490 [ERROR] ulog - pomp - read(fd=26) err=110(Connection timed out)
2022-07-19 13:39:22,492 [INFO] olympe.media - _websocket_event_reader - websocket closed
2022-07-19 13:39:23,491 [ERROR] ulog - arsdk - net Too many ping failures
2022-07-19 13:39:23,492 [INFO] olympe.drone.ANAFI-L105158 - _link_status_cb - Link status: 0
2022-07-19 13:39:23,494 [INFO] olympe.pdraw.ANAFI-L105158 - _destroy_pomp_loop - Pomp loop has been destroyed: Thread-5
2022-07-19 13:39:23,595 [INFO] olympe.pdraw.ANAFI-L105158 - _destroy_pomp_loop - Pomp loop has been destroyed: Thread-4
2022-07-19 13:39:23,597 [INFO] olympe.drone.ANAFI-L105158 - _disconnected_cb - Disconnected from device: ANAFI-L105158
2022-07-19 13:39:23,607 [INFO] olympe.drone.ANAFI-L105158 - _on_device_removed - <olympe.arsdkng.cmd_itf.DisconnectedEvent object at 0x7f6669c26c10>
2022-07-19 13:39:23,614 [INFO] olympe.drone.ANAFI-L105158 - _on_device_removed - <olympe.arsdkng.cmd_itf.DisconnectedEvent object at 0x7f6669c26580>
2022-07-19 13:39:23,616 [INFO] olympe.drone.ANAFI-L105158 - disconnect - Disconnection with the device OK. IP: b'192.168.42.1'
2022-07-19 13:39:23,648 [INFO] olympe.drone.ANAFI-L105158 - _on_device_removed - <olympe.arsdkng.cmd_itf.DisconnectedEvent object at 0x7f6669c26eb0>
2022-07-19 13:39:23,649 [INFO] olympe.media - _shutdown - olympe.media shutdown
2022-07-19 13:39:23,650 [INFO] olympe.scheduler - _destroy_pomp_loop - Pomp loop has been destroyed: subscribers_thread
2022-07-19 13:39:23,951 [INFO] olympe.media - _destroy_pomp_loop - Pomp loop has been destroyed: Thread-3
2022-07-19 13:39:23,952 [INFO] olympe.backend - _destroy_pomp_loop - Pomp loop has been destroyed: Thread-2
P.S.
I will be offline for 4~5 days. (sorry)