dji-sdk / RoboMaster-SDK

DJI RoboMaster Python SDK and Sample Code for RoboMaster EP.
Apache License 2.0
312 stars 141 forks source link

Sending STA mode info to Tello EDU does not work as intended #93

Open MrCampbellDuchess opened 1 year ago

MrCampbellDuchess commented 1 year ago

I am attempting to push an SSID and password to my Tello EDU in order to connect it to my access point and control via the SDK as demonstrated using example in /examples/12_drone/23_set_sta.py. The current python script looks as follows:

import robomaster
from robomaster import robot
robomaster.enable_logging_to_file()
if __name__ == '__main__':
    tl_drone = robot.Drone()
    tl_drone.initialize()
    try:
        tl_drone.config_sta(ssid="SkyNet", password="password")
        print("done")
    tl_drone.close()

This should, according to the documentation, push the ssid (Skynet) and password (password) to the drone and force a restart.

The log file when this is run looks like this:

2023-04-19 11:12:22,956 INFO robot.py:549 Drone: initialize, the connection uses local addr ('192.168.10.2', 8890)
2023-04-19 11:12:22,957 INFO conn.py:163 UdpConnection, bind ('192.168.10.2', 8890)
2023-04-19 11:12:22,958 INFO client.py:342 TextClient: _recv_task, Start to Recving data...
2023-04-19 11:12:22,959 INFO dds.py:339 TelloSubscriber: dispatcher_task is running...
2023-04-19 11:12:22,959 INFO client.py:366 TextClient: send_msg: command
2023-04-19 11:12:23,044 INFO client.py:352 TextClient: _recv_task, resp: <TextMsg, ok>
2023-04-19 11:12:23,091 INFO robot.py:608 Drone: _enable_sdk, The drone SDK is enabled
2023-04-19 11:12:23,092 INFO client.py:366 TextClient: send_msg: ap SkyNet password
2023-04-19 11:12:23,103 INFO client.py:352 TextClient: _recv_task, resp: <TextMsg, OK,drone will reboot in 3s>
2023-04-19 11:12:23,105 WARNING robot.py:592 not support on_off:0
2023-04-19 11:12:23,150 INFO client.py:362 _recv_task: quit.
2023-04-19 11:12:23,199 INFO robot.py:618 Drone close

The warning at 11:12:23,105 indicates that on_off is not supported. At this point the drone does NOT reboot. If I throw the switch into STA mode on the drone itself it does not attempt to connect to the router to obtain an IP address.

Is this reboot required to make this configuration successful?