mavlink / MAVSDK-Python

MAVSDK client for Python.
https://mavsdk.mavlink.io
BSD 3-Clause "New" or "Revised" License
324 stars 220 forks source link

timeout on command arm, takeoff etc. #217

Closed Owiec94 closed 4 years ago

Owiec94 commented 4 years ago

I'm getting an error while using example 'takeoff_and_land.py":

Waiting for mavsdk_server to be ready...
Connected to mavsdk_server!
Waiting for drone to connect...
Drone discovered with UUID: 1
-- Arming
Traceback (most recent call last):
  File "test.py", line 37, in <module>
    loop.run_until_complete(run())
  File "C:\Users\Admin\AppData\Local\Programs\Python\Python37\lib\asyncio\base_events.py", line 587, in run_until_complete
    return future.result()
  File "test.py", line 25, in run
    await drone.action.arm()
  File "C:\Users\Admin\AppData\Local\Programs\Python\Python37\lib\site-packages\mavsdk\generated\action.py", line 230, in arm
    raise ActionError(result, "arm()")
mavsdk.generated.action.ActionError: TIMEOUT: 'Timeout'; origin: arm(); params: ()

What cause that problem? I'm connecting with pixhawk with esp8266 (pre build bin pixracer for connecting udp 14560 port) without any problems on mission planner app, but some kind of error appears using python example.

JonasVautherin commented 4 years ago

Are you using PX4?

Owiec94 commented 4 years ago

Thank You for Your quick answer! Yes, I'm using Pixhawk 2.4.8 with arducopter v 4.0.3 connected through esp8266 (firmware firmware_UDP_2016-12-05.bin from ugcs). I can fully manage by this connection on Mission Planner, but using python example is problematic for it

JonasVautherin commented 4 years ago

MAVSDK is developed and tested against PX4, so I cannot really say what is the expected behavior with Arducopter. I'm a bit surprised that arm() fails already. I guess it may be related to the flight mode: https://github.com/mavlink/MAVSDK/blob/develop/src/plugins/action/action_impl.cpp#L168-L200

But I would need input from somebody who knows how APM works...

julianoes commented 4 years ago

Ok, you're using ArduCopter, not PX4. MAVSDK is currently not compatible with ArduPilot: See https://github.com/mavlink/MAVSDK/issues/728.

Owiec94 commented 4 years ago

If I understood good, mavsdk will not work with my FC https://static2.abc-rc.pl/pol_pl_Kontroler-lotu-Pixhawk-PX4-V2-4-8-karta-SD-1GB-Autopilot-PX4-8106_3.jpg ? If yes, is there any possibility to change firmware to working with this FC? Which FC are You using to work with mavsdk? Or do You know any other possibility to create planning mission remotely and run without transmitter, just using ?

julianoes commented 4 years ago

@Owiec94 you can use QGroundControl and then flash PX4 which is compatible with MAVSDK. The hardware itself works with both, ArduPilot or PX4.

Owiec94 commented 4 years ago

@julianoes Thank You for Your answer, Actually I've reflashed my FC with QGroundControl software but it wont connect with that software. Can You help me? What is weird - the other FC (the same model 2.4.8) with arducopter firmware can communicate with QGroundControl, but PX4 firmware no.

julianoes commented 4 years ago

wont connect with that software

What do you see? And which version have you flashed?

Owiec94 commented 4 years ago

https://easyupload.io/71ug8o

https://easyupload.io/7cizef

https://easyupload.io/csi25f

Yellow message Your vehicle is not responding... the blue led is blinking and the main strong led is turned off.

julianoes commented 4 years ago

Ok, that's odd. Does it also not appear after you unplug USB and plug it back in?

Owiec94 commented 4 years ago

Sadly, no, tried all possible things, I've uploaded also firmware into esp8266 to connect via UDP but it still without any success. Should I install any additional drivers etc? Notice: I've no problem with connecting with Mission Planner and QGroundControl with arducopter firmware. But I want to use mavsdk with PX4 firmware.

Owiec94 commented 4 years ago

So far I've connected with QGround Control with esp8266. Also I can connect with Mission Planner. Firmware: Arducopter v 4.0.3. I tested example takeoff and lany.py, received access denied when tryin to arm craft. GPS has coordinates.

julianoes commented 4 years ago

@Owiec94 where did you buy the Pixhawk from? My suspicion is that it could be a (bad) clone that lacks some hardware component which prevents PX4 from starting properly. If you have a debug cable as explained in https://docs.px4.io/master/en/flight_controller/pixhawk.html#console-port you could try to see the startup messages and see if that shows any specific errors.

Owiec94 commented 4 years ago

Dear @julianoes Thank You for Your support. It was an error "avionics power low" 4.89V which is a mistake, my pixhawk power module has 5.3V output. Where I can calibrate or set lower threshold or do something to ignore that message?

Of course my module bought in china, it is not original FC.

julianoes commented 4 years ago

Aha! There is a param to skip that check, I think it's this one: https://dev.px4.io/master/en/advanced/parameter_reference.html#CBRK_SUPPLY_CHK