solder
Well-known member
I don't have the camera installed (or even connected) right now, but the following snippet of code did more or less what we're trying to do:
I think 102CE040 is the message that gets sent to the instrument panel when the shifter goes into reverse; there's about a 300ms delay between when I move the shift and when that message gets sent, but it seems livable. There's then a 3 second lag after you switch out of reverse before the display goes back to normal. Finally, we're spamming the CAN bus every 300ms or so, which is overkill ... we only need to send a message more often than every 3 seconds. So there's room for improvement, and it needs to be ported to a microcontroller with a real SWCAN transceiver that won't make my dashboard keep flashing random error messages
Code:
#!/usr/bin/perl
open(CAN, "candump -a -t a can2|");
while(<CAN>) {
if (/102CE040\s+.8.\s+1(.)/) {
$state = $1;
print "state = $state\n";
if ($state == 2) {
system "cansend can2 244#07.AE.05.20.20.00.00.00"
}
}
}
close CAN;