Skip to content

Commit

Permalink
Fix Reconnect Issue
Browse files Browse the repository at this point in the history
Client socket is never bound to receiving port to receive drone replies;
This causes DJITelloPy to not be able to reconnect after running a
script once. By binding it, the drone is able to reconnect without
issue.

This was adopted from my other branch,
[LightDJITelloPy](https://github.com/Desperationis/LightDJITelloPy).
  • Loading branch information
Desperationis committed Oct 6, 2022
1 parent 54736e6 commit b8c3fe3
Showing 1 changed file with 1 addition and 0 deletions.
1 change: 1 addition & 0 deletions djitellopy/tello.py
Original file line number Diff line number Diff line change
Expand Up @@ -110,6 +110,7 @@ def __init__(self,
if not threads_initialized:
# Run Tello command responses UDP receiver on background
client_socket = socket.socket(socket.AF_INET, socket.SOCK_DGRAM)
client_socket.bind(("", Tello.CONTROL_UDP_PORT))
response_receiver_thread = Thread(target=Tello.udp_response_receiver)
response_receiver_thread.daemon = True
response_receiver_thread.start()
Expand Down

0 comments on commit b8c3fe3

Please sign in to comment.