damiafuentes / DJITelloPy

DJI Tello drone python interface using the official Tello SDK. Feel free to contribute!

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

'error Not joystick'

Zolubas opened this issue · comments

Hi every one.
I'm trying to send command like:

But after some commands like this:

from djitellopy import Tello
import time
tello = Tello()
tello.connect()
tello.takeoff()
tello.move_forward(100)
time.sleep(0.5)
tello.rotate_clockwise(90)
time.sleep(0.5)
tello.move_forward(100)
time.sleep(0.5)
tello.rotate_clockwise(90)
time.sleep(0.5)
tello.move_forward(100)
...
tello.land()

I received the 'error Not joystick' error.

Thanks to the library, and any assistance will be appreciated.

My terminal:

$ python s_path.py 
[INFO] tello.py - 122 - Tello instance was initialized. Host: '192.168.10.1'. Port: '8889'.
[INFO] tello.py - 437 - Send command: 'command'
[INFO] tello.py - 461 - Response command: 'ok'
[INFO] tello.py - 437 - Send command: 'takeoff'
[INFO] tello.py - 461 - Response takeoff: 'ok'
[INFO] tello.py - 437 - Send command: 'forward 100'
[INFO] tello.py - 461 - Response forward 100: 'ok'
[INFO] tello.py - 437 - Send command: 'cw 90'
[INFO] tello.py - 461 - Response cw 90: 'ok'
[INFO] tello.py - 437 - Send command: 'forward 100'
[INFO] tello.py - 461 - Response forward 100: 'ok'
[INFO] tello.py - 437 - Send command: 'cw 90'
[INFO] tello.py - 461 - Response cw 90: 'ok'
[INFO] tello.py - 437 - Send command: 'forward 100'
[INFO] tello.py - 461 - Response forward 100: 'error Not joystick'
[INFO] tello.py - 437 - Send command: 'forward 100'
[INFO] tello.py - 461 - Response forward 100: 'error Not joystick'
[INFO] tello.py - 437 - Send command: 'forward 100'
[INFO] tello.py - 461 - Response forward 100: 'error Not joystick'
Traceback (most recent call last):
  File "s_path.py", line 45, in <module>
    path(tello)
  File "s_path.py", line 32, in path
    path_s(tello,x,rs,yaw)
  File "s_path.py", line 13, in path_s
    tello.move_forward(x)
  File "/home/user/.local/lib/python3.8/site-packages/djitellopy/enforce_types.py", line 54, in wrapper
    return func(*args, **kwargs)
  File "/home/user/.local/lib/python3.8/site-packages/djitellopy/tello.py", line 649, in move_forward
    self.move("forward", x)
  File "/home/user/.local/lib/python3.8/site-packages/djitellopy/enforce_types.py", line 54, in wrapper
    return func(*args, **kwargs)
  File "/home/user/.local/lib/python3.8/site-packages/djitellopy/tello.py", line 614, in move
    self.send_control_command("{} {}".format(direction, x))
  File "/home/user/.local/lib/python3.8/site-packages/djitellopy/enforce_types.py", line 54, in wrapper
    return func(*args, **kwargs)
  File "/home/user/.local/lib/python3.8/site-packages/djitellopy/tello.py", line 486, in send_control_command
    self.raise_result_error(command, response)
  File "/home/user/.local/lib/python3.8/site-packages/djitellopy/enforce_types.py", line 54, in wrapper
    return func(*args, **kwargs)
  File "/home/user/.local/lib/python3.8/site-packages/djitellopy/tello.py", line 528, in raise_result_error
    raise Exception("Command '{}' was unsuccessful for {} tries. Latest response:\t'{}'"
Exception: Command 'forward 100' was unsuccessful for 4 tries. Latest response:	'error Not joystick'
[INFO] tello.py - 437 - Send command: 'land'
^C

Hey Fernando, long time no see 😎

Please try calibrating the drone using the official app. After connecting to your drone using your phone you can start the calibration procedure from the Tello App settings menu.
The app will then guide you through calibration (taking of the rotors and placing the drone in different positions).

Cheers Jakob