Page 1 of 1
CAN-Bus access from ESP32 (One+)
Posted: Sat Oct 01, 2022 3:23 am
by seb
H all,
I want to use the One+ to log the complete CAN-Data from the OBD2 Pins 6/14. About 800 messages/second.
But - the CAN-Transceiver in the ONE+ is connected to the STM32, not the ESP32. Therefore, I cannot use the standard ESP32-CAN-libraries (Twai/Can.h). Is there any library to access the CAN-Bus connected to the STM32 via the UART-Communication from the ESP32?
(I'm running FreeRTOS on the ONE+)
Best,
Sebastian
Re: CAN-Bus access from ESP32 (One+)
Posted: Wed Oct 19, 2022 10:35 pm
by stanley
ESP32 is not automotive level and we found it could cause various issues when accessing a real vehicle's CAN bus.
Re: CAN-Bus access from ESP32 (One+)
Posted: Sat Oct 22, 2022 2:04 am
by seb
Thanks. I was convinced that there must be a deliberate thought behind it.
I just need to send a single message to the CAN-Bus, is there any best practice on how to do this? (Background Info: I need to collect odometer readings for a fleet tracking application; the dongle works fine for Tesla & Polestar 2 with the sniffer library, but for another model I need to send a trigger message to receive the response).
Re: CAN-Bus access from ESP32 (One+)
Posted: Sun Oct 23, 2022 8:40 pm
by stanley
What's the specific message like to be sent?
Re: CAN-Bus access from ESP32 (One+)
Posted: Sun Oct 23, 2022 8:54 pm
by seb
Thanks for the quick reply. Something like this:
268#0010000000000000
That's for example the command to physically close the doors of my Tesla; a very "visual" test. No authentication needed beforehand.
Re: CAN-Bus access from ESP32 (One+)
Posted: Thu Oct 27, 2022 8:05 pm
by seb
Any idea how to accomplish this? It could even be with a sequence of AT-commands, whatever works to send a CAN-Message.
It would also help to set the vehicle into diagnostic code.
I had great success using the One+ to collect the odometer and VIN from my Polestar and the Tesla by just using the sniffer sample, for the Mercedes EQA others I would need to send a message, like
cansend can0 7E0#021A905555555555
on linux.
Re: CAN-Bus access from ESP32 (One+)
Posted: Fri Oct 28, 2022 10:23 am
by stanley
We are looking into this. The Tesla message seems to be ISO11898 and is currently not supported.
Re: CAN-Bus access from ESP32 (One+)
Posted: Sat Oct 29, 2022 4:09 am
by seb
Thanks for looking into this. It will help me a lot in my project. My customer just placed an initial order of another 10 dongles just to try. My prototype "hack" is to solder a TTL converter to the external pins and then back to 6/14 of the OBD2-Port - to send the command via the ESP32 internal can. But it does not feel right. The rest of the hardware / software stack is so nice, and the 16MB H-Version really makes a difference.
Re: CAN-Bus access from ESP32 (One+)
Posted: Fri Nov 04, 2022 9:59 am
by stanley
To send 7E0#021A905555555555
Code: Select all
obd.setHeaderID(0x7E0);
obd.dataMode = 0x1A;
int value = obd.readPID(0x90);
Re: CAN-Bus access from ESP32 (One+)
Posted: Sat Nov 12, 2022 3:58 am
by seb
Awesome! Thank you!