Page 1 of 1

Reading EV Data - how?

Posted: Mon May 01, 2023 1:24 am
by seb
Did anyone manage to read EV data with a 29bit Bus with the ONE+ Model H? There are a lot of questions around this on this forum, but none has a response.

My goal is to get the SOC and other data from my EV (like the various ELM327 apps around in the appstore). I know what CAN message to send on the OBD2-Port, and I know how to interpret the response. I wonder why no function is implemented in the firmware. It looks like it was intentionally blocked - and questions for this date back to 2016. The hardware is really great, and has everything needed to provide the data needed for solar optimized charging. But no way to get it.

A helpful function would be (for example)
obd.send FC007B#03221E3B

And get the response (17 FE 00 7B 05 62 1E 3B 06 87 AA AA)

My last resort is now to solder a CAN-Transceiver on the Dongle and use the GPIOs to control ist. But this sounds terrible, there must be a software solution for this.

The potential for the dongle is huge: every EV owner with PV needs the state of charge, and the dongle would be a perfect way to get it, it only needs to support sending commands to the CAN bus.

Re: Reading EV Data - how?

Posted: Thu Jun 01, 2023 11:47 pm
by PavloPonomarov
You can use FreematicsOBD function

Code: Select all

readPID(byte pid, ind& result)
. It will take PID as argument. Alternatively you can look into the source code (FreematocsOBD.cpp) of this function and tweak it to send your message and wait for the answer.
I have a question to you. Where did you get that CAN-message you have to send to your EV?

Re: Reading EV Data - how?

Posted: Mon Jun 05, 2023 4:26 am
by seb
Hi Paolo,

both ways don't work because you cannot send CAN messages by this.

For example, to get the odometer reading, you send a CAN-Message to (for ID-Series) 0x17fc0076. The vehicle will respond immediately with the odometer reading. But ReadPID cannot do this.

Which is really annoying. Because you need to send a request to all modern EVs to get an answer. There are hundreds of values, including state of health information.

For example, to open a door for my Tesla, I send the Can-Message 800000 to #268. How to I now? Because you can put the Freemcatics dongle into sniff mode, and open the door manually. The command shows in the Freematics log.

The process to get all the nice numbers is pretty straightforward.

1) Connect an Y-Cable to your OBD Port. Put the freematics on one plug, and a cheap $10 Bluetooth ELM Dongle to the second one.
2) Install an app to read vehicle data (the App Store is full with this)
3) Put the Freematics in Sniff mode. You will find all the codes (100+ for your vehicle super easy).

But: You cannot replicate this with the Freematics ONE hardware because there is no way to send an CAN bus command. This is what is missing, and I honestly don't know why.

I spend todays Sunday in my polestar, and I can read all values - from Odometer to SOC, charging Current everything, with any $5 ESP32 that I connect to the Pins 6 and 14 of the OBD-Port via a $2 Transceiver. But The Freematics One Package is not able to do it. You can sniff the CAN-Bus, but you cannot send any messages, which is necessary for the values to show up in the sniffing mode.

It has so mich potential, but is is blocked - and I don't know the reason for this.

Best,
Sebastian


PS: Here is the full list of codes for the MEB Platform: All the nice things we want.
https://github.com/spot2000/Volkswagen- ... 20list.csv

Re: Reading EV Data - how?

Posted: Mon Jun 05, 2023 10:31 pm
by seb
The best way to read Data from modern vehicles (like BMW i3 from 2013 onwards, VW ID Series, Volvo, Polestar, etc..) would be a function like

Code: Select all

frame obd.readPID(request_ecu, request_frame, response_ecu) 
(just dreaming here)

This way, we could retrieve all the information like SoC, Battery Health, Currents, Pack voltages. Any cheap ELM-Dongle can already do this.
The registers to get the data are vehicle dependent, but available on the net.

Charging the UART.cpp does not work, because it would require knowledge of the Freematics software ruuning on the STM32 of the ONE+ H, but this is closed source it seems.

Re: Reading EV Data - how?

Posted: Sat Dec 02, 2023 10:07 pm
by Alessandro71
I'm also interested in reading Polestar data.
Is there any PID/DID list available as for ID.x models?

Re: Reading EV Data - how?

Posted: Thu Mar 21, 2024 3:57 pm
by Billie34
Alessandro71 wrote: Sat Dec 02, 2023 10:07 pm I'm also interested in reading Polestar data.
Is there any PID/DID list available as for ID.x models?
I also want to request geometry dash lite these lists, can anyone share?

Re: Reading EV Data - how?

Posted: Thu Apr 11, 2024 12:09 pm
by stanley
Sending CAN message is always possible. This was not provided as an API due to security concern as the device could be internet connected. The concern now seems irrelevant and thus APIs have been added. Example of sending a CAN message as below.

Code: Select all

  // send a CAN message (clearing DTC)
  obd.setCANID(0x7E0);
  obd.setHeaderMask(0xFFFFFF);
  obd.setHeaderFilter(0x7E8);
  byte msg[] = {0x14, 0xFF, 0x00};
  char buf[128];
  if (obd.sendCANMessage(msg, sizeof(msg), buf, sizeof(buf))) {
    // print the ECU response to the message
    Serial.println(buf);
  }  

Re: Reading EV Data - how?

Posted: Sun Sep 29, 2024 10:36 pm
by seb
Great update. I just found this update today.
It would be nice to finally get the SOC and SOH this way.

For newer EVs like Volvo or th 2021 Polestar this will not work, because setCANID would have to accept 32bit. Typical IDs are 1FFF0010 for example.
I'll give it a try with a Volkswagen next week, they are still on 16bit.