dopey
Posts: 23
Joined: Mon Jul 11, 2022 3:23 am

Re: Decyphering iMiEV and iON CAR-CAN message data

kiev wrote: Wed Aug 10, 2022 11:42 am When you did the testing, did you manually turn the fan speed knob or did the iCarSoft Max do the actuation?

So in the first test i found about 333 instances of the 3A4 pid, for example

(1660146840.995169) slcan0 3A4# C1 19 BC D0 92 56 00 00

(1660146858.595504) slcan0 3A4# C1 19 BC D0 95 56 00 00

entire filter here:

Code: Select all

khouse@kennys-MacBook-Pro Jacob CAN % grep -ae 3A4 MaxFan5x.txt 
(1660146828.194439) slcan0 3A4#C118BCD090560000
(1660146828.294479) slcan0 3A4#C118BCD090560000
(1660146828.394171) slcan0 3A4#C118BCD090560000
(1660146828.494271) slcan0 3A4#C118BCD090560000
(1660146828.593940) slcan0 3A4#C118BCD090560000
(1660146828.695410) slcan0 3A4#C118BCD090560000
(1660146828.794878) slcan0 3A4#C118BCD090560000
(1660146828.894533) slcan0 3A4#C118BCD090560000
(1660146828.994660) slcan0 3A4#C118BCD090560000
(1660146829.094645) slcan0 3A4#C118BCD090560000
(1660146829.194182) slcan0 3A4#C118BCD090560000
(1660146829.294015) slcan0 3A4#C118BCD090560000
(1660146829.394133) slcan0 3A4#C118BCD090560000
(1660146829.495115) slcan0 3A4#C118BCD090560000
(1660146829.594839) slcan0 3A4#C118BCD090560000
(1660146829.694474) slcan0 3A4#C118BCD090560000
(1660146829.794407) slcan0 3A4#C118BCD090560000
(1660146829.894273) slcan0 3A4#C118BCD090560000
(1660146829.994554) slcan0 3A4#C118BCD090560000
(1660146830.094204) slcan0 3A4#C118BCD090560000
(1660146830.194891) slcan0 3A4#C118BCD090560000
(1660146830.294725) slcan0 3A4#C118BCD090560000
(1660146830.394883) slcan0 3A4#C118BCD090560000
(1660146830.494620) slcan0 3A4#C118BCD090560000
(1660146830.594724) slcan0 3A4#C118BCD090560000
(1660146830.694243) slcan0 3A4#C118BCD090560000
(1660146830.794226) slcan0 3A4#C118BCD090560000
(1660146830.894424) slcan0 3A4#C118BCD090560000
(1660146830.995061) slcan0 3A4#C118BCD090560000
(1660146831.094647) slcan0 3A4#C118BCD090560000
(1660146831.194541) slcan0 3A4#C118BCD090560000
(1660146831.294371) slcan0 3A4#C118BCD090560000
(1660146831.394285) slcan0 3A4#C118BCD090560000
(1660146831.494414) slcan0 3A4#C118BCD090560000
(1660146831.594019) slcan0 3A4#C118BCD090560000
(1660146831.694879) slcan0 3A4#C119BCD090560000
(1660146831.795058) slcan0 3A4#C119BCD090560000
(1660146831.894898) slcan0 3A4#C119BCD090560000
(1660146831.994482) slcan0 3A4#C119BCD090560000
(1660146832.094597) slcan0 3A4#C119BCD090560000
(1660146832.194499) slcan0 3A4#C119BCD090560000
(1660146832.294367) slcan0 3A4#C119BCD090560000
(1660146832.393988) slcan0 3A4#C119BCD090560000
(1660146832.494841) slcan0 3A4#C119BCD090560000
(1660146832.594727) slcan0 3A4#C119BCD090560000
(1660146832.694591) slcan0 3A4#C119BCD090560000
(1660146832.794650) slcan0 3A4#C119BCD090560000
(1660146832.894350) slcan0 3A4#C119BCD090560000
(1660146832.994237) slcan0 3A4#C119BCD090560000
(1660146833.094083) slcan0 3A4#C119BCD090560000
(1660146833.194918) slcan0 3A4#C119BCD090560000
(1660146833.294801) slcan0 3A4#C119BCD090560000
(1660146833.394634) slcan0 3A4#C119BCD090560000
(1660146833.494549) slcan0 3A4#C119BCD090560000
(1660146833.594404) slcan0 3A4#C119BCD090560000
(1660146833.694324) slcan0 3A4#C119BCD090560000
(1660146833.794185) slcan0 3A4#C119BCD090560000
(1660146833.894029) slcan0 3A4#C119BCD091560000
(1660146833.994899) slcan0 3A4#C119BCD091560000
(1660146834.095043) slcan0 3A4#C118BCD091560000
(1660146834.194629) slcan0 3A4#C118BCD091560000
(1660146834.294703) slcan0 3A4#C118BCD091560000
(1660146834.394800) slcan0 3A4#C118BCD091560000
(1660146834.494297) slcan0 3A4#C118BCD091560000
(1660146834.594171) slcan0 3A4#C118BCD091560000
(1660146834.694979) slcan0 3A4#C118BCD091560000
(1660146834.795251) slcan0 3A4#C118BCD091560000
(1660146834.895071) slcan0 3A4#C118BCD091560000
(1660146834.994590) slcan0 3A4#C118BCD091560000
(1660146835.094435) slcan0 3A4#C118BCD091560000
(1660146835.194328) slcan0 3A4#C118BCD091560000
(1660146835.294199) slcan0 3A4#C118BCD091560000
(1660146835.394086) slcan0 3A4#C118BCD091560000
(1660146835.494947) slcan0 3A4#C118BCD091560000
(1660146835.595131) slcan0 3A4#C118BCD091560000
(1660146835.695252) slcan0 3A4#C118BCD091560000
(1660146835.795562) slcan0 3A4#C118BCD091560000
(1660146835.894736) slcan0 3A4#C118BCD091560000
(1660146835.994324) slcan0 3A4#C118BCD091560000
(1660146836.094371) slcan0 3A4#C118BCD091560000
(1660146836.194042) slcan0 3A4#C118BCD091560000
(1660146836.294913) slcan0 3A4#C118BCD091560000
(1660146836.394775) slcan0 3A4#C118BCD091560000
(1660146836.494662) slcan0 3A4#C118BCD091560000
(1660146836.594707) slcan0 3A4#C118BCD091560000
(1660146836.694612) slcan0 3A4#C118BCD091560000
(1660146836.794544) slcan0 3A4#C118BCD091560000
(1660146836.894148) slcan0 3A4#C118BCD091560000
(1660146836.994998) slcan0 3A4#C118BCD091560000
(1660146837.094909) slcan0 3A4#C118BCD091560000
(1660146837.195117) slcan0 3A4#C118BCD091560000
(1660146837.294610) slcan0 3A4#C118BCD091560000
(1660146837.380841) slcan0 149#F77F00FF388103A4
(1660146837.394440) slcan0 3A4#C118BCD091560000
(1660146837.494643) slcan0 3A4#C118BCD091560000
(1660146837.594263) slcan0 3A4#C118BCD091560000
(1660146837.694375) slcan0 3A4#C119BCD091560000
(1660146837.794957) slcan0 3A4#C119BCD091560000
(1660146837.895257) slcan0 3A4#C119BCD092560000
(1660146837.994694) slcan0 3A4#C119BCD092560000
(1660146838.094853) slcan0 3A4#C119BCD092560000
(1660146838.194434) slcan0 3A4#C119BCD092560000
(1660146838.294343) slcan0 3A4#C119BCD092560000
(1660146838.394645) slcan0 3A4#C119BCD092560000
(1660146838.495420) slcan0 3A4#C119BCD092560000
(1660146838.595617) slcan0 3A4#C119BCD092560000
(1660146838.694785) slcan0 3A4#C119BCD092560000
(1660146838.795049) slcan0 3A4#C119BCD092560000
(1660146838.894714) slcan0 3A4#C119BCD092560000
(1660146838.994612) slcan0 3A4#C119BCD092560000
(1660146839.094292) slcan0 3A4#C119BCD092560000
(1660146839.194401) slcan0 3A4#C119BCD092560000
(1660146839.295015) slcan0 3A4#C119BCD092560000
(1660146839.395426) slcan0 3A4#C119BCD092560000
(1660146839.494752) slcan0 3A4#C119BCD092560000
(1660146839.594630) slcan0 3A4#C119BCD092560000
(1660146839.694485) slcan0 3A4#C119BCD092560000
(1660146839.794603) slcan0 3A4#C119BCD092560000
(1660146839.894485) slcan0 3A4#C119BCD092560000
(1660146839.995087) slcan0 3A4#C119BCD092560000
(1660146840.094979) slcan0 3A4#C119BCD092560000
(1660146840.195541) slcan0 3A4#C119BCD092560000
(1660146840.294706) slcan0 3A4#C119BCD092560000
(1660146840.394560) slcan0 3A4#C119BCD092560000
(1660146840.494409) slcan0 3A4#C119BCD092560000
(1660146840.594615) slcan0 3A4#C119BCD092560000
(1660146840.694442) slcan0 3A4#C119BCD092560000
(1660146840.795275) slcan0 3A4#C119BCD092560000
(1660146840.894919) slcan0 3A4#C119BCD092560000
(1660146840.995169) slcan0 3A4#C119BCD092560000
(1660146841.094654) slcan0 3A4#C118BCD092560000
(1660146841.194538) slcan0 3A4#C118BCD092560000
(1660146841.294573) slcan0 3A4#C118BCD092560000
(1660146841.394223) slcan0 3A4#C118BCD092560000
(1660146841.495147) slcan0 3A4#C118BCD092560000
(1660146841.595006) slcan0 3A4#C118BCD092560000
(1660146841.695354) slcan0 3A4#C118BCD092560000
(1660146841.794765) slcan0 3A4#C118BCD092560000
(1660146841.895020) slcan0 3A4#C118BCD092560000
(1660146841.994496) slcan0 3A4#C118BCD092560000
(1660146842.094408) slcan0 3A4#C118BCD092560000
(1660146842.194278) slcan0 3A4#C118BCD092560000
(1660146842.295108) slcan0 3A4#C118BCD092560000
(1660146842.394976) slcan0 3A4#C118BCD092560000
(1660146842.494903) slcan0 3A4#C118BCD092560000
(1660146842.594715) slcan0 3A4#C118BCD092560000
(1660146842.694569) slcan0 3A4#C118BCD092560000
(1660146842.794727) slcan0 3A4#C118BCD092560000
(1660146842.894557) slcan0 3A4#C118BCD092560000
(1660146842.995739) slcan0 3A4#C118BCD092560000
(1660146843.095055) slcan0 3A4#C118BCD092560000
(1660146843.194919) slcan0 3A4#C118BCD092560000
(1660146843.294797) slcan0 3A4#C118BCD092560000
(1660146843.394662) slcan0 3A4#C118BCD092560000
(1660146843.494534) slcan0 3A4#C118BCD092560000
(1660146843.594445) slcan0 3A4#C118BCD092560000
(1660146843.694314) slcan0 3A4#C118BCD092560000
(1660146843.795598) slcan0 3A4#C118BCD092560000
(1660146843.895567) slcan0 3A4#C119BCD092560000
(1660146843.994907) slcan0 3A4#C119BCD092560000
(1660146844.095080) slcan0 3A4#C119BCD092560000
(1660146844.194852) slcan0 3A4#C119BCD092560000
(1660146844.294709) slcan0 3A4#C119BCD092560000
(1660146844.394621) slcan0 3A4#C119BCD092560000
(1660146844.494285) slcan0 3A4#C119BCD092560000
(1660146844.595627) slcan0 3A4#C119BCD092560000
(1660146844.695502) slcan0 3A4#C119BCD092560000
(1660146844.794902) slcan0 3A4#C119BCD092560000
(1660146844.894727) slcan0 3A4#C119BCD092560000
(1660146844.994607) slcan0 3A4#C119BCD092560000
(1660146845.094664) slcan0 3A4#C119BCD092560000
(1660146845.194720) slcan0 3A4#C119BCD092560000
(1660146845.295521) slcan0 3A4#C119BCD093560000
(1660146845.395071) slcan0 3A4#C119BCD093560000
(1660146845.495151) slcan0 3A4#C119BCD093560000
(1660146845.595052) slcan0 3A4#C119BCD093560000
(1660146845.694673) slcan0 3A4#C119BCD093560000
(1660146845.794555) slcan0 3A4#C119BCD093560000
(1660146845.894753) slcan0 3A4#C119BCD093560000
(1660146845.994563) slcan0 3A4#C119BCD093560000
(1660146846.095615) slcan0 3A4#C119BCD093560000
(1660146846.195407) slcan0 3A4#C119BCD093560000
(1660146846.295019) slcan0 3A4#C119BCD093560000
(1660146846.394795) slcan0 3A4#C119BCD093560000
(1660146846.494662) slcan0 3A4#C119BCD093560000
(1660146846.594519) slcan0 3A4#C119BCD093560000
(1660146846.694384) slcan0 3A4#C118BCD093560000
(1660146846.795239) slcan0 3A4#C118BCD093560000
(1660146846.895466) slcan0 3A4#C118BCD093560000
(1660146846.995014) slcan0 3A4#C118BCD093560000
(1660146847.094885) slcan0 3A4#C118BCD094560000
(1660146847.194727) slcan0 3A4#C118BCD094560000
(1660146847.294826) slcan0 3A4#C118BCD094560000
(1660146847.394691) slcan0 3A4#C118BCD094560000
(1660146847.494711) slcan0 3A4#C118BCD094560000
(1660146847.595198) slcan0 3A4#C118BCD094560000
(1660146847.695105) slcan0 3A4#C118BCD094560000
(1660146847.794978) slcan0 3A4#C118BCD094560000
(1660146847.894914) slcan0 3A4#C118BCD094560000
(1660146847.994735) slcan0 3A4#C118BCD094560000
(1660146848.094556) slcan0 3A4#C118BCD094560000
(1660146848.194428) slcan0 3A4#C118BCD094560000
(1660146848.295595) slcan0 3A4#C118BCD094560000
(1660146848.395548) slcan0 3A4#C118BCD094560000
(1660146848.495066) slcan0 3A4#C118BCD094560000
(1660146848.594901) slcan0 3A4#C118BCD094560000
(1660146848.694785) slcan0 3A4#C118BCD094560000
(1660146848.794841) slcan0 3A4#C118BCD094560000
(1660146848.894486) slcan0 3A4#C118BCD094560000
(1660146848.994408) slcan0 3A4#C118BCD094560000
(1660146849.095289) slcan0 3A4#C118BCD094560000
(1660146849.195621) slcan0 3A4#C118BCD094560000
(1660146849.295038) slcan0 3A4#C118BCD094560000
(1660146849.394909) slcan0 3A4#C118BCD094560000
(1660146849.495284) slcan0 3A4#C118BCD094560000
(1660146849.594943) slcan0 3A4#C118BCD094560000
(1660146849.694537) slcan0 3A4#C118BCD094560000
(1660146849.795383) slcan0 3A4#C118BCD094560000
(1660146849.895253) slcan0 3A4#C119BCD094560000
(1660146849.995130) slcan0 3A4#C119BCD094560000
(1660146850.095508) slcan0 3A4#C119BCD094560000
(1660146850.194908) slcan0 3A4#C119BCD094560000
(1660146850.294791) slcan0 3A4#C119BCD094560000
(1660146850.394860) slcan0 3A4#C119BCD094560000
(1660146850.494514) slcan0 3A4#C119BCD094560000
(1660146850.595334) slcan0 3A4#C119BCD094560000
(1660146850.695200) slcan0 3A4#C119BCD094560000
(1660146850.795089) slcan0 3A4#C119BCD094560000
(1660146850.894955) slcan0 3A4#C119BCD094560000
(1660146850.994859) slcan0 3A4#C119BCD094560000
(1660146851.094696) slcan0 3A4#C119BCD094560000
(1660146851.194587) slcan0 3A4#C119BCD094560000
(1660146851.294465) slcan0 3A4#C119BCD094560000
(1660146851.395297) slcan0 3A4#C119BCD094560000
(1660146851.495164) slcan0 3A4#C119BCD094560000
(1660146851.595015) slcan0 3A4#C119BCD094560000
(1660146851.694913) slcan0 3A4#C119BCD094560000
(1660146851.794770) slcan0 3A4#C119BCD094560000
(1660146851.894874) slcan0 3A4#C119BCD094560000
(1660146851.994557) slcan0 3A4#C119BCD094560000
(1660146852.095389) slcan0 3A4#C119BCD094560000
(1660146852.195254) slcan0 3A4#C119BCD094560000
(1660146852.295495) slcan0 3A4#C119BCD094560000
(1660146852.395015) slcan0 3A4#C119BCD094560000
(1660146852.494932) slcan0 3A4#C119BCD094560000
(1660146852.594724) slcan0 3A4#C119BCD094560000
(1660146852.694618) slcan0 3A4#C119BCD094560000
(1660146852.794468) slcan0 3A4#C119BCD094560000
(1660146852.895328) slcan0 3A4#C118BCD094560000
(1660146852.995228) slcan0 3A4#C118BCD094560000
(1660146853.095096) slcan0 3A4#C118BCD094560000
(1660146853.194952) slcan0 3A4#C118BCD094560000
(1660146853.294903) slcan0 3A4#C118BCD094560000
(1660146853.394708) slcan0 3A4#C118BCD094560000
(1660146853.494673) slcan0 3A4#C118BCD094560000
(1660146853.595948) slcan0 3A4#C118BCD094560000
(1660146853.695310) slcan0 3A4#C118BCD094560000
(1660146853.795192) slcan0 3A4#C118BCD094560000
(1660146853.895060) slcan0 3A4#C118BCD094560000
(1660146853.995172) slcan0 3A4#C118BCD094560000
(1660146854.095002) slcan0 3A4#C118BCD094560000
(1660146854.194950) slcan0 3A4#C118BCD094560000
(1660146854.294548) slcan0 3A4#C118BCD094560000
(1660146854.395607) slcan0 3A4#C118BCD094560000
(1660146854.495475) slcan0 3A4#C118BCD094560000
(1660146854.595488) slcan0 3A4#C118BCD094560000
(1660146854.695030) slcan0 3A4#C118BCD094560000
(1660146854.794896) slcan0 3A4#C118BCD094560000
(1660146854.894747) slcan0 3A4#C118BCD094560000
(1660146854.994789) slcan0 3A4#C118BCD094560000
(1660146855.095846) slcan0 3A4#C118BCD094560000
(1660146855.195368) slcan0 3A4#C118BCD094560000
(1660146855.295244) slcan0 3A4#C119BCD095560000
(1660146855.395725) slcan0 3A4#C119BCD095560000
(1660146855.495219) slcan0 3A4#C119BCD095560000
(1660146855.594906) slcan0 3A4#C119BCD095560000
(1660146855.695242) slcan0 3A4#C119BCD095560000
(1660146855.794948) slcan0 3A4#C119BCD095560000
(1660146855.895848) slcan0 3A4#C119BCD095560000
(1660146855.995350) slcan0 3A4#C119BCD095560000
(1660146856.095209) slcan0 3A4#C119BCD095560000
(1660146856.195096) slcan0 3A4#C119BCD095560000
(1660146856.295156) slcan0 3A4#C119BCD095560000
(1660146856.395333) slcan0 3A4#C119BCD095560000
(1660146856.494663) slcan0 3A4#C119BCD095560000
(1660146856.594778) slcan0 3A4#C119BCD095560000
(1660146856.695723) slcan0 3A4#C119BCD095560000
(1660146856.795713) slcan0 3A4#C119BCD095560000
(1660146856.895168) slcan0 3A4#C119BCD095560000
(1660146856.995062) slcan0 3A4#C119BCD095560000
(1660146857.095248) slcan0 3A4#C119BCD095560000
(1660146857.195210) slcan0 3A4#C119BCD095560000
(1660146857.294929) slcan0 3A4#C119BCD095560000
(1660146857.395519) slcan0 3A4#C119BCD095560000
(1660146857.495697) slcan0 3A4#C119BCD095560000
(1660146857.595634) slcan0 3A4#C119BCD095560000
(1660146857.695780) slcan0 3A4#C119BDD095560000
(1660146857.795528) slcan0 3A4#C119BDD095560000
(1660146857.894941) slcan0 3A4#C119BCD095560000
(1660146857.994967) slcan0 3A4#C119BCD095560000
(1660146858.095000) slcan0 3A4#C119BCD095560000
(1660146858.195816) slcan0 3A4#C119BCD095560000
(1660146858.295382) slcan0 3A4#C119BCD095560000
(1660146858.395519) slcan0 3A4#C119BCD095560000
(1660146858.495554) slcan0 3A4#C119BCD095560000
(1660146858.595504) slcan0 3A4#C119BCD095560000
(1660146858.695220) slcan0 3A4#C119BCD095560000
(1660146858.794711) slcan0 3A4#C119BCD095560000
(1660146858.895899) slcan0 3A4#C118BCD095560000
(1660146858.995765) slcan0 3A4#C118BCD095560000
(1660146859.095552) slcan0 3A4#C118BCD095560000
(1660146859.195163) slcan0 3A4#C118BCD095560000
(1660146859.295087) slcan0 3A4#C118BCD095560000
(1660146859.395268) slcan0 3A4#C118BCD095560000
(1660146859.494825) slcan0 3A4#C118BCD095560000
(1660146859.594853) slcan0 3A4#C118BCD095560000
(1660146859.695530) slcan0 3A4#C118BCD095560000
(1660146859.781815) slcan0 149#F77F00FF388103A4
(1660146859.795948) slcan0 3A4#C118BCD095560000
(1660146859.895602) slcan0 3A4#C118BCD095560000
(1660146859.995373) slcan0 3A4#C118BCD095560000
(1660146860.095027) slcan0 3A4#C118BCD095560000
(1660146860.194925) slcan0 3A4#C118BCD095560000
(1660146860.294777) slcan0 3A4#C118BCD095560000
(1660146860.394871) slcan0 3A4#C118BCD095560000
(1660146860.495870) slcan0 3A4#C118BCD095560000
(1660146860.595393) slcan0 3A4#C118BCD095560000
(1660146860.695274) slcan0 3A4#C118BCD096560000
(1660146860.795689) slcan0 3A4#C118BCD096560000
(1660146860.895584) slcan0 3A4#C118BCD096560000
(1660146860.994930) slcan0 3A4#C118BCD096560000
(1660146861.094755) slcan0 3A4#C118BCD096560000
(1660146861.195624) slcan0 3A4#C118BCD096560000
(1660146861.295518) slcan0 3A4#C118BCD096560000
(1660146861.395383) slcan0 3A4#C118BCD096560000

