mirror of
https://github.com/dalathegreat/Battery-Emulator.git
synced 2025-10-04 18:29:48 +02:00
add lib/ThomasBarth-ESP32-CAN-Driver
This commit is contained in:
parent
2118ab4d75
commit
ead4b805e2
17 changed files with 14 additions and 14 deletions
|
@ -1,8 +1,8 @@
|
||||||
#ifndef ESP32CAN_H
|
#ifndef ESP32CAN_H
|
||||||
#define ESP32CAN_H
|
#define ESP32CAN_H
|
||||||
|
|
||||||
#include "CAN_config.h"
|
#include "src/lib/ThomasBarth-ESP32-CAN-Driver/CAN_config.h"
|
||||||
#include "CAN.h"
|
#include "src/lib/ThomasBarth-ESP32-CAN-Driver/CAN.h"
|
||||||
extern uint8_t LEDcolor;
|
extern uint8_t LEDcolor;
|
||||||
|
|
||||||
class ESP32CAN
|
class ESP32CAN
|
||||||
|
|
|
@ -9,7 +9,7 @@
|
||||||
#include "mbServerFCs.h"
|
#include "mbServerFCs.h"
|
||||||
#include "ModbusServerRTU.h"
|
#include "ModbusServerRTU.h"
|
||||||
#include "ESP32CAN.h"
|
#include "ESP32CAN.h"
|
||||||
#include "CAN_config.h"
|
#include "src/lib/ThomasBarth-ESP32-CAN-Driver/CAN_config.h"
|
||||||
#include "src/lib/adafruit-Adafruit_NeoPixel/Adafruit_NeoPixel.h"
|
#include "src/lib/adafruit-Adafruit_NeoPixel/Adafruit_NeoPixel.h"
|
||||||
#include "src/battery/BATTERIES.h"
|
#include "src/battery/BATTERIES.h"
|
||||||
#include "src/inverter/INVERTERS.h"
|
#include "src/inverter/INVERTERS.h"
|
||||||
|
|
|
@ -1,6 +1,6 @@
|
||||||
#include "BMW-I3-BATTERY.h"
|
#include "BMW-I3-BATTERY.h"
|
||||||
#include "../../ESP32CAN.h"
|
#include "../../ESP32CAN.h"
|
||||||
#include "../../CAN_config.h"
|
#include "../lib/ThomasBarth-ESP32-CAN-Driver/CAN_config.h"
|
||||||
|
|
||||||
//TODO before using
|
//TODO before using
|
||||||
// Map the final values in update_values_i3_battery, set some to static values if not available (current, discharge max , charge max)
|
// Map the final values in update_values_i3_battery, set some to static values if not available (current, discharge max , charge max)
|
||||||
|
|
|
@ -1,6 +1,6 @@
|
||||||
#include "CHADEMO-BATTERY.h"
|
#include "CHADEMO-BATTERY.h"
|
||||||
#include "../../ESP32CAN.h"
|
#include "../../ESP32CAN.h"
|
||||||
#include "../../CAN_config.h"
|
#include "../lib/ThomasBarth-ESP32-CAN-Driver/CAN_config.h"
|
||||||
|
|
||||||
/* Do not change code below unless you are sure what you are doing */
|
/* Do not change code below unless you are sure what you are doing */
|
||||||
static unsigned long previousMillis100 = 0; // will store last time a 100ms CAN Message was send
|
static unsigned long previousMillis100 = 0; // will store last time a 100ms CAN Message was send
|
||||||
|
|
|
@ -1,6 +1,6 @@
|
||||||
#include "IMIEV-CZERO-ION-BATTERY.h"
|
#include "IMIEV-CZERO-ION-BATTERY.h"
|
||||||
#include "../../ESP32CAN.h"
|
#include "../../ESP32CAN.h"
|
||||||
#include "../../CAN_config.h"
|
#include "../lib/ThomasBarth-ESP32-CAN-Driver/CAN_config.h"
|
||||||
|
|
||||||
//Code still work in progress, TODO:
|
//Code still work in progress, TODO:
|
||||||
//Figure out if CAN messages need to be sent to keep the system happy?
|
//Figure out if CAN messages need to be sent to keep the system happy?
|
||||||
|
|
|
@ -1,6 +1,6 @@
|
||||||
#include "KIA-HYUNDAI-64-BATTERY.h"
|
#include "KIA-HYUNDAI-64-BATTERY.h"
|
||||||
#include "../../ESP32CAN.h"
|
#include "../../ESP32CAN.h"
|
||||||
#include "../../CAN_config.h"
|
#include "../lib/ThomasBarth-ESP32-CAN-Driver/CAN_config.h"
|
||||||
|
|
||||||
/* Do not change code below unless you are sure what you are doing */
|
/* Do not change code below unless you are sure what you are doing */
|
||||||
static unsigned long previousMillis10 = 0; // will store last time a 10ms CAN Message was send
|
static unsigned long previousMillis10 = 0; // will store last time a 10ms CAN Message was send
|
||||||
|
|
|
@ -1,6 +1,6 @@
|
||||||
#include "NISSAN-LEAF-BATTERY.h"
|
#include "NISSAN-LEAF-BATTERY.h"
|
||||||
#include "../../ESP32CAN.h"
|
#include "../../ESP32CAN.h"
|
||||||
#include "../../CAN_config.h"
|
#include "../lib/ThomasBarth-ESP32-CAN-Driver/CAN_config.h"
|
||||||
|
|
||||||
/* Do not change code below unless you are sure what you are doing */
|
/* Do not change code below unless you are sure what you are doing */
|
||||||
static unsigned long previousMillis10 = 0; // will store last time a 10ms CAN Message was send
|
static unsigned long previousMillis10 = 0; // will store last time a 10ms CAN Message was send
|
||||||
|
|
|
@ -1,6 +1,6 @@
|
||||||
#include "RENAULT-ZOE-BATTERY.h"
|
#include "RENAULT-ZOE-BATTERY.h"
|
||||||
#include "../../ESP32CAN.h"
|
#include "../../ESP32CAN.h"
|
||||||
#include "../../CAN_config.h"
|
#include "../lib/ThomasBarth-ESP32-CAN-Driver/CAN_config.h"
|
||||||
|
|
||||||
/* Do not change code below unless you are sure what you are doing */
|
/* Do not change code below unless you are sure what you are doing */
|
||||||
#define LB_MAX_SOC 1000 //BMS never goes over this value. We use this info to rescale SOC% sent to Fronius
|
#define LB_MAX_SOC 1000 //BMS never goes over this value. We use this info to rescale SOC% sent to Fronius
|
||||||
|
|
|
@ -1,6 +1,6 @@
|
||||||
#include "TESLA-MODEL-3-BATTERY.h"
|
#include "TESLA-MODEL-3-BATTERY.h"
|
||||||
#include "../../ESP32CAN.h"
|
#include "../../ESP32CAN.h"
|
||||||
#include "../../CAN_config.h"
|
#include "../lib/ThomasBarth-ESP32-CAN-Driver/CAN_config.h"
|
||||||
|
|
||||||
/* Do not change code below unless you are sure what you are doing */
|
/* Do not change code below unless you are sure what you are doing */
|
||||||
/* Credits: Most of the code comes from Per Carlen's bms_comms_tesla_model3.py (https://gitlab.com/pelle8/batt2gen24/) */
|
/* Credits: Most of the code comes from Per Carlen's bms_comms_tesla_model3.py (https://gitlab.com/pelle8/batt2gen24/) */
|
||||||
|
|
|
@ -1,6 +1,6 @@
|
||||||
#include "BYD-CAN.h"
|
#include "BYD-CAN.h"
|
||||||
#include "../../ESP32CAN.h"
|
#include "../../ESP32CAN.h"
|
||||||
#include "../../CAN_config.h"
|
#include "../lib/ThomasBarth-ESP32-CAN-Driver/CAN_config.h"
|
||||||
|
|
||||||
/* Do not change code below unless you are sure what you are doing */
|
/* Do not change code below unless you are sure what you are doing */
|
||||||
static unsigned long previousMillis2s = 0; // will store last time a 2s CAN Message was send
|
static unsigned long previousMillis2s = 0; // will store last time a 2s CAN Message was send
|
||||||
|
|
|
@ -1,6 +1,6 @@
|
||||||
#include "PYLON-CAN.h"
|
#include "PYLON-CAN.h"
|
||||||
#include "../../ESP32CAN.h"
|
#include "../../ESP32CAN.h"
|
||||||
#include "../../CAN_config.h"
|
#include "../lib/ThomasBarth-ESP32-CAN-Driver/CAN_config.h"
|
||||||
|
|
||||||
#define SEND_0 //If defined, the messages will have ID ending with 0 (useful for some inverters)
|
#define SEND_0 //If defined, the messages will have ID ending with 0 (useful for some inverters)
|
||||||
//#define SEND_1 //If defined, the messages will have ID ending with 1 (useful for some inverters)
|
//#define SEND_1 //If defined, the messages will have ID ending with 1 (useful for some inverters)
|
||||||
|
|
|
@ -1,6 +1,6 @@
|
||||||
#include "SMA-CAN.h"
|
#include "SMA-CAN.h"
|
||||||
#include "../../ESP32CAN.h"
|
#include "../../ESP32CAN.h"
|
||||||
#include "../../CAN_config.h"
|
#include "../lib/ThomasBarth-ESP32-CAN-Driver/CAN_config.h"
|
||||||
|
|
||||||
//TODO, change CAN sending routine once confirmed that 500ms interval is OK for this battery type
|
//TODO, change CAN sending routine once confirmed that 500ms interval is OK for this battery type
|
||||||
|
|
||||||
|
|
|
@ -1,6 +1,6 @@
|
||||||
#include "SOFAR-CAN.h"
|
#include "SOFAR-CAN.h"
|
||||||
#include "../../ESP32CAN.h"
|
#include "../../ESP32CAN.h"
|
||||||
#include "../../CAN_config.h"
|
#include "../lib/ThomasBarth-ESP32-CAN-Driver/CAN_config.h"
|
||||||
|
|
||||||
/* This implementation of the SOFAR can protocol is halfway done. What's missing is implementing the inverter replies, all the CAN messages are listed, but the can sending is missing. */
|
/* This implementation of the SOFAR can protocol is halfway done. What's missing is implementing the inverter replies, all the CAN messages are listed, but the can sending is missing. */
|
||||||
|
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue