Page 1 of 1
Hardware advice for Ethernet socket
Posted: Thu Mar 28, 2024 4:11 pm
by DrMickeyLauer
We have designed an OBD2 adapter based on the ESP32S3 and the W5500. Ethernet is directly connected to the OBD2 port, since some of the cars speak a TCP protocol for diagnostics.
For a "pro" revision, we'd like to add a RJ45 ethernet socket to the device. I wonder whether we have any option besides adding another W5500 to the design. In principle, we don't need the RJ45 to be another logical ethernet – we would do bridging anyways.
Are there self-contained Ethernet hubs that we could integrate?
Or, if that doesn't work... is there a dual-port Ethernet controller IC with the same level of support in ESP-IDF which we have with the W5500?
Re: Hardware advice for Ethernet socket
Posted: Tue Apr 02, 2024 7:32 am
by ESP_ondrej
Speaking of supported multiple Ethernet port ICs, we support KSZ8863. However, you've already figured it out by yourself as I've seen on Github
Re: Hardware advice for Ethernet socket
Posted: Tue Apr 02, 2024 9:55 am
by DrMickeyLauer
Indeed, thanks, although I overlooked that its main interface is RMII, so that is a showstopper for our design, which relies on an ESP32-S3. Is there similar hardware that only uses SPI?
Re: Hardware advice for Ethernet socket
Posted: Wed Apr 03, 2024 11:50 am
by djixon
Sorry for a thread interupption, but I am also curious, what's stops you making a bridge using wifi module of ESP32S3 chip? For example OBD2 port->Eth port->processing in ESP32S3 (or just transvering raw messages) ->wifi module of esp32S3 -> wirelessly -> PC or Mobile phone or what ever external device (wifi cappable). And opposite route for commands initiated on that external device (phone, tablet, PC ...) all the back to OBD2 port in reverse direction.
Is there some constraint in expected transfer rate or bandwith not achievable over wifi? Security shouldn't be the issue since the S3 is pretty much cappable of doing any kind encryption you can imagine.
Re: Hardware advice for Ethernet socket
Posted: Wed Apr 03, 2024 12:04 pm
by DrMickeyLauer
Twofold issue.
1. It‘s just a matter of reliability. We‘re doing potentially dangerous ECU flash upgrades over a wireless connection, which can be scary. Some customers would prefer a wired connection.
2. We also have BLE active and even though the coexistence works, we‘re not getting impressive data rates with WiFi.
Re: Hardware advice for Ethernet socket
Posted: Wed Apr 03, 2024 12:48 pm
by djixon
Oh, I see.
1. Maybe, "flashing" can be possibly cached on ESP32 (depending on the size of flash block) so no data is actually sent to OBD2 port until whole flashing block is received by ESP32. Once it is received and verified (some checksum mark at the end of block) real flashing can be initiated. That way issues about possible wifi reliability (by the way, the same issue is possible over ethernet cable, it can be somewhere broken but not completelly .... or it can be accidentally damaged during flashing process...) but also issues regardless of transfer medium (wireless or wire) can be avoided using local caching to ESP and some checksum control before real flashing is initiated.
2. If I undertood well, you are saying that data arrived (from the CAN gateway module in the car) to that OBD2 port is at higher rate than wifi of ESP32 can deliver? Do you detect some missed (leaked messages)? Do you experience higher rate over the cable?
Re: Hardware advice for Ethernet socket
Posted: Fri Apr 05, 2024 7:08 am
by ESP_ondrej
@DrMickeyLauer, here's the example of SPI Ethernet switch I found:
https://www.microchip.com/en-us/product/LAN9352
Re: Hardware advice for Ethernet socket
Posted: Fri Apr 05, 2024 7:12 am
by DrMickeyLauer
@ESP_ondrej: Thanks, that looks good – not supported yet by ESP-IDF though. That would be a requirement