Re: [NEW MEMBER] [HELP & SUPPORT] Reading data from diagnostic port, using Raspberry Pi and a dedicated CANBUS shield
Allen Pothoof <[email protected]> Fri, 17 Apr 2020 23:32:24 +0000
| Newsgroups | gmane.comp.hardware.bus.can |
|---|---|
| Message-ID | <BN7PR03MB39089CB95BD8DBD516B8D44DCBD90@BN7PR03MB3908.namprd03.prod.outlook.com> |
--_000_BN7PR03MB39089CB95BD8DBD516B8D44DCBD90BN7PR03MB3908namp_ Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: quoted-printable Mark, I'd like to say there'll be someone more knowledgeable along to give you be= tter advice but I think most of us have migrated to LinkedIn and I'm not su= re how many still receive communications from Vector. I'll try to give you= some advice but I'm software-centric so I can't help you a lot with hardwa= re. Can this be done with the hardware you've identified? I think you have a r= easonable start but I'm going to end up asking some questions. Will you hurt the bike recording real-time data? Qualified no: if you are = properly connected and that CAN HAT is properly designed, there should be n= o risk. But I can't judge the hardware and I don't know how you intend to = connect. Can you use a second RASPI for an simulator? I would recommend it because = you have to have at least 2 nodes on the CAN Bus for anything to work. In = other words, you can't test your node on it's own, it needs to be connected= to another CAN device. Now my questions. First, what motorbike? And are you sure it has CAN? If I remember correct= ly, BMW used CAN and, I think, Ducati. There's probably a lot more now but= I'm more into older bikes. Assuming it does have CAN, is there a port you can connect to? And do you = have the pin-out for the connector? In US cars, you'd have an OBD or OBD2 = port (On Board Diagnostics) but I don't know if there is a standard connect= or for (modern) motorcycles. Good and bad points to the ports: they're gen= erally safe to connect to but you'll have to request data. If you have to = tap into the bus, it's riskier but you can probably be a passive monitor an= d just read existing traffic. Possibly biggest question (and one that goes directly to the data set you w= ant to use for simulation): do you know what the HLP (High Level Protocol) = is on this bike? Or the bus speed? On a diagnostic port, it will be standardized (whether you can get sufficie= nt documentation for a reasonable price is a separate question). If you ar= e tapping into the bus, it could be pretty much anything. See, when you sa= y "CAN bus", all you're saying is what a packet looks like (and how the bus= arbitrates and some other timing issues, some of which you will care about= ). But "CAN" doesn't tell you how to interpret the data portion of the pac= ket. There are several standards and quasi-standards but I know companies = that scrupulously abide by a standard and still manage to hide their data. In looking at the data set you have a link to, I don't find any mention of = which HLP is being used or whether there is any attempt to interpret it. I= t does say "automotive" so I'm not sure how relevant it would be. (But if = all you are going to do is write it with one node and read it on the other,= maybe it doesn't matter.) I'm not trying to discourage you because it sounds like a fun project but i= t is more involved that connecting a couple wires and reading a few bytes o= ff a port. Good luck, Al Pothoof ________________________________ From: [email protected] <canlist-owner@vector-informatik.= com> on behalf of Marco Miani <[email protected]> Sent: Friday, April 17, 2020 4:42 PM To: [email protected] <[email protected]> Subject: [CANLIST] [NEW MEMBER] [HELP & SUPPORT] Reading data from diagnost= ic port, using Raspberry Pi and a dedicated CANBUS shield Greetings! My name is Marco, I am new in this group, and I am very happy to= be here. I have recently started using Raspberry Pi and I am amazed by how versatile= it is. One of the things I would like to try achieving, is using a Raspber= ry Pi to read data in real time from diagnostic port of my motorbike and lo= g them on SD card. However, I have not the faintest idea where to start fro= m. I have never worked with CAN and would greatly appreciate your help. The= RSPi has an expansion board which I believe is used to read data from the = port, using signals H and L. This is the board: https://www.amazon.it/gp/product/B07PQJMFVP/ref=3Dppx_yo_dt_b_asin_title_o0= 2_s01?ie=3DUTF8&psc=3D1 My experience and knowledge in this field, is very close to zero so I would= greatly appreciate some guidance and hints to be pointed in the right dire= ction. Some of my questions are: 1. Is this technically possible, with the material I have, achieve my goal? 2. Am I risking to damage or corrupt the ECU of my motorbike if I do real t= ime reading of the data, while riding the bike? 3. I have a second RSPi and I would like to use that as "emulator" to produ= ce and spit out data downloaded from the internet (https://zenodo.org/recor= d/3267184#.XpoiDcgzZPY). By so doing, I could build up some experience. Pos= sible? Advisable? Tell me if you need more info about the hardware. I thank you for your possible comments, input, suggestions. Kind regards, Marco [https://ipmcdn.avast.com/images/icons/icon-envelope-tick-green-avg-v1.png]= <http://www.avg.com/email-signature?utm_medium=3Demail&utm_source=3Dlink&ut= m_campaign=3Dsig-email&utm_content=3Dwebmail> Virus-free. www.avg.com<h= ttp://www.avg.com/email-signature?utm_medium=3Demail&utm_source=3Dlink&utm_= campaign=3Dsig-email&utm_content=3Dwebmail> --_000_BN7PR03MB39089CB95BD8DBD516B8D44DCBD90BN7PR03MB3908namp_ Content-Type: text/html; charset="iso-8859-1" Content-Transfer-Encoding: quoted-printable <html> <head> <meta http-equiv=3D"Content-Type" content=3D"text/html; charset=3Diso-8859-= 1"> <style type=3D"text/css" style=3D"display:none;"> P {margin-top:0;margin-bo= ttom:0;} </style> </head> <body dir=3D"ltr"> <div style=3D"font-family: Calibri, Helvetica, sans-serif; font-size: 12pt;= color: rgb(0, 0, 0);"> Mark,</div> <div style=3D"font-family: Calibri, Helvetica, sans-serif; font-size: 12pt;= color: rgb(0, 0, 0);"> <br> </div> <div style=3D"font-family: Calibri, Helvetica, sans-serif; font-size: 12pt;= color: rgb(0, 0, 0);"> I'd like to say there'll be someone more knowledgeable along to give you be= tter advice but I think most of us have migrated to LinkedIn and I'm not su= re how many still receive communications from Vector. I'll try to giv= e you some advice but I'm software-centric so I can't help you a lot with hardware.</div> <div style=3D"font-family: Calibri, Helvetica, sans-serif; font-size: 12pt;= color: rgb(0, 0, 0);"> <br> </div> <div style=3D"font-family: Calibri, Helvetica, sans-serif; font-size: 12pt;= color: rgb(0, 0, 0);"> Can this be done with the hardware you've identified? I think you hav= e a reasonable start but I'm going to end up asking some questions.</div> <div style=3D"font-family: Calibri, Helvetica, sans-serif; font-size: 12pt;= color: rgb(0, 0, 0);"> <br> </div> <div style=3D"font-family: Calibri, Helvetica, sans-serif; font-size: 12pt;= color: rgb(0, 0, 0);"> Will you hurt the bike recording real-time data? Qualified no: if you= are properly connected and that CAN HAT is properly designed, there should= be no risk. But I can't judge the hardware and I don't know how you = intend to connect.</div> <div style=3D"font-family: Calibri, Helvetica, sans-serif; font-size: 12pt;= color: rgb(0, 0, 0);"> <br> </div> <div style=3D"font-family: Calibri, Helvetica, sans-serif; font-size: 12pt;= color: rgb(0, 0, 0);"> Can you use a second RASPI for an simulator? I would recommend it bec= ause you have to have at least 2 nodes on the CAN Bus for anything to work.= In other words, you can't test your node on it's own, it needs to be= connected to another CAN device.<br> </div> <div style=3D"font-family: Calibri, Helvetica, sans-serif; font-size: 12pt;= color: rgb(0, 0, 0);"> <br> </div> <div style=3D"font-family: Calibri, Helvetica, sans-serif; font-size: 12pt;= color: rgb(0, 0, 0);"> Now my questions.</div> <div style=3D"font-family: Calibri, Helvetica, sans-serif; font-size: 12pt;= color: rgb(0, 0, 0);"> <br> </div> <div style=3D"font-family: Calibri, Helvetica, sans-serif; font-size: 12pt;= color: rgb(0, 0, 0);"> First, what motorbike? And are you sure it has CAN? If I rememb= er correctly, BMW used CAN and, I think, Ducati. There's probably a l= ot more now but I'm more into older bikes.</div> <div style=3D"font-family: Calibri, Helvetica, sans-serif; font-size: 12pt;= color: rgb(0, 0, 0);"> <br> </div> <div style=3D"font-family: Calibri, Helvetica, sans-serif; font-size: 12pt;= color: rgb(0, 0, 0);"> Assuming it does have CAN, is there a port you can connect to? And do= you have the pin-out for the connector? In US cars, you'd have an OB= D or OBD2 port (On Board Diagnostics) but I don't know if there is a standa= rd connector for (modern) motorcycles. Good and bad points to the ports: they're generally safe to connect to but you'= ll have to request data. If you have to tap into the bus, it's riskie= r but you can probably be a passive monitor and just read existing traffic.= </div> <div style=3D"font-family: Calibri, Helvetica, sans-serif; font-size: 12pt;= color: rgb(0, 0, 0);"> <br> </div> <div style=3D"font-family: Calibri, Helvetica, sans-serif; font-size: 12pt;= color: rgb(0, 0, 0);"> Possibly biggest question (and one that goes directly to the data set you w= ant to use for simulation): do you know what the HLP (High Level Protocol) = is on this bike? Or the bus speed?</div> <div style=3D"font-family: Calibri, Helvetica, sans-serif; font-size: 12pt;= color: rgb(0, 0, 0);"> <br> </div> <div style=3D"font-family: Calibri, Helvetica, sans-serif; font-size: 12pt;= color: rgb(0, 0, 0);"> On a diagnostic port, it will be standardized (whether you can get sufficie= nt documentation for a reasonable price is a separate question). If y= ou are tapping into the bus, it could be pretty much anything. See, w= hen you say "CAN bus", all you're saying is what a packet looks like (and how the bus arbitrates and some other timing= issues, some of which you will care about). But "CAN" does= n't tell you how to interpret the data portion of the packet. There a= re several standards and quasi-standards but I know companies that scrupulously abide by a standard and still manage to hide t= heir data.</div> <div style=3D"font-family: Calibri, Helvetica, sans-serif; font-size: 12pt;= color: rgb(0, 0, 0);"> <br> </div> <div style=3D"font-family: Calibri, Helvetica, sans-serif; font-size: 12pt;= color: rgb(0, 0, 0);"> In looking at the data set you have a link to, I don't find any mention of = which HLP is being used or whether there is any attempt to interpret it.&nb= sp; It does say "automotive" so I'm not sure how relevant it woul= d be. (But if all you are going to do is write it with one node and read it on the other, maybe it doesn't matter.)<br> </div> <div style=3D"font-family: Calibri, Helvetica, sans-serif; font-size: 12pt;= color: rgb(0, 0, 0);"> <br> </div> <div style=3D"font-family: Calibri, Helvetica, sans-serif; font-size: 12pt;= color: rgb(0, 0, 0);"> I'm not trying to discourage you because it sounds like a fun project but i= t is more involved that connecting a couple wires and reading a few bytes o= ff a port.</div> <div style=3D"font-family: Calibri, Helvetica, sans-serif; font-size: 12pt;= color: rgb(0, 0, 0);"> <br> </div> <div style=3D"font-family: Calibri, Helvetica, sans-serif; font-size: 12pt;= color: rgb(0, 0, 0);"> Good luck,</div> <div style=3D"font-family: Calibri, Helvetica, sans-serif; font-size: 12pt;= color: rgb(0, 0, 0);"> Al Pothoof<br> </div> <div> <div id=3D"appendonsend"></div> <div style=3D"font-family:Calibri,Helvetica,sans-serif; font-size:12pt; col= or:rgb(0,0,0)"> <br> </div> <hr tabindex=3D"-1" style=3D"display:inline-block; width:98%"> <div id=3D"divRplyFwdMsg" dir=3D"ltr"><font style=3D"font-size:11pt" face= =3D"Calibri, sans-serif" color=3D"#000000"><b>From:</b> canlist-owner@vecto= r-informatik.com <[email protected]> on behalf of M= arco Miani <[email protected]><br> <b>Sent:</b> Friday, April 17, 2020 4:42 PM<br> <b>To:</b> [email protected] <[email protected]>= ;<br> <b>Subject:</b> [CANLIST] [NEW MEMBER] [HELP & SUPPORT] Reading data fr= om diagnostic port, using Raspberry Pi and a dedicated CANBUS shield</font> <div> </div> </div> <div> <div dir=3D"ltr"> <div class=3D"x_gmail_default" style=3D"font-family:tahoma,sans-serif; font= -size:small"> Greetings! My name is Marco, I am new in this group, and I am very happy to= be here. <br> <br> I have recently started using Raspberry Pi and I am amazed by how versatile= it is. One of the things I would like to try achieving, is using a Ra= spberry Pi to read data in real time from diagnostic port of my motorbike a= nd log them on SD card. However, I have not the faintest idea where to start from. I have never worked with CAN an= d would greatly appreciate your help. The RSPi has an expansion board which= I believe is used to read data from the port, using signals H and L. This = is the board: <br> <a href=3D"https://www.amazon.it/gp/product/B07PQJMFVP/ref=3Dppx_yo_dt_b_as= in_title_o02_s01?ie=3DUTF8&psc=3D1">https://www.amazon.it/gp/product/B0= 7PQJMFVP/ref=3Dppx_yo_dt_b_asin_title_o02_s01?ie=3DUTF8&psc=3D1</a>&nbs= p; <br> <br> My experience and knowledge in this field, is very close to zero so I would= greatly appreciate some guidance and hints to be pointed in the right dire= ction. Some of my questions are:<br> 1. Is this technically possible, with the material I have, achieve my goal?= <br> 2. Am I risking to damage or corrupt the ECU of my motorbike if I do real t= ime reading of the data, while riding the bike? </div> <div class=3D"x_gmail_default" style=3D"font-family:tahoma,sans-serif; font= -size:small"> 3. I have a second RSPi and I would like to use that as "emulator"= ; to produce and spit out data downloaded from the internet (<a href=3D"htt= ps://zenodo.org/record/3267184#.XpoiDcgzZPY" style=3D"font-family:Arial,Hel= vetica,sans-serif">https://zenodo.org/record/3267184#.XpoiDcgzZPY</a>). By so doing, I could build up some experience. Possible? Advisable? <= br> <br> Tell me if you need more info about the hardware. <br> I thank you for your possible comments, input, suggestions. </div> <div class=3D"x_gmail_default" style=3D"font-family:tahoma,sans-serif; font= -size:small"> Kind regards, <br> Marco </div> </div> </div> </div> <div id=3D"DAB4FAD8-2DD7-40BB-A1B8-4E2AA1F9FDF2"><br> <table style=3D"border-top: 1px solid #D3D4DE;"> <tbody> <tr> <td style=3D"width: 55px; padding-top: 13px;"><a href=3D"http://www.avg.com= /email-signature?utm_medium=3Demail&utm_source=3Dlink&utm_campaign= =3Dsig-email&utm_content=3Dwebmail" target=3D"_blank"><img alt=3D"" wid= th=3D"46" height=3D"29" style=3D"width: 46px; height: 29px;" src=3D"https:/= /ipmcdn.avast.com/images/icons/icon-envelope-tick-green-avg-v1.png"></a></t= d> <td style=3D"width: 470px; padding-top: 12px; color: #41424e; font-size: 13= px; font-family: Arial, Helvetica, sans-serif; line-height: 18px;"> Virus-free. <a href=3D"http://www.avg.com/email-signature?utm_medium=3Demai= l&utm_source=3Dlink&utm_campaign=3Dsig-email&utm_content=3Dwebm= ail" target=3D"_blank" style=3D"color: #4453ea;"> www.avg.com</a> </td> </tr> </tbody> </table> <a href=3D"#DAB4FAD8-2DD7-40BB-A1B8-4E2AA1F9FDF2" width=3D"1" height=3D"1">= </a></div> </body> </html> --_000_BN7PR03MB39089CB95BD8DBD516B8D44DCBD90BN7PR03MB3908namp_-- -- Archives and useful links: http://groups.yahoo.com/group/CANbus Subscribe and unsubscribe at www.vector.com/canlist/ Report any problems to <[email protected]>