ElectricMotorcycleForum.com

  • May 05, 2024, 10:57:43 PM
  • Welcome, Guest
Please login or register.

Login with username, password and session length
Advanced search  

News:

Electric Motorcycle Forum is live!

Pages: 1 [2]

Author Topic: Decoding range from the CANBUS using a Raspberry Pi (LONG!)  (Read 6734 times)

togo

  • It's like flying. But with more traction.
  • Hero Member
  • *****
  • Posts: 1638
    • View Profile
Re: Decoding range from the CANBUS using a Raspberry Pi (LONG!)
« Reply #15 on: May 01, 2017, 11:18:22 PM »

... the SAE plug is not on the same circuit as the data signal, which is the same reason you can't use an external power supply. They have to reference the same ground. I was not happy about having to tap into things, but I didn't see any other choice. I took a look at the SAE plug myself with a DMM...

The diginow dongle powers itself from the OBD-II, so clearly there's power on the port.  But not referenced to the same ground, you are saying?


Logged
our knowledge about Zeros collects here: https://zeromanual.com/

Lenny

  • Full Member
  • ***
  • Posts: 120
    • View Profile
Re: Decoding range from the CANBUS using a Raspberry Pi (LONG!)
« Reply #16 on: May 02, 2017, 01:05:41 AM »

The diginow dongle powers itself from the OBD-II, so clearly there's power on the port.  But not referenced to the same ground, you are saying?

There is, but not on a regular pin. A common OBD2-Bluetooth connector like CrashCash is using is expecting 12V on pin 16 for power, Zero uses one of the vendor specific pins for 3.3V. I guess DigiNow is using this one.
Logged
Zero FXS 6.5 MY16

CrashCash

  • Sr. Member
  • ****
  • Posts: 322
  • Denizen of Doom since '88
    • View Profile
Re: Decoding range from the CANBUS using a Raspberry Pi (LONG!)
« Reply #17 on: May 03, 2017, 04:10:57 AM »

The diginow dongle powers itself from the OBD-II, so clearly there's power on the port.  But not referenced to the same ground, you are saying?

There is, but not on a regular pin. A common OBD2-Bluetooth connector like CrashCash is using is expecting 12V on pin 16 for power, Zero uses one of the vendor specific pins for 3.3V. I guess DigiNow is using this one.
Thanks... I wondered that myself!
Logged
'07 FJR-1300 & '15 Zero SR

skyrapper

  • Newbie
  • *
  • Posts: 10
    • View Profile
Re: Decoding range from the CANBUS using a Raspberry Pi (LONG!)
« Reply #18 on: May 11, 2017, 02:36:27 PM »

I tried to read the range information from my 2013 Zero S. With monitoring command ATMA I can see most of the mentioned IDs like 0x080, 0x181 or 0x188. Unfortunately there is no entry with ID 0x440. I think its not there because the 2013 S doesn't show the remaining range on the display.

I then tried to ask the modules connected to the CANBUs for values. For known IDs (e.g. 0x188) the ELM 327 answered with "NO DATA". For the required 0x440 it doesn't answer at all, neither with "?".

I think there should be a message with the remaining capacity. With 2 constant values (min, max) for my average Wh/km I can calculate an estimated range.

Is there anything else I can try?
Logged

CrashCash

  • Sr. Member
  • ****
  • Posts: 322
  • Denizen of Doom since '88
    • View Profile
Re: Decoding range from the CANBUS using a Raspberry Pi (LONG!)
« Reply #19 on: May 14, 2017, 11:02:09 AM »

Yeesh, it sounds like you're kind of out in the cold. I was only able to identify the 0x440 bytes because they matched the graph I made from the video of the range display.

If it doesn't have the display, odds are the firmware doesn't bother to compute it, since it doesn't need it.
Logged
'07 FJR-1300 & '15 Zero SR

remmie

  • Sr. Member
  • ****
  • Posts: 318
    • View Profile
Re: Decoding range from the CANBUS using a Raspberry Pi (LONG!)
« Reply #20 on: March 10, 2019, 10:37:13 PM »

Hi all,

Thanks to this excellent thread by CrashCash (MANY THANKS !!) I found some more values in the various CanId's. I've used them to make a dashboard with all kinds of values and with the general design idea used from the new SR/F Digital dash. The thread also list all the used canId's/values.