Which byte/bits would be changing to indicate the fan speed? i can see a bit flip in the second byte D2, and also changes in the low nib of D5[3-0] has changed in these two lines. That is using the convention of this thread where the first byte is D1. i prefer the standard used by dala where the first byte is D0 since i think that is the .DBC standard.

Concerning the "F77F00FF388103A4 and F87F00FF508103A4"
i found that those showed up with PID 149, which is said to be related to the ESC system.

Ah you are right; the F7*/F8* were another pid. My quick sort was for '3A4' in the dataset then chop just the data, sort, unique. So it found those two lines since they have 3A4 in them:) Should of done grep '3A4#' instead. My bad, shouldn't of tried to quickly assess the logs.

I've tried issuing/replaying 3A4 PIDs and never got any response from the unit -- so I don't think it's that simple unfortunately.

Per the github page:

Code: Select all

Transmitted every 100ms. Data bits:

D0: Heating level:
D0 bit 15 = 7 Middle
D0 bit 15 < 7 Cooling
D0 bit 15 > 7 Heating
D0: Recirculation: D0 bit 64
D0: AC On: D0 bit 128
D0: Fan spee MAX: D0 bit 32
D1: Fan speed (%): ((D1 bit 15) * 12.5) + 0.5
D1: Ventillation direction:
D1 >> 4 3
1/2: Face
3/4: Legs + Face
5/6: Legs
7/8: Legs + Windshield
9: Windshield
Perhaps I was optimistic, but I was hoping to see a 'new' pid that was issuing commands which would cause 3A4 to reflect new values.

I'm going to keep focusing on the DBC converter, as a DBC loaded into savvycan should make it easier to parse out real time what is known vs not, etc. If there is any specific sequence or captures other's like to have to triage, happy to do a capture. Will hold off parsing until I get a complete DBC working :)

--------------------

On the DBC creation. I'm having a bit of a problem, as if I am not mistaken DBCs will calculate a value such as :
D0 + offset * scale

Allot of the PID formulas are (D0 + Offset) * scale

I've been experimenting all evening but not found a clean solution. I can't help but think since the offsets tend to repeat themselves (+210), that it must translate to something. Similar to how (Dx*256+Dy) is big endian DxDy.
kiev
Posts: 1898
Joined: Sun May 03, 2015 7:15 am
Location: The Heart o' Dixie
Contact: Website

Re: Decyphering iMiEV and iON CAR-CAN message data

Lots of new or unknown high-priority PIDs were showing in the third raw capture file, 9.8Mb.

We need a way to tag the data stream for significant events, such as sending commands, or getting DTCs, pressing a button or twisting a knob.

One idea would be to press the brake pedal just before the action of interest, then release it when the action is complete or reply received. This will bracket the data to know where/when to look by the toggle of the brake pedal PID, then we can just zoom in on that section.

i don't understand reference to bit position by the decimal value that it represents--why not just refer to them by position in the byte, like 7 to 0, msb to lsb.

