mirror of
https://github.com/dalathegreat/Battery-Emulator.git
synced 2025-10-06 03:50:13 +02:00
Merge pull request #80 from lenvm/feature/naming-consistency
Update file naming and macro naming for consistency, add missing notifications for PYLON_CAN and CHADEMO_BATTERY
This commit is contained in:
commit
3e5f72f6f9
8 changed files with 140 additions and 131 deletions
|
@ -32,13 +32,13 @@ unsigned long previousMillis10ms = 50;
|
||||||
unsigned long previousMillisInverter = 0;
|
unsigned long previousMillisInverter = 0;
|
||||||
|
|
||||||
//ModbusRTU parameters
|
//ModbusRTU parameters
|
||||||
#if defined(MODBUS_BYD)
|
#if defined(BYD_MODBUS)
|
||||||
#define MB_RTU_NUM_VALUES 30000
|
#define MB_RTU_NUM_VALUES 30000
|
||||||
#endif
|
#endif
|
||||||
#if defined(MODBUS_LUNA2000)
|
#if defined(LUNA2000_MODBUS)
|
||||||
#define MB_RTU_NUM_VALUES 50000
|
#define MB_RTU_NUM_VALUES 50000
|
||||||
#endif
|
#endif
|
||||||
#if defined(MODBUS_BYD) || defined(MODBUS_LUNA2000)
|
#if defined(BYD_MODBUS) || defined(LUNA2000_MODBUS)
|
||||||
uint16_t mbPV[MB_RTU_NUM_VALUES]; // process variable memory
|
uint16_t mbPV[MB_RTU_NUM_VALUES]; // process variable memory
|
||||||
// Create a ModbusRTU server instance listening on Serial2 with 2000ms timeout
|
// Create a ModbusRTU server instance listening on Serial2 with 2000ms timeout
|
||||||
ModbusServerRTU MBserver(Serial2, 2000);
|
ModbusServerRTU MBserver(Serial2, 2000);
|
||||||
|
@ -179,11 +179,11 @@ void setup()
|
||||||
pinMode(PIN_5V_EN, OUTPUT);
|
pinMode(PIN_5V_EN, OUTPUT);
|
||||||
digitalWrite(PIN_5V_EN, HIGH);
|
digitalWrite(PIN_5V_EN, HIGH);
|
||||||
|
|
||||||
#ifdef MODBUS_BYD
|
#ifdef BYD_MODBUS
|
||||||
// Init Static data to the RTU Modbus
|
// Init Static data to the RTU Modbus
|
||||||
handle_static_data_modbus_byd();
|
handle_static_data_modbus_byd();
|
||||||
#endif
|
#endif
|
||||||
#if defined(MODBUS_BYD) || defined(MODBUS_LUNA2000)
|
#if defined(BYD_MODBUS) || defined(LUNA2000_MODBUS)
|
||||||
// Init Serial2 connected to the RTU Modbus
|
// Init Serial2 connected to the RTU Modbus
|
||||||
RTUutils::prepareHardwareSerial(Serial2);
|
RTUutils::prepareHardwareSerial(Serial2);
|
||||||
Serial2.begin(9600, SERIAL_8N1, RS485_RX_PIN, RS485_TX_PIN);
|
Serial2.begin(9600, SERIAL_8N1, RS485_RX_PIN, RS485_TX_PIN);
|
||||||
|
@ -200,19 +200,17 @@ void setup()
|
||||||
pixels.begin();
|
pixels.begin();
|
||||||
|
|
||||||
//Inform user what Inverter is used
|
//Inform user what Inverter is used
|
||||||
#ifdef SOLAX_CAN
|
#ifdef BYD_CAN
|
||||||
inverterAllowsContactorClosing = 0; //The inverter needs to allow first on this protocol
|
Serial.println("BYD CAN protocol selected");
|
||||||
intervalInverterTask = 800; //This protocol also requires the values to be updated faster
|
|
||||||
Serial.println("SOLAX CAN protocol selected");
|
|
||||||
#endif
|
#endif
|
||||||
#ifdef MODBUS_BYD
|
#ifdef BYD_MODBUS
|
||||||
Serial.println("BYD Modbus RTU protocol selected");
|
Serial.println("BYD Modbus RTU protocol selected");
|
||||||
#endif
|
#endif
|
||||||
#ifdef MODBUS_LUNA2000
|
#ifdef LUNA2000_MODBUS
|
||||||
Serial.println("Luna2000 Modbus RTU protocol selected");
|
Serial.println("Luna2000 Modbus RTU protocol selected");
|
||||||
#endif
|
#endif
|
||||||
#ifdef CAN_BYD
|
#ifdef PYLON_CAN
|
||||||
Serial.println("BYD CAN protocol selected");
|
Serial.println("PYLON CAN protocol selected")
|
||||||
#endif
|
#endif
|
||||||
#ifdef SMA_CAN
|
#ifdef SMA_CAN
|
||||||
Serial.println("SMA CAN protocol selected");
|
Serial.println("SMA CAN protocol selected");
|
||||||
|
@ -220,25 +218,33 @@ void setup()
|
||||||
#ifdef SOFAR_CAN
|
#ifdef SOFAR_CAN
|
||||||
Serial.println("SOFAR CAN protocol selected");
|
Serial.println("SOFAR CAN protocol selected");
|
||||||
#endif
|
#endif
|
||||||
//Inform user what battery is used
|
#ifdef SOLAX_CAN
|
||||||
#ifdef BATTERY_TYPE_LEAF
|
inverterAllowsContactorClosing = 0; //The inverter needs to allow first on this protocol
|
||||||
Serial.println("Nissan LEAF battery selected");
|
intervalInverterTask = 800; //This protocol also requires the values to be updated faster
|
||||||
#endif
|
Serial.println("SOLAX CAN protocol selected");
|
||||||
#ifdef TESLA_MODEL_3_BATTERY
|
|
||||||
Serial.println("Tesla Model 3 battery selected");
|
|
||||||
#endif
|
|
||||||
#ifdef RENAULT_ZOE_BATTERY
|
|
||||||
Serial.println("Renault Zoe / Kangoo battery selected");
|
|
||||||
#endif
|
#endif
|
||||||
|
//Inform user what battery is used
|
||||||
#ifdef BMW_I3_BATTERY
|
#ifdef BMW_I3_BATTERY
|
||||||
Serial.println("BMW i3 battery selected");
|
Serial.println("BMW i3 battery selected");
|
||||||
#endif
|
#endif
|
||||||
#ifdef IMIEV_ION_CZERO_BATTERY
|
#ifdef CHADEMO_BATTERY
|
||||||
|
Serial.println("Chademo battery selected");
|
||||||
|
#endif
|
||||||
|
#ifdef IMIEV_CZERO_ION_BATTERY
|
||||||
Serial.println("Mitsubishi i-MiEV / Citroen C-Zero / Peugeot Ion battery selected");
|
Serial.println("Mitsubishi i-MiEV / Citroen C-Zero / Peugeot Ion battery selected");
|
||||||
#endif
|
#endif
|
||||||
#ifdef KIA_HYUNDAI_64_BATTERY
|
#ifdef KIA_HYUNDAI_64_BATTERY
|
||||||
Serial.println("Kia Niro / Hyundai Kona 64kWh battery selected");
|
Serial.println("Kia Niro / Hyundai Kona 64kWh battery selected");
|
||||||
#endif
|
#endif
|
||||||
|
#ifdef NISSAN_LEAF_BATTERY
|
||||||
|
Serial.println("Nissan LEAF battery selected");
|
||||||
|
#endif
|
||||||
|
#ifdef RENAULT_ZOE_BATTERY
|
||||||
|
Serial.println("Renault Zoe / Kangoo battery selected");
|
||||||
|
#endif
|
||||||
|
#ifdef TESLA_MODEL_3_BATTERY
|
||||||
|
Serial.println("Tesla Model 3 battery selected");
|
||||||
|
#endif
|
||||||
}
|
}
|
||||||
|
|
||||||
// perform main program functions
|
// perform main program functions
|
||||||
|
@ -275,51 +281,53 @@ void handle_can()
|
||||||
if (rx_frame.FIR.B.FF == CAN_frame_std)
|
if (rx_frame.FIR.B.FF == CAN_frame_std)
|
||||||
{
|
{
|
||||||
//printf("New standard frame");
|
//printf("New standard frame");
|
||||||
#ifdef BATTERY_TYPE_LEAF
|
// battery
|
||||||
receive_can_leaf_battery(rx_frame);
|
|
||||||
#endif
|
|
||||||
#ifdef TESLA_MODEL_3_BATTERY
|
|
||||||
receive_can_tesla_model_3_battery(rx_frame);
|
|
||||||
#endif
|
|
||||||
#ifdef RENAULT_ZOE_BATTERY
|
|
||||||
receive_can_zoe_battery(rx_frame);
|
|
||||||
#endif
|
|
||||||
#ifdef BMW_I3_BATTERY
|
#ifdef BMW_I3_BATTERY
|
||||||
receive_can_i3_battery(rx_frame);
|
receive_can_i3_battery(rx_frame);
|
||||||
#endif
|
#endif
|
||||||
#ifdef IMIEV_ION_CZERO_BATTERY
|
#ifdef CHADEMO_BATTERY
|
||||||
|
receive_can_chademo(rx_frame);
|
||||||
|
#endif
|
||||||
|
#ifdef IMIEV_CZERO_ION_BATTERY
|
||||||
receive_can_imiev_battery(rx_frame);
|
receive_can_imiev_battery(rx_frame);
|
||||||
#endif
|
#endif
|
||||||
#ifdef KIA_HYUNDAI_64_BATTERY
|
#ifdef KIA_HYUNDAI_64_BATTERY
|
||||||
receive_can_kiaHyundai_64_battery(rx_frame);
|
receive_can_kiaHyundai_64_battery(rx_frame);
|
||||||
#endif
|
#endif
|
||||||
#ifdef CAN_BYD
|
#ifdef NISSAN_LEAF_BATTERY
|
||||||
|
receive_can_leaf_battery(rx_frame);
|
||||||
|
#endif
|
||||||
|
#ifdef RENAULT_ZOE_BATTERY
|
||||||
|
receive_can_zoe_battery(rx_frame);
|
||||||
|
#endif
|
||||||
|
#ifdef TESLA_MODEL_3_BATTERY
|
||||||
|
receive_can_tesla_model_3_battery(rx_frame);
|
||||||
|
#endif
|
||||||
|
// inverter
|
||||||
|
#ifdef BYD_CAN
|
||||||
receive_can_byd(rx_frame);
|
receive_can_byd(rx_frame);
|
||||||
#endif
|
#endif
|
||||||
#ifdef SMA_CAN
|
#ifdef SMA_CAN
|
||||||
receive_can_sma(rx_frame);
|
receive_can_sma(rx_frame);
|
||||||
#endif
|
|
||||||
#ifdef CHADEMO
|
|
||||||
receive_can_chademo(rx_frame);
|
|
||||||
#endif
|
#endif
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
//printf("New extended frame");
|
//printf("New extended frame");
|
||||||
|
#ifdef PYLON_CAN
|
||||||
|
receive_can_pylon(rx_frame);
|
||||||
|
#endif
|
||||||
|
#ifdef SOFAR_CAN
|
||||||
|
receive_can_sofar(rx_frame);
|
||||||
|
#endif
|
||||||
#ifdef SOLAX_CAN
|
#ifdef SOLAX_CAN
|
||||||
receive_can_solax(rx_frame);
|
receive_can_solax(rx_frame);
|
||||||
#endif
|
|
||||||
#ifdef PYLON_CAN
|
|
||||||
receive_can_pylon(rx_frame);
|
|
||||||
#endif
|
|
||||||
#ifdef SOFAR_CAN
|
|
||||||
receive_can_sofar(rx_frame);
|
|
||||||
#endif
|
#endif
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
//When we are done checking if a CAN message has arrived, we can focus on sending CAN messages
|
//When we are done checking if a CAN message has arrived, we can focus on sending CAN messages
|
||||||
//Inverter sending
|
//Inverter sending
|
||||||
#ifdef CAN_BYD
|
#ifdef BYD_CAN
|
||||||
send_can_byd();
|
send_can_byd();
|
||||||
#endif
|
#endif
|
||||||
#ifdef SMA_CAN
|
#ifdef SMA_CAN
|
||||||
|
@ -329,26 +337,26 @@ void handle_can()
|
||||||
send_can_sofar();
|
send_can_sofar();
|
||||||
#endif
|
#endif
|
||||||
//Battery sending
|
//Battery sending
|
||||||
#ifdef BATTERY_TYPE_LEAF
|
|
||||||
send_can_leaf_battery();
|
|
||||||
#endif
|
|
||||||
#ifdef TESLA_MODEL_3_BATTERY
|
|
||||||
send_can_tesla_model_3_battery();
|
|
||||||
#endif
|
|
||||||
#ifdef RENAULT_ZOE_BATTERY
|
|
||||||
send_can_zoe_battery();
|
|
||||||
#endif
|
|
||||||
#ifdef BMW_I3_BATTERY
|
#ifdef BMW_I3_BATTERY
|
||||||
send_can_i3_battery();
|
send_can_i3_battery();
|
||||||
#endif
|
#endif
|
||||||
#ifdef IMIEV_ION_CZERO_BATTERY
|
#ifdef CHADEMO_BATTERY
|
||||||
|
send_can_chademo_battery();
|
||||||
|
#endif
|
||||||
|
#ifdef IMIEV_CZERO_ION_BATTERY
|
||||||
send_can_imiev_battery();
|
send_can_imiev_battery();
|
||||||
#endif
|
#endif
|
||||||
#ifdef KIA_HYUNDAI_64_BATTERY
|
#ifdef KIA_HYUNDAI_64_BATTERY
|
||||||
send_can_kiaHyundai_64_battery();
|
send_can_kiaHyundai_64_battery();
|
||||||
#endif
|
#endif
|
||||||
#ifdef CHADEMO
|
#ifdef NISSAN_LEAF_BATTERY
|
||||||
send_can_chademo_battery();
|
send_can_leaf_battery();
|
||||||
|
#endif
|
||||||
|
#ifdef RENAULT_ZOE_BATTERY
|
||||||
|
send_can_zoe_battery();
|
||||||
|
#endif
|
||||||
|
#ifdef TESLA_MODEL_3_BATTERY
|
||||||
|
send_can_tesla_model_3_battery();
|
||||||
#endif
|
#endif
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -374,24 +382,24 @@ void handle_can()
|
||||||
if (rx_frame2.FIR.B.FF == CAN_frame_std)
|
if (rx_frame2.FIR.B.FF == CAN_frame_std)
|
||||||
{
|
{
|
||||||
//Serial.println("New standard frame");
|
//Serial.println("New standard frame");
|
||||||
#ifdef CAN_BYD
|
#ifdef BYD_CAN
|
||||||
receive_can_byd(rx_frame2);
|
receive_can_byd(rx_frame2);
|
||||||
#endif
|
#endif
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
//Serial.println("New extended frame");
|
//Serial.println("New extended frame");
|
||||||
#ifdef SOLAX_CAN
|
|
||||||
receive_can_solax(rx_frame2);
|
|
||||||
#endif
|
|
||||||
#ifdef PYLON_CAN
|
#ifdef PYLON_CAN
|
||||||
receive_can_pylon(rx_frame2);
|
receive_can_pylon(rx_frame2);
|
||||||
#endif
|
#endif
|
||||||
|
#ifdef SOLAX_CAN
|
||||||
|
receive_can_solax(rx_frame2);
|
||||||
|
#endif
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
//When we are done checking if a CAN message has arrived, we can focus on sending CAN messages
|
//When we are done checking if a CAN message has arrived, we can focus on sending CAN messages
|
||||||
//Inverter sending
|
//Inverter sending
|
||||||
#ifdef CAN_BYD
|
#ifdef BYD_CAN
|
||||||
send_can_byd();
|
send_can_byd();
|
||||||
#endif
|
#endif
|
||||||
}
|
}
|
||||||
|
@ -399,45 +407,46 @@ void handle_can()
|
||||||
|
|
||||||
void handle_inverter()
|
void handle_inverter()
|
||||||
{
|
{
|
||||||
#ifdef BATTERY_TYPE_LEAF
|
// battery
|
||||||
update_values_leaf_battery(); //Map the values to the correct registers
|
|
||||||
#endif
|
|
||||||
#ifdef TESLA_MODEL_3_BATTERY
|
|
||||||
update_values_tesla_model_3_battery(); //Map the values to the correct registers
|
|
||||||
#endif
|
|
||||||
#ifdef RENAULT_ZOE_BATTERY
|
|
||||||
update_values_zoe_battery(); //Map the values to the correct registers
|
|
||||||
#endif
|
|
||||||
#ifdef BMW_I3_BATTERY
|
#ifdef BMW_I3_BATTERY
|
||||||
update_values_i3_battery(); //Map the values to the correct registers
|
update_values_i3_battery(); //Map the values to the correct registers
|
||||||
#endif
|
#endif
|
||||||
#ifdef IMIEV_ION_CZERO_BATTERY
|
#ifdef CHADEMO_BATTERY
|
||||||
|
update_values_can_chademo();
|
||||||
|
#endif
|
||||||
|
#ifdef IMIEV_CZERO_ION_BATTERY
|
||||||
update_values_imiev_battery(); //Map the values to the correct registers
|
update_values_imiev_battery(); //Map the values to the correct registers
|
||||||
#endif
|
#endif
|
||||||
#ifdef KIA_HYUNDAI_64_BATTERY
|
#ifdef KIA_HYUNDAI_64_BATTERY
|
||||||
update_values_kiaHyundai_64_battery(); //Map the values to the correct registers
|
update_values_kiaHyundai_64_battery(); //Map the values to the correct registers
|
||||||
#endif
|
#endif
|
||||||
#ifdef SOLAX_CAN
|
#ifdef NISSAN_LEAF_BATTERY
|
||||||
update_values_can_solax();
|
update_values_leaf_battery(); //Map the values to the correct registers
|
||||||
|
#endif
|
||||||
|
#ifdef RENAULT_ZOE_BATTERY
|
||||||
|
update_values_zoe_battery(); //Map the values to the correct registers
|
||||||
#endif
|
#endif
|
||||||
#ifdef CAN_BYD
|
#ifdef TESLA_MODEL_3_BATTERY
|
||||||
|
update_values_tesla_model_3_battery(); //Map the values to the correct registers
|
||||||
|
#endif
|
||||||
|
// inverter
|
||||||
|
#ifdef BYD_CAN
|
||||||
update_values_can_byd();
|
update_values_can_byd();
|
||||||
#endif
|
#endif
|
||||||
#ifdef SMA_CAN
|
#ifdef BYD_MODBUS
|
||||||
update_values_can_sma();
|
update_modbus_registers_byd();
|
||||||
|
#endif
|
||||||
|
#ifdef LUNA2000_MODBUS
|
||||||
|
update_modbus_registers_luna2000();
|
||||||
#endif
|
#endif
|
||||||
#ifdef PYLON_CAN
|
#ifdef PYLON_CAN
|
||||||
update_values_can_pylon();
|
update_values_can_pylon();
|
||||||
#endif
|
#endif
|
||||||
#ifdef CHADEMO
|
#ifdef SMA_CAN
|
||||||
update_values_can_chademo();
|
update_values_can_sma();
|
||||||
#endif
|
#endif
|
||||||
|
#ifdef SOLAX_CAN
|
||||||
#ifdef MODBUS_BYD
|
update_values_can_solax();
|
||||||
update_modbus_registers_byd();
|
|
||||||
#endif
|
|
||||||
#ifdef MODBUS_LUNA2000
|
|
||||||
update_modbus_registers_luna2000();
|
|
||||||
#endif
|
#endif
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -6,22 +6,22 @@
|
||||||
/* There are also some options for battery limits and extra functionality */
|
/* There are also some options for battery limits and extra functionality */
|
||||||
|
|
||||||
/* Select battery used */
|
/* Select battery used */
|
||||||
#define BATTERY_TYPE_LEAF
|
|
||||||
//#define TESLA_MODEL_3_BATTERY
|
|
||||||
//#define RENAULT_ZOE_BATTERY
|
|
||||||
//#define BMW_I3_BATTERY
|
//#define BMW_I3_BATTERY
|
||||||
//#define IMIEV_ION_CZERO_BATTERY
|
//#define CHADEMO_BATTERY
|
||||||
|
//#define IMIEV_CZERO_ION_BATTERY
|
||||||
//#define KIA_HYUNDAI_64_BATTERY
|
//#define KIA_HYUNDAI_64_BATTERY
|
||||||
//#define CHADEMO
|
#define NISSAN_LEAF_BATTERY
|
||||||
|
//#define RENAULT_ZOE_BATTERY
|
||||||
|
//#define TESLA_MODEL_3_BATTERY
|
||||||
|
|
||||||
/* Select inverter communication protocol. See Wiki for which to use with your inverter: https://github.com/dalathegreat/BYD-Battery-Emulator-For-Gen24/wiki */
|
/* Select inverter communication protocol. See Wiki for which to use with your inverter: https://github.com/dalathegreat/BYD-Battery-Emulator-For-Gen24/wiki */
|
||||||
#define MODBUS_BYD //Enable this line to emulate a "BYD 11kWh HVM battery" over Modbus RTU
|
//#define BYD_CAN //Enable this line to emulate a "BYD Battery-Box Premium HVS" over CAN Bus
|
||||||
//#define MODBUS_LUNA2000 //Enable this line to emulate a "Luna2000 battery" over Modbus RTU
|
#define BYD_MODBUS //Enable this line to emulate a "BYD 11kWh HVM battery" over Modbus RTU
|
||||||
//#define CAN_BYD //Enable this line to emulate a "BYD Battery-Box Premium HVS" over CAN Bus
|
//#define LUNA2000_MODBUS //Enable this line to emulate a "Luna2000 battery" over Modbus RTU
|
||||||
//#define SOLAX_CAN //Enable this line to emulate a "SolaX Triple Power LFP" over CAN bus
|
//#define PYLON_CAN //Enable this line to emulate a "Pylontech battery" over CAN bus
|
||||||
//#define PYLON_CAN //Enable this line to emulate a "Pylontech battery" over CAN bus
|
//#define SMA_CAN //Enable this line to emulate a "BYD Battery-Box H 8.9kWh, 7 mod" over CAN bus
|
||||||
//#define SMA_CAN //Enable this line to emulate a "BYD Battery-Box H 8.9kWh, 7 mod" over CAN bus
|
//#define SOFAR_CAN //Enable this line to emulate a "Sofar Energy Storage Inverter High Voltage BMS General Protocol (Extended Frame)" over CAN bus
|
||||||
//#define SOFAR_CAN //Enable this line to emulate a "Sofar Energy Storage Inverter High Voltage BMS General Protocol (Extended Frame)" over CAN bus
|
//#define SOLAX_CAN //Enable this line to emulate a "SolaX Triple Power LFP" over CAN bus
|
||||||
|
|
||||||
/* Battery settings */
|
/* Battery settings */
|
||||||
#define BATTERY_WH_MAX 30000 //Battery size in Wh (Maximum value for most inverters is 60000 [60kWh], you can use larger batteries but do set value over 60000!
|
#define BATTERY_WH_MAX 30000 //Battery size in Wh (Maximum value for most inverters is 60000 [60kWh], you can use larger batteries but do set value over 60000!
|
||||||
|
|
|
@ -1,23 +1,15 @@
|
||||||
#ifndef BATTERIES_H
|
#ifndef BATTERIES_H
|
||||||
#define BATTERIES_H
|
#define BATTERIES_H
|
||||||
|
|
||||||
#ifdef BATTERY_TYPE_LEAF
|
|
||||||
#include "NISSAN-LEAF-BATTERY.h" //See this file for more LEAF battery settings
|
|
||||||
#endif
|
|
||||||
|
|
||||||
#ifdef TESLA_MODEL_3_BATTERY
|
|
||||||
#include "TESLA-MODEL-3-BATTERY.h" //See this file for more Tesla battery settings
|
|
||||||
#endif
|
|
||||||
|
|
||||||
#ifdef RENAULT_ZOE_BATTERY
|
|
||||||
#include "RENAULT-ZOE-BATTERY.h" //See this file for more Zoe battery settings
|
|
||||||
#endif
|
|
||||||
|
|
||||||
#ifdef BMW_I3_BATTERY
|
#ifdef BMW_I3_BATTERY
|
||||||
#include "BMW-I3-BATTERY.h" //See this file for more i3 battery settings
|
#include "BMW-I3-BATTERY.h" //See this file for more i3 battery settings
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#ifdef IMIEV_ION_CZERO_BATTERY
|
#ifdef CHADEMO_BATTERY
|
||||||
|
#include "CHADEMO-BATTERY.h" //See this file for more Chademo settings
|
||||||
|
#endif
|
||||||
|
|
||||||
|
#ifdef IMIEV_CZERO_ION_BATTERY
|
||||||
#include "IMIEV-CZERO-ION-BATTERY.h" //See this file for more triplet battery settings
|
#include "IMIEV-CZERO-ION-BATTERY.h" //See this file for more triplet battery settings
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
@ -25,8 +17,16 @@
|
||||||
#include "KIA-HYUNDAI-64-BATTERY.h" //See this file for more 64kWh battery settings
|
#include "KIA-HYUNDAI-64-BATTERY.h" //See this file for more 64kWh battery settings
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#ifdef CHADEMO
|
#ifdef NISSAN_LEAF_BATTERY
|
||||||
#include "CHADEMO-BATTERY.h" //See this file for more Chademo settings
|
#include "NISSAN-LEAF-BATTERY.h" //See this file for more LEAF battery settings
|
||||||
|
#endif
|
||||||
|
|
||||||
|
#ifdef RENAULT_ZOE_BATTERY
|
||||||
|
#include "RENAULT-ZOE-BATTERY.h" //See this file for more Zoe battery settings
|
||||||
|
#endif
|
||||||
|
|
||||||
|
#ifdef TESLA_MODEL_3_BATTERY
|
||||||
|
#include "TESLA-MODEL-3-BATTERY.h" //See this file for more Tesla battery settings
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#endif
|
#endif
|
|
@ -1,4 +1,4 @@
|
||||||
#include "MODBUS-BYD.h"
|
#include "BYD-MODBUS.h"
|
||||||
|
|
||||||
void update_modbus_registers_byd() {
|
void update_modbus_registers_byd() {
|
||||||
//Updata for ModbusRTU Server for BYD
|
//Updata for ModbusRTU Server for BYD
|
|
@ -1,5 +1,5 @@
|
||||||
#ifndef MODBUS_BYD_H
|
#ifndef BYD_MODBUS_H
|
||||||
#define MODBUS_BYD_H
|
#define BYD_MODBUS_H
|
||||||
#include <Arduino.h>
|
#include <Arduino.h>
|
||||||
|
|
||||||
#define MB_RTU_NUM_VALUES 30000
|
#define MB_RTU_NUM_VALUES 30000
|
|
@ -1,12 +1,20 @@
|
||||||
#ifndef INVERTERS_H
|
#ifndef INVERTERS_H
|
||||||
#define INVERTERS_H
|
#define INVERTERS_H
|
||||||
|
|
||||||
#ifdef SOLAX_CAN
|
#ifdef BYD_CAN
|
||||||
#include "SOLAX-CAN.h"
|
#include "BYD-CAN.h"
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#ifdef CAN_BYD
|
#ifdef BYD_MODBUS
|
||||||
#include "BYD-CAN.h"
|
#include "BYD-MODBUS.h"
|
||||||
|
#endif
|
||||||
|
|
||||||
|
#ifdef LUNA2000_MODBUS
|
||||||
|
#include "LUNA2000-MODBUS.h"
|
||||||
|
#endif
|
||||||
|
|
||||||
|
#ifdef PYLON_CAN
|
||||||
|
#include "PYLON-CAN.h"
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#ifdef SMA_CAN
|
#ifdef SMA_CAN
|
||||||
|
@ -17,16 +25,8 @@
|
||||||
#include "SOFAR-CAN.h"
|
#include "SOFAR-CAN.h"
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#ifdef PYLON_CAN
|
#ifdef SOLAX_CAN
|
||||||
#include "PYLON-CAN.h"
|
#include "SOLAX-CAN.h"
|
||||||
#endif
|
|
||||||
|
|
||||||
#ifdef MODBUS_BYD
|
|
||||||
#include "MODBUS-BYD.h"
|
|
||||||
#endif
|
|
||||||
|
|
||||||
#ifdef MODBUS_LUNA2000
|
|
||||||
#include "MODBUS-LUNA2000.h"
|
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#endif
|
#endif
|
|
@ -1,4 +1,4 @@
|
||||||
#include "MODBUS-LUNA2000.h"
|
#include "LUNA2000-MODBUS.h"
|
||||||
|
|
||||||
void update_modbus_registers_luna2000()
|
void update_modbus_registers_luna2000()
|
||||||
{
|
{
|
|
@ -1,5 +1,5 @@
|
||||||
#ifndef MODBUS_LUNA2000_H
|
#ifndef LUNA2000_MODBUS_H
|
||||||
#define MODBUS_LUNA2000_H
|
#define LUNA2000_MODBUS_H
|
||||||
#include <Arduino.h>
|
#include <Arduino.h>
|
||||||
|
|
||||||
#define MB_RTU_NUM_VALUES 50000
|
#define MB_RTU_NUM_VALUES 50000
|
Loading…
Add table
Add a link
Reference in a new issue