''No command land 'P' error message after takeoff using djitellopy

I have written this very simple code:

from djitellopy import Tello
import time
tello=Tello
tello.takeoff() # works just fine!
time.sleep(2)
tello.land() # returns error!

If there is any help I would appreciate it greatly!



Solution 1:[1]

i can see what your error is, on line 3 in your code,

from djitellopy import Tello
import time
tello=Tello
tello.takeoff() # works just fine!
time.sleep(2)
tello.land() # returns error!

look closely at the tello=Tello .. that needs to be tello=Tello(), so ur code becomes this:

from djitellopy import Tello
import time
tello=Tello()
tello.takeoff() # works just fine!
time.sleep(2)
tello.land() # returns error!

and that should work fine! enjoy!

Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source
Solution 1 Keshav.h