Page 1 of 1

Robust txCAN()? errors and time outs

Posted: Mon Jun 18, 2018 3:34 am
by TXBDan
Hello,

I'm curious about how to make my sending of CAN messages as robust as possible. I notice that I occasionally get fail warnings which are triggered when txCAN() returns 0. I'm sending data at 50Hz (a send function is running with an onTick() at 50Hz) with the CANBUS set to 1mbps.

How should the "timeout" parameter be used? the default value is 100ms which seems very long. I don't want to block for 100ms if it can't send. Should i use a shorter value if i intend to run at 50Hz (20ms period)?
https://wiki.autosportlabs.com/RaceCapt ... ting#txCAN

Also is it ok to rapid fire several txCAN() calls in a row? I've seen some example code insert sleep(10) statements, but i don't want to wait around for 10ms.

Thanks,
Dan

Posted: Mon Jul 09, 2018 9:30 pm
by brentp
There's currently a 2 message buffer for sending CAN messages, so at the moment you'll need to work around that. Fine-tuning your timeout in your script is likely the best way to go for now.