i don't know where or when or who came up with that scheme, but it makes no sense or has any value, and is more of a distraction and source of confusion than a benefit. Am i wrong here, is there some hidden benefit for such a cumbersome representation?
kiev = kenny's innovative electric vehicle
dopey
Posts: 23
Joined: Mon Jul 11, 2022 3:23 am

Re: Decyphering iMiEV and iON CAR-CAN message data

kiev wrote: Wed Aug 10, 2022 8:33 pm Lots of new or unknown high-priority PIDs were showing in the third raw capture file, 9.8Mb.

We need a way to tag the data stream for significant events, such as sending commands, or getting DTCs, pressing a button or twisting a knob.

One idea would be to press the brake pedal just before the action of interest, then release it when the action is complete or reply received. This will bracket the data to know where/when to look by the toggle of the brake pedal PID, then we can just zoom in on that section.
I can do such a test this evening! Smart to use something like a brake pedal that is a clear signal. I'll write a couple scripts for doing it as well.

Think I was optimistic this would be an 'obvious' new addition.
kiev wrote: Wed Aug 10, 2022 8:33 pm
i don't understand reference to bit position by the decimal value that it represents--why not just refer to them by position in the byte, like 7 to 0, msb to lsb.
I am so glad I am not the only one that is confused at times by way of articulating things -- just assumed my lack of experience with hex, binary, etc makes it seem strange :)

