New supported device (m5stack core1 iot development kit)
This commit is contained in:
65
README.md
65
README.md
@@ -1,17 +1,38 @@
|
||||
# KIA ENIRO DASHBOARD
|
||||
|
||||
OBDII dashboard for TTGO-T4 module (ESP32) + OBD BLE4.0 adapter. Working on Kia e-NIRO (EV) and Hyundai Kona.
|
||||
OBDII dashboard is now supporting 2 different hardware.
|
||||
1. LILYGO TTGO T4 v1.3
|
||||
2. M5STACK CORE1 IOT Development Kit
|
||||
Vgate iCar Pro Bluetooth 4.0 (BLE4) OBD2 adapter is required.
|
||||
|
||||
Working with only with electric vehicles
|
||||
- Kia e-NIRO (EV)
|
||||
- Hyundai Kona EV
|
||||
- Hyundai Ioniq EV
|
||||
|
||||
Use it at your own risk!
|
||||
Author: nick.n17@gmail.com (Lubos Petrovic / Slovakia)
|
||||
|
||||
## Hardware
|
||||
- LILYGO TTGO T4 v1.3
|
||||
~USD $30 https://www.banggood.com/LILYGO-TTGO-T-Watcher-BTC-Ticker-ESP32-For-Bitcoin-Price-Program-4M-SPI-Flash-Psram-LCD-Display-Module-p-1345292.html
|
||||
I RECOMEND TO REMOVE LION BATTERY IF INCLUDED! But be very very carefull. I will make video when I get new TTGO
|
||||
- OBD BLE4.0 adapter.
|
||||
Officialy supported is only this model...
|
||||
Vgate iCar Pro Bluetooth 4.0 (BLE) OBD2 ~USD $30
|
||||
- 3D printed case...
|
||||
## Supporting me
|
||||
|
||||
- Buy Me a Beer via paypal https://www.paypal.me/nickn17
|
||||
- EU companies can support me via IBAN/Invoice (my company is non-VAT payer in Slovakia).
|
||||
Thank you for supporting me. Many thanks to Blas, Jens, Калин, Aleš Dokupil and others for help.
|
||||
|
||||
## Required hardware
|
||||
Board
|
||||
- M5STACK CORE1 IOT Development Kit(~EUR 35)
|
||||
https://rlx.sk/sk/m5stack/7285-esp32-basic-core-iot-development-kit-m5-k001-m5stack.html
|
||||
or
|
||||
- LILYGO TTGO T4 v1.3 (~USD $30) https://www.banggood.com/LILYGO-TTGO-T-Watcher-BTC-Ticker-ESP32-For-Bitcoin-Price-Program-4M-SPI-Flash-Psram-LCD-Display-Module-p-1345292.html
|
||||
I RECOMMEND TO REMOVE LION BATTERY DUE TO HIGH SUMMER TEMPERATURES
|
||||
|
||||
OBD2 adapter
|
||||
- Officialy supported is only this model...
|
||||
Vgate iCar Pro Bluetooth 4.0 (BLE4) OBD2 (~USD $30)
|
||||
|
||||
Others
|
||||
- 3D printed case for TTGO-T4
|
||||
https://www.thingiverse.com/thing:3099913
|
||||
|
||||
## Quick installation with ESP32 flash tool
|
||||
@@ -19,32 +40,30 @@ Author: nick.n17@gmail.com (Lubos Petrovic / Slovakia)
|
||||
Guide is here
|
||||
https://docs.google.com/document/d/1nEezrtXY-8X6mQ1hiZVWDjBVse1sXQg1SlnizaRmJwU/edit?usp=sharing
|
||||
|
||||
## Supporting me
|
||||
|
||||
- Buy Me a Beer via paypal https://www.paypal.me/nickn17
|
||||
- EU companies can support me via IBAN/Invoice (my company is non-VAT payer in Slovakia).
|
||||
|
||||
Thank you for supporting me.
|
||||
|
||||
Many thanks to Blas, Jens, Калин and others for help.
|
||||
|
||||
## Screens and shortcuts
|
||||
- Middle button - menu
|
||||
- Left button - toggle screens
|
||||
|
||||
Screen list
|
||||
- no0. blank screen, lcd off
|
||||
- no1. summary info (default)
|
||||
- no2. speed kmh + kwh/100km (or kw for discharge)
|
||||
- no3. battery cells + battery module temperatures
|
||||
- no4. charging graph
|
||||
- no5. consumption table. Can be used to measure available battery capacity!
|
||||
- no1. auto mode (summary info / speed kmh / charging graph)
|
||||
- no2. summary info (default)
|
||||
- no3. speed kmh + kwh/100km (or kw for discharge)
|
||||
- no4. battery cells + battery module temperatures
|
||||
- no5. charging graph
|
||||
- no6. consumption table. Can be used to measure available battery capacity!
|
||||
- no7. debug screen (default off in the menu)
|
||||
|
||||
|
||||

|
||||
|
||||
[](https://www.youtube.com/watch?v=Jg5VP2P58Yg&)
|
||||
|
||||
## Release notes
|
||||
|
||||
### v1.8.0 2020-11-20
|
||||
- Support for new device m5stack core1 iot development kit
|
||||
- TTGO T4 is still supported device!
|
||||
|
||||
### v1.7.5 2020-11-17
|
||||
- Settings: Debug screen off/on
|
||||
|
||||
13
build.bat
13
build.bat
@@ -1,4 +1,11 @@
|
||||
arduino-cli compile --fqbn esp32:esp32:esp32 --build-properties build.extra_flags=-BOARD_TTGO_T4=1 -v enirodashboard.ino
|
||||
arduino-cli compile
|
||||
REM arduino-cli upload -b esp32:esp32:esp32 -v -p COM6
|
||||
|
||||
rem arduino-cli compile -v -b esp32:esp32:esp32:PSRAM=enabled,PartitionScheme=huge_app,CPUFreq=80 --build-properties build.extra_flags=-BOARD_TTGO_T4=1 -v enirodashboard.ino
|
||||
rem arduino-cli upload -b esp32:esp32:esp32 -v -p COM6
|
||||
|
||||
rem arduino-cli compile -v -b esp32:esp32:m5stack-core-esp32 --build-properties build.extra_flags=-BOARD_M5STACK=1 enirodashboard.ino
|
||||
rem arduino-cli upload -v -b esp32:esp32:m5stack-core-esp32 -p COM9
|
||||
|
||||
rem arduino-cli compile -v -b esp32:esp32:esp32:PSRAM=enabled,PartitionScheme=huge_app,CPUFreq=80 --build-properties build.extra_flags=-BOARD_M5STACK=1 -v enirodashboard.ino
|
||||
arduino-cli upload -b esp32:esp32:esp32 -v -p COM9
|
||||
|
||||
pause
|
||||
29
config.h
29
config.h
@@ -1,13 +1,21 @@
|
||||
#ifdef BOARD_TTGO_T4
|
||||
////////////////////////////////////////////////////////////
|
||||
// SELECT HARDWARE !!!!
|
||||
////////////////////////////////////////////////////////////
|
||||
|
||||
//#define BOARD_TTGO_T4
|
||||
#define BOARD_M5STACK_CORE
|
||||
|
||||
////////////////////////////////////////////////////////////
|
||||
////////////////////////////////////////////////////////////
|
||||
|
||||
#define USER_SETUP_LOADED 1
|
||||
#define SPI_FREQUENCY 27000000
|
||||
#define SPI_READ_FREQUENCY 20000000
|
||||
#define SPI_TOUCH_FREQUENCY 2500000
|
||||
|
||||
/////////////////////////////////////////////////////////////
|
||||
////////////////////////////////////////////////////////////
|
||||
// BOARD LILYGO TTGO T4 v1.3
|
||||
/////////////////////////////////////////////////////////////
|
||||
#ifdef BOARD_TTGO_T4
|
||||
#define ILI9341_DRIVER
|
||||
#define TFT_MISO 12
|
||||
#define TFT_MOSI 23
|
||||
@@ -21,14 +29,14 @@
|
||||
#define BUTTON_LEFT 38
|
||||
#define BUTTON_MIDDLE 37
|
||||
#define BUTTON_RIGHT 39
|
||||
|
||||
#endif // BOARD_TTGO_T4
|
||||
|
||||
|
||||
/////////////////////////////////////////////////////////////
|
||||
// BOARD M5STACK CORE IOT (M5-K001)
|
||||
/////////////////////////////////////////////////////////////
|
||||
/*#define ILI9341_DRIVER
|
||||
#ifdef BOARD_M5STACK_CORE
|
||||
#define USER_SETUP_LOADED 1
|
||||
#define ILI9341_DRIVER
|
||||
#define M5STACK
|
||||
#define TFT_MISO 19
|
||||
#define TFT_MOSI 23
|
||||
@@ -39,10 +47,13 @@
|
||||
#define TFT_BL 32 // LED back-light
|
||||
#define SPI_FREQUENCY 27000000
|
||||
#define SPI_READ_FREQUENCY 5000000
|
||||
#define BUTTON_LEFT 39
|
||||
#define BUTTON_LEFT 37
|
||||
#define BUTTON_MIDDLE 38
|
||||
#define BUTTON_RIGHT 37
|
||||
#define SPEAKER 25*/
|
||||
#define BUTTON_RIGHT 39
|
||||
#define SPEAKER 25
|
||||
#define INVERT_DISPLAY
|
||||
#endif // BOARD_M5STACK_CORE
|
||||
|
||||
/////////////////////////////////////////////////////////////
|
||||
/////////////////////////////////////////////////////////////
|
||||
|
||||
|
||||
BIN
dist/m5stack_core1/enirodashboard.ino.bin
vendored
Normal file
BIN
dist/m5stack_core1/enirodashboard.ino.bin
vendored
Normal file
Binary file not shown.
BIN
dist/m5stack_core1/enirodashboard.ino.partitions.bin
vendored
BIN
dist/m5stack_core1/enirodashboard.ino.partitions.bin
vendored
Binary file not shown.
BIN
dist/ttgo_t4_v13/boot_app0.bin
vendored
Normal file
BIN
dist/ttgo_t4_v13/boot_app0.bin
vendored
Normal file
Binary file not shown.
BIN
dist/ttgo_t4_v13/bootloader_qio_80m.bin
vendored
Normal file
BIN
dist/ttgo_t4_v13/bootloader_qio_80m.bin
vendored
Normal file
Binary file not shown.
@@ -1,6 +1,6 @@
|
||||
/*
|
||||
|
||||
KIA eNiro Dashboard 1.7.3, 2020-11-11
|
||||
KIA eNiro Dashboard 1.8.0, 2020-11-20
|
||||
!! working only with OBD BLE 4.0 adapters
|
||||
!! Supported adapter is Vgate ICar Pro (must be BLE4.0 version)
|
||||
!! Not working with standard BLUETOOTH 3 adapters
|
||||
@@ -27,13 +27,15 @@
|
||||
<= 0°C BMS allows max 40A
|
||||
*/
|
||||
|
||||
#include "config.h"
|
||||
#define APP_VERSION "v1.8.0e"
|
||||
|
||||
#include "SPI.h"
|
||||
#include "TFT_eSPI.h"
|
||||
#include "BLEDevice.h"
|
||||
#include <EEPROM.h>
|
||||
#include <sys/time.h>
|
||||
#include <analogWrite.h>
|
||||
#include "config.h"
|
||||
#include "struct.h"
|
||||
#include "menu.h"
|
||||
#include "car_kia_eniro.h"
|
||||
@@ -89,6 +91,21 @@ String debugTmpChargingLast06 = "";
|
||||
String debugTmpChargingPrevious06 = "";
|
||||
String debugTmpChargingRef06 = "620106FFFFFFFF--00--########################00--28EA00";
|
||||
|
||||
/**
|
||||
Clear screen a display two lines message
|
||||
*/
|
||||
bool displayMessage(const char* row1, const char* row2) {
|
||||
|
||||
tft.fillScreen(TFT_BLACK);
|
||||
tft.setTextDatum(ML_DATUM);
|
||||
tft.setTextColor(TFT_WHITE, TFT_BLACK);
|
||||
tft.setFreeFont(&Roboto_Thin_24);
|
||||
tft.setTextDatum(BL_DATUM);
|
||||
tft.drawString(row1, 0, 240 / 2, GFXFF);
|
||||
tft.drawString(row2, 0, (240 / 2) + 30, GFXFF);
|
||||
return true;
|
||||
}
|
||||
|
||||
/**
|
||||
Load settings from flash memory, upgrade structure if version differs
|
||||
*/
|
||||
@@ -310,21 +327,6 @@ float bar2pressure(float inBar) {
|
||||
return (settings.pressureUnit == 'b') ? inBar : inBar * 14.503773800722;
|
||||
}
|
||||
|
||||
/**
|
||||
Clear screen a display two lines message
|
||||
*/
|
||||
bool displayMessage(const char* row1, const char* row2) {
|
||||
|
||||
tft.fillScreen(TFT_BLACK);
|
||||
tft.setTextDatum(ML_DATUM);
|
||||
tft.setTextColor(TFT_WHITE, TFT_BLACK);
|
||||
tft.setFreeFont(&Roboto_Thin_24);
|
||||
tft.setTextDatum(BL_DATUM);
|
||||
tft.drawString(row1, 0, 240 / 2, GFXFF);
|
||||
tft.drawString(row2, 0, (240 / 2) + 30, GFXFF);
|
||||
return true;
|
||||
}
|
||||
|
||||
/**
|
||||
Draw cell on dashboard
|
||||
*/
|
||||
@@ -661,7 +663,7 @@ bool drawSceneSpeed(bool force) {
|
||||
float capacity = params.batteryTotalAvailableKWh * (params.socPerc / 100);
|
||||
// calibration for Niro/Kona, real available capacity is ~66.5kWh, 0-10% ~6.2kWh, 90-100% ~7.2kWh
|
||||
if (settings.carType == CAR_KIA_ENIRO_2020_64 || settings.carType == CAR_HYUNDAI_KONA_2020_64) {
|
||||
capacity = (params.socPerc*0.615)*(1+(params.socPerc*0.0008));
|
||||
capacity = (params.socPerc * 0.615) * (1 + (params.socPerc * 0.0008));
|
||||
}
|
||||
sprintf(tmpStr3, " %01.01f", capacity);
|
||||
tft.drawString(tmpStr3, 320, 129, GFXFF);
|
||||
@@ -1323,8 +1325,10 @@ bool redrawScreen(bool force) {
|
||||
tft.setTextSize(1);
|
||||
tft.setTextColor(TFT_WHITE, TFT_BLACK);
|
||||
tft.setTextDatum(TL_DATUM);
|
||||
tft.drawString(" BLE4 OBDII not connected... ", 0, 240 / 2, 2);
|
||||
tft.drawString(" Press middle button to menu. ", 0, (240 / 2) + tft.fontHeight(), 2);
|
||||
tft.drawString(" BLE4 OBDII not connected... ", 0, (240 / 2) - tft.fontHeight(), 2);
|
||||
tft.drawString(" Press middle button to menu. ", 0, (240 / 2), 2);
|
||||
tft.drawString(APP_VERSION, 0, (240 / 2) + tft.fontHeight(), 2);
|
||||
|
||||
}
|
||||
|
||||
tft.endWrite();
|
||||
@@ -1723,7 +1727,10 @@ void setup(void) {
|
||||
Serial.println("Init TFT display");
|
||||
tft.begin();
|
||||
|
||||
// tft.invertDisplay(false); // ONLY TTGO-TM
|
||||
#ifdef INVERT_DISPLAY
|
||||
tft.invertDisplay(true);
|
||||
#endif // INVERT_DISPLAY
|
||||
|
||||
tft.setRotation(settings.displayRotation);
|
||||
analogWrite(TFT_BL, (settings.lcdBrightness == 0) ? 100 : settings.lcdBrightness);
|
||||
tft.fillScreen(TFT_BLACK);
|
||||
|
||||
Reference in New Issue
Block a user