Arduino IDE

https://github.com/dalathegreat/BYD-Battery-Emulator-For-Gen24

How to compile the software 💻

  1. Download the Arduino IDE: https://www.arduino.cc/en/software

  2. When the Arduino IDE has been started; Click "File" in the upper left corner -> Preferences -> Additional Development >Board Manager URL -> Enter the URL in the input box https://raw.githubusercontent.com/espressif/arduino-esp32/gh-pages/package_esp32_index.json

    Screenshot 2023-09-24 at 19.21.07.png

    Screenshot 2023-09-24 at 19.20.36.png

  3. Go to "Boards Manager", and install the ESP32 package by Espressif Systems

    Screenshot 2023-09-24 at 19.19.55.png

  4. The arduino settings should be set to "ESP32 Dev Module" with the following settings;

    Screenshot 2025-02-09 at 15.51.05.png

Flashing LILLYGO did not go well. Lowered baudrate a bit to 115..…

Screenshot 2025-02-09 at 15.50.16.png

<aside> 💡 NOTE: On Mac, the following USB driver may need to be installed:  https://github.com/WCHSoftGroup/ch34xser_macos

</aside>

ESP32 Dev Module settings:

  1. Select which battery type you will use, along with other optional settings. This is done in the USER_SETTINGS.hfile.
  2. Copy the USER_SECRETS.TEMPLATE.h file to USER_SECRETS.h and update connectivity settings inside this file.
  3. Press Verify and Upload to send the sketch to the board. NOTE: In some cases, the LilyGo must be powered through the main power connector instead of USB-C when performing the initial firmware upload. NOTE: On Mac, the following USB driver may need to be installed: https://github.com/WCHSoftGroup/ch34xser_macos

NOTE: If you see garbled messages on the serial console, change the serial console to match the baud rate to the code, currently 115200.


Copy the software folder to the Arduino folder. Open the Software.ino file with Arduino IDE

Did settings in: