Data packets/Messages will be read by the module they are intended for by their message ID and importance. To all, CAN Bus Networks have different speeds in vehicles depending on the priority of the Module communicating, ie Engine computer, Body Control Module etc. I encourage you to find a better way to analyse the data as this can be very stime consuming. It will basically take the fisrt file run which you were dumping data for ~5 Minutes (ignoredatabase.can) and incomming.can as the log file which includes button presses. I cretated a basic application in VB6, you can look for more information about the tool on my Blog Unfortunatly the application is a bit incomplete, eventhough it has the capability to connect directly to the Arduino Via Serial it doesnt work propperly, so please ignore the Serial Connection part. If you have some programming skills you might find a better way to manage this. So theoretically all messages in File2.csv thats also in File1.csv should be ignored/filtered the messages thats left over in File2.scv should be the message button presses. Connect and log to a file called file1.csv and let it run with all windows closed, vehicle's key in on position but not started, and let it run for about 5 minutes, Kill the putty session, then restart the Arduino (The Sketch does not clear the buffer), And this time log all data to file2.csv, once putty starts duming data, quickly press a buton (Only one at a time cus you will not know which message goes to which button), once you pressed a button a few times quickly disconnectputty from the can bus. When connecting with putty you can log all incomming data to file as explained in the screenshot from the previous step. Hit the upload button to upload the sketch.įrom here you need to figure out how to detect the messages, such as turning on lightts, open windows ect ect. Serial.println("Init CAN BUS Shield again") Serial.println("CAN BUS Shield init fail") Serial.println("CAN BUS Shield init ok!") INT32U canId = 0x000 unsigned char len = 0 The CAN-BUS Shield library comes with a working example, it does not include getting the CAN-ID which is quite important to know when analysing the data, So i modified it slightly to include the ID also to seperate all values with a comma so that you can use it as a csv file.Ĭopy and paste the below code into your Arduino Sketch Editor. Tip: You might have to rename the zip as the Arduino IDE does not like unusual characters, so maybe try canbus.zip instead of can-bus.zip In the Arduino Editor Select Sketch -> Import Library -> Add Library and then point it to the Zip file you downloaded, (No need to unzip the contents it can be imported as is. First of all you need the Seeed CAN-BUS Shield’s Library downloadable at GIT-HUB After downloading the CAN-BUS Library you need to import it into your Arduino Libraries folder.
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |