I think this would be great starting point for someone to write an example sketch. A simple "man in the middle" firmware that allows you to sniff or capture data being passed between other diagnostic equipment and the OBD-II port on most cars. I have some other great programing and diagnostic tools that could teach us bunch if we can track the commands..
Derek already has code in his sample application that does exactly this - it's the ChannelSwap.h Middleware file.
The code there is simple - if a packet comes in on CAN1, send it back out CAN3, and vice versa. Ignore anything that comes in on CAN2. To use it, simply uncomment the ChannelSwap line in the Middleware definition of the main CBT file.
You don't need to use this literal 'man in the middle' setup to log traffic though - simply splicing one of the CAN inputs onto the car's CAN line will get the data in exactly the same way. The 'man in the middle' code is used when you want to modify the packets travelling the CAN line - in which case you need to cut and connect the CBT immediately prior to the controller that needs to receive the modified packets.
Thanks much. I'll give it a look. Wanted to try a filtered man in the middle approach with some high level ECU tuning hardware/software and MDI I have. If works as I suspect, should be able to capture and verify quite a few dealership level commands in a short time period on a couple models.
Since I haven't seen it posted here yet, has anyone attempted to use the packet analyzer WireShark with the CBT? I messed with it for a few minutes today, but wasn't able to get it to connected. See it listed with other andrino CAN utilities, as I found in this link below. Might be worth a new topic.
<i>This is done using SocketCAN on Linux. The slcand daemon is used to provide a bridge between the CANtact's USB CDC interface and SocketCAN. With this working, you can open up Wireshark and sniff the bus.
Like any packet capture, this can be filtered, saved, and analyzed easily. Wireshark is a great utility for capturing packet data. The candump, cangen, and cansend utilities are also working with the tool.</i>