ESP32-ScanMyTesla icon indicating copy to clipboard operation
ESP32-ScanMyTesla copied to clipboard

Connection between ESP and CAN

Open Genesisfm opened this issue 1 year ago • 20 comments

Hello,

I have the follow 2 modules: Mini Kit Esp32 Module https://nl.aliexpress.com/item/1005007235340350.html?spm=a2g0o.order_list.order_list_main.11.103779d2DyVTS3&gatewayAdapt=glo2nld

Sn65hvd230 Vp230 Can Board https://nl.aliexpress.com/item/1005006438437964.html?spm=a2g0o.order_list.order_list_main.23.103779d2DyVTS3&gatewayAdapt=glo2nld

And my question is how do i have to connect TX and RX from the Sn65hvd230 to the Mini Kit Esp32? I tryed port 16 and 17 but that doesnt work :(

Thank you BR Robert

Genesisfm avatar Jul 27 '24 21:07 Genesisfm

Hey Robert, the modules should be ok. I'm using same in other projects.

But I'm not sure if the sketch still work in general. Can library und ESP IDF had a lot or rewrites. I have to try it by my self...

Adminius avatar Jul 27 '24 21:07 Adminius

Thank you for your fast reaction, to be shure i want to check my pinout: 4000f7bb33b4f3fa619e079742fda1535bab8ba9 I have to connect my Can interfact to I016 and I017?

Genesisfm avatar Jul 28 '24 07:07 Genesisfm

Yes, 16 and 17

Adminius avatar Jul 28 '24 07:07 Adminius

Ok i checked that and it doesn't work, i also removed the termination resistor of 120 ohm without any positive result :(

Genesisfm avatar Jul 28 '24 08:07 Genesisfm

I was wondering if you had managed to test it out yet? Perhaps it is possible to share the old libraries it works with?

Genesisfm avatar Jul 30 '24 20:07 Genesisfm

Hey Robert, I tested it today and it still works. can_common 0.3.0 ESP32_CAN 0.2.3 esp32 Core 2.0.16

I will try to update to the newest versions and try it again. My idea was to get rid of extra libs, because now esp32 core provides very good api (that is also now used in collin80's libs) But it means whole rewrite :/

What exactly is not working?

I tried with this modules and it doesn't work: https://www.aliexpress.com/item/1005006209071522.html But it works fine with this: https://www.aliexpress.com/item/1005006408102971.html

Attached is binary that should work. ESP32-ScanMyTesla.ino.esp32.zip

Adminius avatar Aug 05 '24 21:08 Adminius

Hi, I ordered an other can module i think there is something wrong with it. I was able to make a bluetooth connection but a got a time out on the canbus 😑 Thank you very much.

Genesisfm avatar Aug 06 '24 18:08 Genesisfm

Hi another question, which esp32 module are you using? Thx

Genesisfm avatar Aug 09 '24 05:08 Genesisfm

Hi, I tried another CAN bus module but stil the same problem, what is the issue: When i connect with Scan my tesla i see: Creating bluetooth socket... Connecting to OBD2 adapter ESP-SMT... Initializing adapter ... Connecting to car... Using ST1110 command set Setting filters... --- the text above will erased--- Then nothing...

Genesisfm avatar Aug 16 '24 20:08 Genesisfm

This was working fine with SN65HVD230 + ESP32 DEVKIT V1. Maybe double check that RX/TX or CAN-H/CAN-L are not reversed?

krasanen avatar Sep 02 '24 18:09 krasanen

I'm using the same as pn the picture abow: Wemos D1 Mini ESP32

P.S. I rewrote the whole sketch to use native ESP32 TWAI driver wirhout external libraries and testing it since few days. I hope I can release it this week. Also some optimisations were implemented.

Adminius avatar Sep 02 '24 19:09 Adminius

I currently have several ESP32s, including the ESP32 DEVKIT V1. I still have to test this but I notice that the hardware does not all match (aliexpress...) Ps. i also not have the orginal Wemos D1 mini ESP but the D1 mini clone...

Genesisfm avatar Sep 02 '24 20:09 Genesisfm

all my HW is from Ali and all of it are kind of clones :)

Adminius avatar Sep 02 '24 20:09 Adminius

Hello, Can I change default 16,17 pins in code ? I don't see any definition for it. Should BT in the phone see this device in device list without connecting it to the car? Or only in MyTeslaScan app ? Mine doesn't..

koncio18 avatar Sep 14 '24 12:09 koncio18

Should BT in the phone see this device in device list without connecting it to the car

Yes, if you power ESP32 via USB connection. Got to phones BT settings, look for "ESP-SMT" and connect it. Then go to ScanMyTesla app and choose "ESP-SMT" device in the settings

I've just uploaded new version. Tested with the latest ESP32 Arduino Core 3.0.4, no external libraries are needed.

Pin-definion: https://github.com/Adminius/ESP32-ScanMyTesla/blob/main/ESP32-ScanMyTesla.ino#L13-L14

Adminius avatar Sep 14 '24 14:09 Adminius

@Genesisfm I hope, you know, that you need a special OBD cable, because OBD port in the footwell doesn't provide any usefull information

I'm using this one in my Model Y https://www.aliexpress.com/item/1005006022463035.html

Adminius avatar Sep 14 '24 14:09 Adminius

Hardware Example: image image

Links checked today: Case: https://www.aliexpress.com/item/1468276483.html ESP32: https://www.aliexpress.com/item/32816045916.html Step-Down: https://www.aliexpress.com/item/33049921166.html Protoboard: https://www.aliexpress.com/item/33043148251.html Can Module: https://www.aliexpress.com/item/1005005334841319.html

Adminius avatar Sep 14 '24 15:09 Adminius

Thanks for update. Of course I have all hardware. I just tested new version, but I have some issue with BT, on notebook I see ESP-SMT but on iphone 15 not, any suggestion ? (on old and new version)

koncio18 avatar Sep 14 '24 15:09 koncio18

Argh, iPhone works only with expencive OBDLink.... thanks to Apple :/

Adminius avatar Sep 14 '24 15:09 Adminius

@Genesisfm I hope, you know, that you need a special OBD cable, because OBD port in the footwell doesn't provide any usefull information

I'm using this one in my Model Y https://www.aliexpress.com/item/1005006022463035.html It works right know with your new software release and i'm using another ESP32 module. Thank you for your support!

Genesisfm avatar Sep 15 '24 18:09 Genesisfm

Just wanted to chime in that the code is working fine with ESP-WROOM-32 and Waveshare SN65HVD230 CAN Board with Tx=17 and Rx=16 with Android.

I'd found a nice compact Waveshare RS485-CAN board which has builtin 7-36VDC regulator and was going to use it but it's based on ESP32S3 which is BLE and not Bluetooth. So I'll be pulling out a DC-DC buck converter and boxing it all up. Thanks for the work on this.

dlarue avatar Nov 05 '25 17:11 dlarue

Yeah, BLE support would be cool, but it's not ready on ScanMyTesla side yet...

Adminius avatar Nov 05 '25 17:11 Adminius