http://electricmotorcycleforum.com/boards/index.php?topic=8799.msg75208#msg75208
Logged
Current : Red Premium Zero SR/F (ordered May 25, delivered August 23 2019) with Rapid charger for 12kW charging
Former : White Zero SR 2018 ZF14.4 kWh (17.500 km)
Former : Black Zero SR 2014 ZF11.4 kWh (25.000 km)
SR's outfitted with Homemade "Supercharger" 6x eltek Flatpack S (12 kW)

Amazombi

  • Newbie
  • *
  • Posts: 5
    • View Profile
Re: Decoding range from the CANBUS using a Raspberry Pi (LONG!)
« Reply #21 on: March 26, 2019, 02:07:22 AM »

I considered switching to an Arduino, as an Arduino is a heck of a lot smaller than a Raspberry Pi, and it can live on straight +12VDC.

However, I'd need to code in C, which would suck, and there's confusion about what Bluetooth and CANBUS "shields" are compatible with which flavor of Arduino. Maybe some day when I get bored again.

Well, I hope this is interesting and/or useful to somebody out there. Enjoy.

Hi CrashCash

Great work!!

If you're looking at arduino, consider looking into the Leonardo CANBUS board from hobbytronics. It acts as an arduino and has CAN capability and 12V to 5V converter all on a very small PCB. I used it on my Flatpack S quad charger to set the voltage and current (also via CANbus) and it works perfectly.
I imagine it just would take a Bluetooth module or an LCD or OLED display to be able to show the data in real time.

http://www.hobbytronics.co.uk/leonardo-canbus



Hi. I am from Germany. My question: Works your Arduino-Board with Flatpack2 too ? I use two 3000W and two 2000W with the original SmartPack.
Logged

togo

  • It's like flying. But with more traction.
  • Hero Member
  • *****
  • Posts: 1638
    • View Profile
Re: Decoding range from the CANBUS using a Raspberry Pi (LONG!)
« Reply #22 on: August 27, 2019, 12:11:05 AM »

Hi all,

Thanks to this excellent thread by CrashCash (MANY THANKS !!) I found some more values in the various CanId's. I've used them to make a dashboard with all kinds of values and with the general design idea used from the new SR/F Digital dash. The thread also list all the used canId's/values.

http://electricmotorcycleforum.com/boards/index.php?topic=8799.msg75208#msg75208

Have you been successful in reading the SR/f canbus?  Where did you tap in, the OBD-II?  Does it provide 12V power like automotive do?



Logged
our knowledge about Zeros collects here: https://zeromanual.com/

remmie

  • Sr. Member
  • ****
  • Posts: 318
    • View Profile
Re: Decoding range from the CANBUS using a Raspberry Pi (LONG!)
« Reply #23 on: August 27, 2019, 01:34:19 AM »

Not yet, i’ve only had my SR/F for 3 days now but it is certainly something that will be attempted :)

The obd is easily accesible in the ‘frunk’
Whether there is 12v on there i don’t know but i will check it in a few days
Logged
Current : Red Premium Zero SR/F (ordered May 25, delivered August 23 2019) with Rapid charger for 12kW charging
Former : White Zero SR 2018 ZF14.4 kWh (17.500 km)
Former : Black Zero SR 2014 ZF11.4 kWh (25.000 km)
SR's outfitted with Homemade "Supercharger" 6x eltek Flatpack S (12 kW)

togo

  • It's like flying. But with more traction.
  • Hero Member
  • *****
  • Posts: 1638
    • View Profile
Re: Decoding range from the CANBUS using a Raspberry Pi (LONG!)
« Reply #24 on: August 29, 2019, 03:50:12 AM »

> I considered switching to an Arduino, as an Arduino is a heck of a lot smaller than a Raspberry Pi, and it can live on straight +12VDC.
>
> However, I'd need to code in C, which would suck, and there's confusion about what Bluetooth and CANBUS "shields" are compatible with which flavor of Arduino. Maybe some day when I get bored again.

Indeed, the Raspberry Pi has a lot simpler toolchain, and you can code in real Python.

But it has a filesystem, and a microSD to wear out, etc.

One interesting development is the Raspberry Pi Zero W, very small, inexpensive, with wifi built in.  The Waveshare RS485 CAN Hat is also inexpensive and small, and has the 120 ohm termination resistor.  Haven't tapped the motorcycle bus yet, but it works with the 3.3kw TC chargers.  One idea is to use ESSID to beacon key information, so you can see charge level from a distance just by scanning for wifi, no app required.



Logged
our knowledge about Zeros collects here: https://zeromanual.com/
Pages: 1 [2]