How to set communication between Raspberry Pi 4B and pixhawk 6c through CAN Bus

Hello everyone, I have a question is that I try to build communication Raspberry Pi 4B(OS: Rasbian) and pixhawk 6c through CAN Bus. I already set the all setting included wire, bitrate=500k, etc. And I use the ccandump pn Raspberry to check is there any data, and result show attachment:
the ID:1F04397B, 0100047B seems the data send from Pixhawk 6c, and ID:123 is I send from Raspberry, so the connection from Raspberry to CAN and from Pixhawk to CAN should be correct. And the problem is how can I to send the data from Raspberry to Pixhawk through CAN?

Hi,
What is the CAN controller chip that you are using with the Raspberry pi 4

Hi,
I use the MCP2515(with TJA1050), and connection with Raspberry as shown below, and for the CANL and CANH connect to the Pixhawk CANL and CANH respectively.

How are you checking if Raspberry pi is sending CAN messages at a specific baud rate to pixhawk.
Also what is CAN baudrate for pixhawk

I don’t really know how can I set the specific baud rate for Raspberry when I sending CAN messages, but when I use “cansend can0 123#DEADBE”, I can see the message on CAN bus using “candump can0”. Like first attachment above.

And the CAN baudrate for pixhawk is 500000.

Well i suggest to ensure that Raspberry is sending 500 k baudrate.
What is the os loaded on Raspberry

I check the baudrate for Raspberry when sending CAN message is 500k like picture shows below

OS:
NAME=“Debian GNU/Linux”
VERSION_ID=“12”
VERSION=“12 (bookworm)”

What is the voltage for canH and CanL.
Also have you grounded the can controller with raspberry pi and pixhawk

Both are 2.5V.
Yes, the ground of CAN controller connect to Raspberry pi, and the ground of pixhawk also connect to Raspberry pi.

I think CANH has to be near to 5v and CANL has to be near to 3v . The difference between them must be at least 2v .