Esp32 Tunerstudio Wifi

It's all about the code!
Post Reply
kon
Posts: 10
Joined: Fri Apr 10, 2020 8:53 pm
Location: LA

Esp32 Tunerstudio Wifi

Post by kon »

I got my ESP32 (wroom 32 dev kit) to act as a wifi-uart bridge, which makes it possible for Tunerstudio to connect to rusEFI over WiFi.

Test setup:
STM32F407 Disco
ESP32 Wroom-32 Dev kit
I'm using general build FW as the MRE specific build won't let me choose Tunerstudio UART connection (I assume it's hardcoded for MRE, but I haven't verified that yet).

Connection diagram:
Screenshot_20201227_114936.png
Screenshot_20201227_114936.png (33.31 KiB) Viewed 6348 times
Make sure the ECU's TunerStudio Port is correctly configured:
Screenshot_20201227_115052.png
Screenshot_20201227_115052.png (43.53 KiB) Viewed 6348 times
ESP32 Firmware can be found here (still a work in progress, but already works as is):
https://github.com/ksmola/Ser2IP32
(you'll need a working esp-idf environment, see https://docs.espressif.com/projects/esp-idf/en/latest/esp32/get-started)

I've used it for many hours and it hasn't disconnected yet, so it seems to be pretty stable. I set the data rate to '100 Reads Per Second' in Tunerstudio.
Did a quick wireshark of the communication, and it looks to be between 30 and 100 Hz.

Next step is combining this with the 'RE firmware updater'.
mck1117
running engine in first post
running engine in first post
Posts: 1493
Joined: Mon Jan 30, 2017 2:05 am
Location: Seattle-ish

Re: Esp32 Tunerstudio Wifi

Post by mck1117 »

Awesome! There's an update rate gauge in TS if you want to watch data rate in real time.
kon
Posts: 10
Joined: Fri Apr 10, 2020 8:53 pm
Location: LA

Re: Esp32 Tunerstudio Wifi

Post by kon »

oh I didn't know, 'Runtime Data Rate' hovers around 15 (I assume Hz). Not great for logging, but plenty for tuning.
Simon@FutureProof
contributor
contributor
Posts: 413
Joined: Tue Jul 24, 2018 8:55 pm
Github Username: Orchardperformance
Slack: Orchardperformance

Re: Esp32 Tunerstudio Wifi

Post by Simon@FutureProof »

Depends if you have the paid version of TS or not, I believe the free version is limited to 15hz logging.
Now keeping MRE in stock in the UK - https://www.FutureProofPerformance.com
mk e
Posts: 486
Joined: Tue Dec 06, 2016 7:32 pm

Re: Esp32 Tunerstudio Wifi

Post by mk e »

OrchardPerformance wrote:
Fri Feb 26, 2021 1:37 pm
Depends if you have the paid version of TS or not, I believe the free version is limited to 15hz logging.
What do you get with the paid version? T

his was always one of the MS specs that just made me shake my head thinking it was awesome!.... for 1985 :lol: certainly way better than nothing and plenty for track monitoring but low for troubleshooting

This just seems like a place rusEFI could do much much better than MS but not if TS is the limit I guess? Just thinking highspeed coms are not all that helpful when the data is low speed for whatever reason?
puff
contributor
contributor
Posts: 2961
Joined: Mon Nov 11, 2013 11:28 am
Location: Moskau

Re: Esp32 Tunerstudio Wifi

Post by puff »

What if using ts just for configuring, while analyzing tracks in logic analyzer? Saleae now have several analog channels, plus here are (if i am not mistaken) opn source variants (sigrek?) - but this would require saving logs in those formats..
mck1117
running engine in first post
running engine in first post
Posts: 1493
Joined: Mon Jan 30, 2017 2:05 am
Location: Seattle-ish

Re: Esp32 Tunerstudio Wifi

Post by mck1117 »

mk e wrote:
Sat Feb 27, 2021 2:29 pm
OrchardPerformance wrote:
Fri Feb 26, 2021 1:37 pm
Depends if you have the paid version of TS or not, I believe the free version is limited to 15hz logging.
What do you get with the paid version? T

his was always one of the MS specs that just made me shake my head thinking it was awesome!.... for 1985 :lol: certainly way better than nothing and plenty for track monitoring but low for troubleshooting

This just seems like a place rusEFI could do much much better than MS but not if TS is the limit I guess? Just thinking highspeed coms are not all that helpful when the data is low speed for whatever reason?
With the paid version of TS, you can log at ~140hz. TS is still the bottleneck there, as we should have enough bandwidth to read over usb at "a few hundred" or so.
mk e
Posts: 486
Joined: Tue Dec 06, 2016 7:32 pm

Re: Esp32 Tunerstudio Wifi

Post by mk e »

mck1117 wrote:
Sat Feb 27, 2021 8:55 pm

With the paid version of TS, you can log at ~140hz. TS is still the bottleneck there, as we should have enough bandwidth to read over usb at "a few hundred" or so.
Thats respectable. Does it change with the number of channels you log or is there a limit to the number of channels?

Just trying to understand how much data you're pushing. My ecu is limited to 1000hz but will do something over 500 channels at that speed over USB (2.0 I think it is) to the PC and the motecs I guess use ethernet and like 2000 channels at 1000hz. Wifi should be in this range capacity wise yes?
mck1117
running engine in first post
running engine in first post
Posts: 1493
Joined: Mon Jan 30, 2017 2:05 am
Location: Seattle-ish

Re: Esp32 Tunerstudio Wifi

Post by mck1117 »

mk e wrote:
Sat Feb 27, 2021 10:19 pm
Thats respectable. Does it change with the number of channels you log or is there a limit to the number of channels?

Just trying to understand how much data you're pushing. My ecu is limited to 1000hz but will do something over 500 channels at that speed over USB (2.0 I think it is) to the PC and the motecs I guess use ethernet and like 2000 channels at 1000hz. Wifi should be in this range capacity wise yes?
That's logging the full gamut of channels we expose to TS. We'll ultimately be limited bu full speed USB - only 12mbit/s. The current blob of output data is something like 350 bytes, so 12mbit-overhead / 350 bites = something like 2500hz. High speed USB gets you 480mbit/s and less protocol overhead (larger packets are allowed = fewer bits of header per bit of data), but our mcu certainly can't sustain 480mbit/s of real data.

Ultimately, you just don't need that much update speed. Coolant and intake temperature? 5hz is probably overkill. You're not going to see anything past 10hz on the oil pressure. Very very few channels need more than that, and there's almost no benefit for any past 100. I could forsee a test mode that can provide very high bandwidth (tens of khz?) on a single analog pin, but you certainly wouldn't need that for normal tuning.
mk e
Posts: 486
Joined: Tue Dec 06, 2016 7:32 pm

Re: Esp32 Tunerstudio Wifi

Post by mk e »

mck1117 wrote:
Sun Feb 28, 2021 3:28 am


Ultimately, you just don't need that much update speed. Coolant and intake temperature? 5hz is probably overkill. You're not going to see anything past 10hz on the oil pressure. Very very few channels need more than that, and there's almost no benefit for any past 100. I could forsee a test mode that can provide very high bandwidth (tens of khz?) on a single analog pin, but you certainly wouldn't need that for normal tuning.
Absolutely. Faster rates are mostly just for trouble shooting not normal engine data logging/monitoring. Suspension and wheel slip info is nice to get pretty fast if the ECU is also the data acquisition system, crank data can be nice but its usually better to have the ecu just set a flag in the normal slow log if something wrong rather than log it fast all the time...unless you know there is an issue you're hunting for. With something like the enginelab you can log anything in the ECU, just "rightclick, add gauge or text box" to the user screen and its logging so any variable which is kind of nice, but again mostly a help in troubleshooting...I display/log maybe a 100-150 or so items to track cylinder data on a 12 cyl but that clearly not normally.
Post Reply