I recently got hold of a Tello drone in order to use it in an AI project of mine. So far, I have been testing it and trying to control the drone using the djitellopy module that has been created for python. At first, everything was fine, but now when running simple code, the drone automatically lands with a blinking red light and no error message, the code continues to run until it realizes it cannot land because it already has. Could this be an issue with the battery slot or something else? Here is the code I'm trying to run...
from djitellopy import Tello
import cv2, math, time
tello = Tello()
tello.connect()
tello.streamon()
frame_read = tello.get_frame_read()
tello.takeoff()
time.sleep(3)
while True:
# In reality you want to display frames in a seperate thread. Otherwise
# they will freeze while the drone moves.
img = frame_read.frame
cv2.imshow("drone", img)
key = cv2.waitKey(1) & 0xff
if key == 27: # ESC
break
tello.land()
from djitellopy import Tello
import cv2, math, time
tello = Tello()
tello.connect()
tello.streamon()
frame_read = tello.get_frame_read()
tello.takeoff()
time.sleep(3)
while True:
# In reality you want to display frames in a seperate thread. Otherwise
# they will freeze while the drone moves.
img = frame_read.frame
cv2.imshow("drone", img)
key = cv2.waitKey(1) & 0xff
if key == 27: # ESC
break
tello.land()