I generally look at the github page, but also the code from OVMS for our vehicle if in doubt to see how it was programatically calculated in real life-- https://github.com/openvehicles/Open-Ve ... ubishi.cpp .

Unfortunately, unless I am mistaken, a DBC file does not have do any () on the operations. It is always value + offset * scale . Where programatically we often do the value+offset *first* then scale the result of that.

My google-fu skills have not found an answer :) I think today I will try to compare the twiz dbc with it's source code on OVMS. I believe that is a verhicle with allot development on both. Hopefully they do some of the +210 or -62345 offsets in the code, and can compare to the DBC of how it was written in DBC language. I can't help but think there is a mathematic answer for 'when I see (D0 * 256 + D1 - 62345) that is actually ____ in DBC language. Same with +210 for offsets. Guessing some base16 or other obvious once you understand it answer that my simple brain doesn't know :D

kiev wrote: Wed Aug 10, 2022 8:33 pm

i don't know where or when or who came up with that scheme, but it makes no sense or has any value, and is more of a distraction and source of confusion than a benefit. Am i wrong here, is there some hidden benefit for such a cumbersome representation?
If I had to *guess* -- the DBC spec does allow assigning values. Such as 0x101 or 0x012 pids indicate key status in D0 being 0x4 vs 0x0. In the DBC you can write something like; VAL_ 257 Key_Status 0 "Off" 4 "On"; Perhaps that is what this scheme is trying to be similar to? I agree tho, it hurts my brain.. but I also have no idea what I am doing.
kiev
Posts: 1898
Joined: Sun May 03, 2015 7:15 am
Location: The Heart o' Dixie
Contact: Website

