Write to CAN bus

Hey guys,

I’m new to lua scripting and I’m having some problems. I’m trying to send location information from my pixhawk orange cube to my arduino over the can bus. However I am not receiving any Messages on the arduino. What am I missing? It would be great to get some help.

Here are my CAN-Parameters:

CAN_D1_PROTOCOL = 10
CAN_P1_DRIVER = 1
CAN_P1_BITRATE = 125000 (same on the Arduino)

Here is my Script:

can_send_pos.lua (1.3 KB)

I also tried the example script CAN_write.lua, but I don’t receive any messages either. Also when I use CAN:get_device(20) (like in the example script) instead of CAN.get_device(20) I get the following error: “CAN:get_device expected 1 arguments got 2”

Thank you for your help

Hey guys, I looked at the CAN log files and it seems that every transmission timed out.

tx_requests: 144
tx_rejected: 0
tx_success: 0
tx_timedout: 143
tx_abort: 1
rx_received: 0
rx_overflow: 0
rx_errors: 0
num_busoff_err: 0
num_events: 0
ECR: 80

Does anybody know why this is happening?
Thank you for your help