Skip to content
/ EHU32 Public

ESP32-based bluetooth audio integration for Opel/Vauxhall vehicles. Control bluetooth audio source with steering wheel buttons, show coolant temperature and battery voltage on the integrated display and more!

License

Notifications You must be signed in to change notification settings

PNKP237/EHU32

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

20 Commits
 
 
 
 
 
 
 
 

Repository files navigation

EHU32

This Arduino sketch enables ESP32 to communicate over MS-CAN bus in Opel vehicles such as Astra H, Zafira B, Vectra C, Corsa D (and more) in addition to acting as a bluetooth audio receiver.

Features

  • Bluetooth (A2DP) audio sink, data is output to an external I2S DAC, such as PCM5102
  • reads steering wheel button presses, which allows for control of connected audio source (play/pause, previous/next track), basically you can control your phone's music player
  • receives bluetooth metadata from connected audio source and prints it to vehicle's center console display - tested on CID, GID and BID, 1-line and 3-lines are supported - only "Aux" messages are overwritten
  • simulates button presses in Climate Control menu to allow for one-press enabling/disabling of AC compressor
  • long pressing "2" button on the radio panel prints diagnostic data provided by Electronic Climate Control (ECC module - only Astra H/Zafira B/Corsa D/Vectra C facelift) - Engine coolant temp, Speed + RPMs, battery voltage. Long pressing "1" goes back to audio metadata mode
  • in case the vehicle is not equipped with electronic climate control, EHU32 will print data read provided by the display module (only coolant temperature, RPMs and speed)
  • long pressing "3" button prints just the coolant temperature in a single line - useful for 1-line displays such as GID, BID and TID
  • Over-the-air updates, holding "8" enables the wifi hotspot (password ehu32updater). Note that this disables CAN and bluetooth A2DP until restart.
  • more to come, hopefully

How it looks

Demo video:

Click here to watch EHU32 demo on YouTube

IMG_20240217_172706

VID_20240224_174250 mp4_snapshot_00 11 305

Video showing measurement data displayed in real time (warning, contains music!) https://www.youtube.com/watch?v=uxLYr1c_TJA

How it works and general usage tips

While this project aims to make the experience as seamless as possible, there are some shortcomings that have to be addressed:

  • the audio source volume has to be set to maximum in order to avoid unnecessary noise. Adjust the volume as usual, using the radio's volume control knob or steering wheel buttons.
  • sometimes "Aux" will still show up, about once per 20 minutes of driving for like 5 seconds. While unlikely to happen with CD30, it does sometimes happen with CD70 due to the fact that the radio is sometimes sending additional data along with "Aux" text, which when blocked would sometimes result in the radio shutting down.

If you came here looking for inspiration I'd recommend checking out the wiki page. I have documented some basics that might come in handy when developing your own addons for these vehicles.

Building it yourself

Required hardware: ESP32 board with antenna connector and an antenna (of the classic flavor, A2DP doesn't work on ESP32-C3), PCM5102A DAC module, any CAN transceiver module (in my case MCP2551). Required connections:

  • 5V to: ESP32 VIN pin, MCP2551 VCC pin, PCM5102 VIN pin;
  • CAN bus: D4 to CAN_RX, D5 to CAN_TX, CANL and CANH wired up to the vehicle's MS-CAN (accessible by either OBD-II diagnostic port, radio, display, electronic climate control);
  • I2S DAC: GND to SCK, D26 to BCK, D22 to DIN, D25 to LCK, D23 to XSMT;
  • Configure jumpers on the back of the I2S DAC module: short 1-L, 2-L, 4-L, 3 NOT SHORTED.

This repo contains a PDF schematic outlining which connections are required to make this work.

Discrete PCB with everything on board is in the making, once software quirks are resolved and I find some free time to finish the layout.

Note that this should be soldered directly in the radio unit as the OBD-II port only provides unswitched 12V. Powering it from a 5V car charger also works. Do not connect headphones to the DAC module, its output is supposed to only be connected to amplifier input - in case of this project either the AUX socket of radio's internal AUX input.

If you're successful in putting it together and satisfied with operation of EHU32 then I would be extremely grateful if you can share a photo or a short video showing the module in action! Any kind of feedback is valuable to me - be it issues, general usage or recommendations for additional functionality, I'll be happy to hear them.

Compilation notes

TWAI driver written by ESP as part of their ESP-IDF framework isn't perfect. To ensure everything works properly you'll need to modify "sdkconfig" which is located in %USERPROFILE%\AppData\Local\Arduino15\packages\esp32\hardware\esp32\version\tools\sdk\esp32\

Under "TWAI configuration" section enable CONFIG_TWAI_ISR_IN_IRAM and modify CONFIG_TWAI_ERRATA_FIX_TX_INTR_LOST so the errata fix is not applied. The whole section should look like this:

#
# TWAI configuration
#
CONFIG_TWAI_ISR_IN_IRAM=y
CONFIG_TWAI_ERRATA_FIX_BUS_OFF_REC=y
CONFIG_TWAI_ERRATA_FIX_TX_INTR_LOST=n
CONFIG_TWAI_ERRATA_FIX_RX_FRAME_INVALID=y
CONFIG_TWAI_ERRATA_FIX_RX_FIFO_CORRUPT=y
# CONFIG_TWAI_ERRATA_FIX_LISTEN_ONLY_DOM is not set
# end of TWAI configuration

In Arduino IDE set the following: Events on core 0, Arduino on core 1, partition scheme - Minimal SPIFFS.

Credits

Depends on Arduino ESP32-A2DP library by pschatzmann: https://github.com/pschatzmann/ESP32-A2DP

Reverse engineering of the vehicles various messages was done by JJToB: https://github.com/JJToB/Car-CAN-Message-DB

This project comes with absolutely no warranty of any kind, I'm not responsible for your car going up in flames.

About

ESP32-based bluetooth audio integration for Opel/Vauxhall vehicles. Control bluetooth audio source with steering wheel buttons, show coolant temperature and battery voltage on the integrated display and more!

Topics

Resources

License

Stars

Watchers

Forks

Languages