Re: Decyphering iMiEV and iON CAR-CAN message data

PID 101 is a great example. It is a high priority (low numbered) PID that gives indication of the Key Switch. It only has 1 data byte, 8 bits long, so x101 D0, where D0 is bbbb-bbbb

But it is not important about what the decimal value of D0, it is just a switch, On or Off, a 1 or zero, a single bit, bit 2. D0 = 0000-0b00

So it is easier to evaluate D0[2] rather than make a calculation of its value converted to decimal. The decimal value has no real meaning in this case, it is just a bit eval/compare in a computer.

Other PIDs are obviously more important in the measurement value that they send, such as sensor data. In that case there would be some conversion of 1 or 2 bytes to some decimal value for engineering evaluation by a human. In these cases the bits are not evaluated but rather the entire word or byte.

The stacked CAN frame such as shown here seems to be a great format for reference. If the .dbc could reflect this sort of organization then i think it would make CAN investigation easier, what do you think...

Image
kiev = kenny's innovative electric vehicle
dopey
Posts: 23
Joined: Mon Jul 11, 2022 3:23 am

Re: Decyphering iMiEV and iON CAR-CAN message data

I don't know how much one can alter the DBC format, since it's the kvaser standard. The positive with having a .DBC is it can be imported by majority of tools one would use working with canbus logs (savvycan, asammdf, kvaser, etc). If there is a spec to generate such a view I'm happy to code it :)

