Page 1 of 1

Displaying CAN data in realtime

Posted: Mon Jun 15, 2015 7:21 pm
by Copper280z
I wrote a relatively simple script to display CAN data in realtime from the serial port of the RCP, thought it might be useful here. The lua script the RCP has loaded is just printing CAN data like : "ID, byte, byte, byte, ...". I believe there's an example script that does this in the wiki somewhere.

In short I'm reading the serial port, adding the data received to a sorted text list, then updating the text list every 0.2 sec. This is only my second attempt at python, so be gentle. :)

I did discover that it's pretty easy to make the lua script crash. I believe the serial buffer is filling up and then the script crashes. This doesn't seem to be the ideal way to handle that, but I'm not sure.

https://github.com/Copper280z/CanDispla ... Display.py