Description
Hi!
I am trying to use a Jetson Orin Nano to send commands to a Pixhawk Orange Cube+. But when using the UART interface for connecting to TELEM1 or TELEM2 ports I can't send/request messages. (Over USB it works just fine. But not really viable in my current situation.)
When using the mavsdk_server_linux-arm64-musl
binary:
$ ./mavsdk_server_linux-arm64-musl serial:///dev/ttyTHS1:1500000
[04:19:57|Info ] MAVSDK version: v3.6.0 (mavsdk_impl.cpp:30)
[04:19:57|Info ] Waiting to discover system on serial:///dev/ttyTHS1:1500000... (connection_initiator.h:20)
[04:19:57|Debug] New system ID: 1 Comp ID: 1 (mavsdk_impl.cpp:818)
[04:19:57|Debug] Component Autopilot (1) added. (system_impl.cpp:376)
[04:19:57|Warn ] Vehicle type changed (new type: 11, old type: 0) (system_impl.cpp:216)
[04:19:57|Debug] Discovered 1 component(s) (system_impl.cpp:494)
[04:19:57|Info ] System discovered (connection_initiator.h:62)
[04:19:57|Info ] Server started (grpc_server.cpp:173)
[04:19:57|Info ] Server set to listen on 0.0.0.0:50051 (grpc_server.cpp:174)
[04:19:57|Warn ] sending again after 0.503291 s, retries to do: 1 (512). (mavlink_command_sender.cpp:336)
[04:19:57|Warn ] Request was for msg ID: 148 (mavlink_command_sender.cpp:342)
[04:19:58|Warn ] Retrying failed for REQUEST_MESSAGE command for message: 148, to (1/1) (mavlink_command_sender.cpp:375)
[04:19:58|Warn ] sending again after 0.506956 s, retries to do: 1 (520). (mavlink_command_sender.cpp:336)
[04:19:59|Warn ] Retrying failed for command: 520) (mavlink_command_sender.cpp:380)
[04:19:59|Warn ] sending again after 0.500578 s, retries to do: 1 (512). (mavlink_command_sender.cpp:336)
[04:19:59|Warn ] Request was for msg ID: 148 (mavlink_command_sender.cpp:342)
[04:20:00|Warn ] Retrying failed for REQUEST_MESSAGE command for message: 148, to (1/1) (mavlink_command_sender.cpp:375)
[04:20:00|Warn ] sending again after 0.504918 s, retries to do: 1 (520). (mavlink_command_sender.cpp:336)
[04:20:01|Warn ] Retrying failed for command: 520) (mavlink_command_sender.cpp:380)
[04:20:01|Warn ] sending again after 0.506015 s, retries to do: 1 (512). (mavlink_command_sender.cpp:336)
[04:20:01|Warn ] Request was for msg ID: 148 (mavlink_command_sender.cpp:342)
[04:20:02|Warn ] Retrying failed for REQUEST_MESSAGE command for message: 148, to (1/1) (mavlink_command_sender.cpp:375)
[04:20:03|Debug] MAVLink: critical: PreArm: check steering and throttle config (system_impl.cpp:242)
[04:21:05|Debug] MAVLink: critical: PreArm: Hardware safety switch (system_impl.cpp:242)
[04:21:05|Debug] MAVLink: critical: PreArm: Radio failsafe on (system_impl.cpp:242)
[04:21:05|Debug] MAVLink: critical: PreArm: check steering and throttle config (system_impl.cpp:242)
What I understand is it can recieve messages but can't send.
When using the Python library:
async def run():
usv = System()
await usv.connect(system_address="serial:///dev/ttyTHS1:1500000")
await usv.core.set_mavlink_timeout(20)
print("Waiting for drone to connect...")
async for state in usv.core.connection_state():
if state.is_connected:
print(f"-- Connected to USV!")
break
print("Downloading mission")
await usv.mission_raw.download_mission()
print("Downloaded")
Edit: Using mission
instead of mission_raw
results in no difference.
Output is:
Waiting for drone to connect...
-- Connected to USV!
Downloading mission
Traceback (most recent call last):
File "/docker/usv-server/manual-tests/mavlink-mavsdk.py", line 137, in <module>
asyncio.run(run())
File "/usr/lib/python3.11/asyncio/runners.py", line 188, in run
return runner.run(main)
^^^^^^^^^^^^^^^^
File "/usr/lib/python3.11/asyncio/runners.py", line 120, in run
return self._loop.run_until_complete(task)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "uvloop/loop.pyx", line 1518, in uvloop.loop.Loop.run_until_complete
File "/docker/usv-server/manual-tests/mavlink-mavsdk.py", line 81, in run
await usv.mission_raw.download_mission()
File "/docker/usv-server/.venv/lib/python3.11/site-packages/mavsdk/mission_raw.py", line 876, in download_mission
raise MissionRawError(result, "download_mission()")
mavsdk.mission_raw.MissionRawError: TIMEOUT: 'Timeout'; origin: download_mission(); params: ()
The output is the same whether the await usv.core.set_mavlink_timeout()
is 0.5 or 20. What I again understand is it can receive messages like heartbeats so it can connect to Pixhawk (at least identify it and think it's connected) but can't send requests/messages like download_mission().
I think the problem is about connection not using hardware RTS/CTS. I have had such a problem with another UART interface using device where I've had miss-connected one of the RTS/CTS pins. This time I've triple-checked cables, connections and the code. All looks fine. So my last stop is to ask here. Do you see anything wrong with the code/commands? Is RTS/CTS disabled in MavSDK by default? Is there a way to enable/force usage of RTS/CTS in MavSDK if it's disabled or not always enforced?
Really appreciate any help.
Also, I'm really grateful to the developers for both developing and maintaining such a useful library. Keep doing the good work!