https://docs.fileformat.com/database/dbc/
https://www.csselectronics.com/pages/ca ... base-intro

Mainly trying to get the groups efforts into a standardized format that can be used in applications, and in theory be converted to other standard formats.

I read through other vehicle OVMS implementations + DBC files I could find. I had hoped to see the offsets folks have defined for miev also defined over there, since I had assumed there may be a consistent conversion in terms of bits and bytes offsets -- I didn't.


This evening I ended up just writing a brute force method to try and 'find' the value I calculate with the manual documents from github.

(0xb6 + 210) / 100 = 3.92v for batteries

I wrote a script to try different bitstart, bit lengths, offsets, and scaling. Then saved any results between 3 <-> 4 and manually reviewed. This is likely to leads to incorrect DBC translations, but it's a way for me to find *a* conversion, create a DBC then I can implement into my log viewers and see if the formula holds consistent.

Essentially i'm using the community findings to conclude the number I 'should' be able to calculate, then brute forcing +/- a few bits in terms of starting/length to find this. As well little vs big endian, and sign vs unsigned. Hopefully a match stands out as being fairly 'clean' and will try that in the DBC.

This is the nasty little nested for loops. Trying to find 3.92 for the max cell voltage using the formula (0xb6 + 210) / 100 . So trying every combination and checking for 3.92 in the result.

Code: Select all

testFrame=bytearray.fromhex("B6B47F280D720016")
arbitration_id=0x373
name="Test"
for i in range(6,18):
  start_bit=i
  for i in range(12,30):
    size=i
    if size+start_bit > 63:
      continue
    for i in range(1,500):
      offset=i
      for i in range(1,200):
        scale=i*.01
        #print(start_bit,size)
        frame = canmatrix.Frame(name, arbitration_id=arbitration_id, size=8)
        signal = canmatrix.Signal(name, size = size,  start_bit = start_bit, is_little_endian=False, is_signed=False,offset=offset, factor=scale)
        frame.add_signal(signal)
        cm.add_frame(frame)
        testSignal(testFrame, name)
        
        
        
def testSignal(testFrame, name):
  decoded=frame.decode(testFrame)
  for (signal, value) in decoded.items():
    val_string=value.phys_value
    val=int(value.phys_value)
    if 2 <= val <= 3:
      print("%s | %s | %s | %s | %s | %s | %s" % (val_string, hex(val),val,start_bit,size, offset, scale))



By the end of this I may have a multi threaded machine learning can bus cracking nightmare :P
kiev
Posts: 1898
Joined: Sun May 03, 2015 7:15 am
Location: The Heart o' Dixie
Contact: Website

Re: Decyphering iMiEV and iON CAR-CAN message data

[Edit] 75A and 75B, These were found previously when just turning the Key to Ready, so not related to the scan tool. But still unknowns. Low Priority

Code: Select all

(1660147536.032634) slcan0 75A#03E803E864644848
(1660147536.033605) slcan0 75B#4545454F2F8B8700
(1660147536.133464) slcan0 75A#03E903E864644848
(1660147536.133479) slcan0 75B#4545454F2F8B8700
(1660147536.233376) slcan0 75A#03E903E864644848
(1660147536.233393) slcan0 75B#4545454F2F8B8700
(1660147536.333239) slcan0 75A#03E903E864644848
(1660147536.333261) slcan0 75B#4545454F2F8B8700
(1660147536.433324) slcan0 75A#03E903E864644848
(1660147536.433327) slcan0 75B#4545454F2F8B8700
(1660147536.533003) slcan0 75A#03E903E764644848
(1660147536.533007) slcan0 75B#4545454F2F8B8700
(1660147536.632895) slcan0 75A#03E903E864644848
(1660147536.633849) slcan0 75B#4545454F2F8B8700
(1660147536.733241) slcan0 75A#03E903E864644848
(1660147536.733994) slcan0 75B#4545454F2F8B8700
(1660147536.832617) slcan0 75A#03E903E864644848
(1660147536.833576) slcan0 75B#4545454F2F8B8700
(1660147536.933592) slcan0 75A#03E803E864644848
(1660147536.933625) slcan0 75B#4545454F2F8B8700
Last edited by kiev on Fri Aug 12, 2022 5:58 am, edited 2 times in total.
kiev = kenny's innovative electric vehicle
dopey
Posts: 23
Joined: Mon Jul 11, 2022 3:23 am

