How connect to cube orange to raspberrypi 4 model b

hello everyone, I’m trying to run dronekit codes with raspberry pi, but I can’t connect cube orange, it says no heartbeat. What’s the solution?

Are you using gpio uart or usb uart?

Hi!

This video is very straighforward of how to do it.

Works for me.
bye

I’m connecting to uart via telem2

thanks for the feedback, i did the same but still getting the error so did you use cube orange

now i am getting this error ERROR:dronekit:Exception in message handler for HEARTBEAT
Traceback (most recent call last):
File “/usr/local/lib/python3.7/dist-packages/dronekit/init.py”, line 1531, in notify_message_listeners
fn(self, name, msg)
File “/usr/local/lib/python3.7/dist-packages/dronekit/init.py”, line 1223, in listener
raise APIException(“mode (%s, %s) not available on mavlink definition” % (m.custom_mode, m.base_mode))
dronekit.APIException: mode (0, 4) not available on mavlink definition
.
I can give orders to cube via mavproxy.

If you are using gpio for connection for 3b or newer, you have to disable the bluetooth because it occupies the gpio tx/rx.

this is my links.


this is the code i use:
{
from dronekit import connect

vehicle = connect(‘/dev/ttyAMA0’, baud=57600, wait_ready=True)

print(“I’m connected”)
}

I can connect with mavproxy.

the error i got:

my reference is https://youtu.be/kB9YyG2V-nA .Thank you for your interest

Can you try on telem1 and see if you would get the same error?

which firmware are you using? ardupilot or px4?

arducopter v 4.0.7

unfortunately still same error, i will change another parameter from mission planner serial2.

It’s weird that Cube Orange can be connected through mavlink but not dronekit.
Can you confirm there’s no other problem/service occupying the connection?

we have some experience in these works. is there any resource you can recommend? We actually built everything from scratch. I used the Communicating with Raspberry Pi via MAVLink — Dev documentation and https://youtu.be/kB9YyG2V-nA this link. thank you

Yes. I made a few companion raspberry pi setups.

And the same way works on my pi 4b.