Monday, 22 January 2018

Crash and Burn

Doing stuff like sniffing your CAN bus and trying to get your head around new hardware, new software, new IDE, and new code does generate its casualties.

In the last week since I have started (yes, only a week) I have...

  • Destroyed a genuine Arduino Uno through static charge / voltage spikes which killed the regulator (shorted it) and put 12V on the 5V rail, and killed other devices on the board. Also crashed my connected laptop big-time, but the laptop survived the 12V spike on the 5V USB port.... phew. I had a spare Arduino, and have since ordered 3 more, which arrived on the weekend.
    I now have 4 x Ardunio Unos (all happy clones).
  • Crashed my vehicle's CAN bus by connecting a Ardunio configured for 500kbps to the 125kbps bus. The car's bus shut down. I thought I'd killed the CAN bus shield. I don't have a spare. Maybe even damaged a CAN bus device in the car. But disconnecting the power from the shield brought the car bus back, and analysis of the code revealed the error. Phew. Thank goodness for robust industrial hardened vehicle electronics. Phew.
    Also checked with VIDA afterwards, no error codes logged in the car. Yay.
  • Killed my Arduino compilation. Through my hunt for good example code, I installed many different libraries relating to the CAN bus. Some of these libraries conflicted with each other.
    Learning moment: when you have a successful build that works, take a few moments and document which libraries it is using. You can also avoid conflicts by keeping the .ino files and the library files of the example you are trying all within the same folder, and then the compiler uses those files.
  • Gotten totally fed up with trying to analyse CAN bus data in Excel. You can do it but it is long and tedious. Everyone talks about using CanHacker, and I struggled to find a Arduino sketch that would compile without error for use with CanHacker (closely associated with the last point - multiple libraries produces multiple conflicts).
    But I succeeded! And ended up in the garage at midnight, logging and decoding CAN bus messages...
  • Except then my own sketch no longer compiled. That took another hour or so to hunt down.
At the end of all this I did get somewhere. Where? Watch out for the next blog post....

No comments:

Post a Comment