Re: Decyphering iMiEV and iON CAR-CAN message data

I'd guess those could be from the diag code reading and replying, but need to dig in.

On your earlier comments about the way of writing the D0 bit 15 and being confusion. I believe this is from the C code used in OVMS now. The C syntax is D[0] & 15 to get bytes 0-3 of D0. 15 being Binary of 1111, to indicate the first 3 bytes (0-3) of D0 Byte. After reading the C code here https://github.com/openvehicles/Open-Ve ... ubishi.cpp for AC pids, it made a bit more sense why it was written how it was on github.

The original 'find' was in this post; viewtopic.php?p=31226 which had a more natural way of wording the findings.



I believe I have the first testable DBC file uploaded;
https://github.com/slackspace-io/imiev- ... /imiev.dbc

Total of 21 pids configured . I had to find my own offset and scale for several, so need to do some testing to ensure the logic works as expected.

I have not started on any multiplex'd PIDs (such as 0x29A), as I need to still undestand how that logic even works :)

Will probably format this differently in the future, but tried to keep track of PIDs I confirmed with quick skimming of data within SaavyCan having the DBC file loaded;
https://github.com/slackspace-io/imiev- ... irmed.pids

For testing, I think live streaming canbus data into SaavyCan with the DBC loaded will be quite useful. Can select a specific pid(0x424) then test that the different statuses work as expected. Or that range reflects what is shown on the dash, etc.

A few of the PIDs I could not manually replicate what the github page claimed -- for example; 0x697 claims D1 is % of charge on Chademo -- a random sampling of my data found 0x65 as D1 which is 101 decimal :) This is something that real life testing will be better to zero on on some of the math trying to use big/small endian, offset, and scale per DBC standard to match real life results.

I will be traveling for the weekend so will be unable to do any in-car testing. I will however work on parsing existing canbus log dumps, applying the DBC, and visualizing the result -- if I have time on my laptop. This should atleast let me find completely out-of-range results from the DBC.

If anyone does test and finds a crazy result, please share the pid/data and if you know what the 'expected' value aught to of been.
stoatwblr
Posts: 50
Joined: Tue Sep 28, 2021 12:17 pm

Re: Decyphering iMiEV and iON CAR-CAN message data

CZeroOwner wrote: Mon May 16, 2022 12:38 am If we can find a temperature that has better agreement with the true outside temperature I will change it in the app.
The sensor for this is easily accessible at the front of the car. It would be simple enough to hit it with a heat gun and/or cooling spray to check calibration and what PIDs change whilst this is happening (My car is a 2012 Pugeot Ion)
CZeroOwner
Gold Member
Posts: 68
Joined: Mon Jan 15, 2018 1:47 am
Location: Denmark

Re: Decyphering iMiEV and iON CAR-CAN message data

stoatwblr wrote: Sun Jan 22, 2023 7:04 am The sensor for this is easily accessible at the front of the car. It would be simple enough to hit it with a heat gun and/or cooling spray to check calibration and what PIDs change whilst this is happening (My car is a 2012 Pugeot Ion)
Thanks for the suggestion. I will try it.
CZeroOwner
Gold Member
Posts: 68
Joined: Mon Jan 15, 2018 1:47 am
Location: Denmark

Re: Decyphering iMiEV and iON CAR-CAN message data

This BMU 100% battery capacity was supplied by anko on https://www.myoutlanderphev.com/forum/v ... =10&t=1796
It is the capacity shown by CaniOn, EvBatMon, HobDrive and now by OBDZero.

The second data, present charge in Ah, is as far as I know new.

These are the commands to the dongle that I use to change the data stream
ATWS
ATE1
ATSP6
ATH1
ATL0
ATS1
ATFCSH761
ATFCSD300000
ATFCSM1
ATSH761
2101

This makes this data available:

762:D1=36 (D4 * 256 + D5) / 10.0 = BMU 100% battery capacity in Ah
762:D1=36 (D6 * 256 + D7) / 10.0 = BMU present charge in Ah

BMU SoC = 100* present charge / battery capacity

This SoC is similar to SoC1 as shown by OBDZero but a bit more precise. It agrees less well with SoC2 which is the most often reported SoC.

These dongle commands return the data stream to normal.
ATFCSM0
ATCAF0
ATCM D00

Return to “Instruments - Radio/USB/Nav - CAN - Climate Controls - Remote”