mirror of
https://github.com/dalathegreat/Battery-Emulator.git
synced 2025-10-05 02:39:57 +02:00
Merge branch 'main' into bugfix/foxess-can-load
This commit is contained in:
commit
7b7f085160
7 changed files with 102 additions and 35 deletions
|
@ -70,9 +70,13 @@ MyTimer loop_task_timer_10s(INTERVAL_10_S);
|
||||||
|
|
||||||
MyTimer check_pause_2s(INTERVAL_2_S);
|
MyTimer check_pause_2s(INTERVAL_2_S);
|
||||||
|
|
||||||
|
int64_t mqtt_task_time_us;
|
||||||
|
MyTimer mqtt_task_timer_10s(INTERVAL_10_S);
|
||||||
|
|
||||||
TaskHandle_t main_loop_task;
|
TaskHandle_t main_loop_task;
|
||||||
TaskHandle_t connectivity_loop_task;
|
TaskHandle_t connectivity_loop_task;
|
||||||
TaskHandle_t logging_loop_task;
|
TaskHandle_t logging_loop_task;
|
||||||
|
TaskHandle_t mqtt_loop_task;
|
||||||
|
|
||||||
Logging logging;
|
Logging logging;
|
||||||
|
|
||||||
|
@ -99,6 +103,11 @@ void setup() {
|
||||||
TASK_CONNECTIVITY_PRIO, &logging_loop_task, WIFI_CORE);
|
TASK_CONNECTIVITY_PRIO, &logging_loop_task, WIFI_CORE);
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
#ifdef MQTT
|
||||||
|
xTaskCreatePinnedToCore((TaskFunction_t)&mqtt_loop, "mqtt_loop", 4096, &mqtt_task_time_us, TASK_MQTT_PRIO,
|
||||||
|
&mqtt_loop_task, WIFI_CORE);
|
||||||
|
#endif
|
||||||
|
|
||||||
init_CAN();
|
init_CAN();
|
||||||
|
|
||||||
init_contactors();
|
init_contactors();
|
||||||
|
@ -180,9 +189,6 @@ void connectivity_loop(void* task_time_us) {
|
||||||
#ifdef MDNSRESPONDER
|
#ifdef MDNSRESPONDER
|
||||||
init_mDNS();
|
init_mDNS();
|
||||||
#endif
|
#endif
|
||||||
#ifdef MQTT
|
|
||||||
init_mqtt();
|
|
||||||
#endif
|
|
||||||
|
|
||||||
while (true) {
|
while (true) {
|
||||||
START_TIME_MEASUREMENT(wifi);
|
START_TIME_MEASUREMENT(wifi);
|
||||||
|
@ -191,15 +197,9 @@ void connectivity_loop(void* task_time_us) {
|
||||||
ota_monitor();
|
ota_monitor();
|
||||||
#endif
|
#endif
|
||||||
END_TIME_MEASUREMENT_MAX(wifi, datalayer.system.status.wifi_task_10s_max_us);
|
END_TIME_MEASUREMENT_MAX(wifi, datalayer.system.status.wifi_task_10s_max_us);
|
||||||
#ifdef MQTT
|
|
||||||
START_TIME_MEASUREMENT(mqtt);
|
|
||||||
mqtt_loop();
|
|
||||||
END_TIME_MEASUREMENT_MAX(mqtt, datalayer.system.status.mqtt_task_10s_max_us);
|
|
||||||
#endif
|
|
||||||
|
|
||||||
#ifdef FUNCTION_TIME_MEASUREMENT
|
#ifdef FUNCTION_TIME_MEASUREMENT
|
||||||
if (connectivity_task_timer_10s.elapsed()) {
|
if (connectivity_task_timer_10s.elapsed()) {
|
||||||
datalayer.system.status.mqtt_task_10s_max_us = 0;
|
|
||||||
datalayer.system.status.wifi_task_10s_max_us = 0;
|
datalayer.system.status.wifi_task_10s_max_us = 0;
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
|
@ -209,6 +209,28 @@ void connectivity_loop(void* task_time_us) {
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
#ifdef MQTT
|
||||||
|
void mqtt_loop(void* task_time_us) {
|
||||||
|
esp_task_wdt_add(NULL); // Register this task with WDT
|
||||||
|
|
||||||
|
init_mqtt();
|
||||||
|
|
||||||
|
while (true) {
|
||||||
|
START_TIME_MEASUREMENT(mqtt);
|
||||||
|
mqtt_loop();
|
||||||
|
END_TIME_MEASUREMENT_MAX(mqtt, datalayer.system.status.mqtt_task_10s_max_us);
|
||||||
|
|
||||||
|
#ifdef FUNCTION_TIME_MEASUREMENT
|
||||||
|
if (mqtt_task_timer_10s.elapsed()) {
|
||||||
|
datalayer.system.status.mqtt_task_10s_max_us = 0;
|
||||||
|
}
|
||||||
|
#endif
|
||||||
|
esp_task_wdt_reset(); // Reset watchdog
|
||||||
|
delay(1);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
#endif
|
||||||
|
|
||||||
void core_loop(void* task_time_us) {
|
void core_loop(void* task_time_us) {
|
||||||
esp_task_wdt_add(NULL); // Register this task with WDT
|
esp_task_wdt_add(NULL); // Register this task with WDT
|
||||||
TickType_t xLastWakeTime = xTaskGetTickCount();
|
TickType_t xLastWakeTime = xTaskGetTickCount();
|
||||||
|
|
|
@ -121,7 +121,9 @@
|
||||||
|
|
||||||
/* MQTT options */
|
/* MQTT options */
|
||||||
// #define MQTT // Enable this line to enable MQTT
|
// #define MQTT // Enable this line to enable MQTT
|
||||||
#define MQTT_QOS 0 // MQTT Quality of Service (0, 1, or 2)
|
#define MQTT_QOS 0 // MQTT Quality of Service (0, 1, or 2)
|
||||||
|
#define MQTT_PUBLISH_CELL_VOLTAGES // Enable this line to publish cell voltages to MQTT
|
||||||
|
#define MQTT_TIMEOUT 2000 // MQTT timeout in milliseconds
|
||||||
#define MQTT_MANUAL_TOPIC_OBJECT_NAME
|
#define MQTT_MANUAL_TOPIC_OBJECT_NAME
|
||||||
// Enable MQTT_MANUAL_TOPIC_OBJECT_NAME to use custom MQTT topic, object ID prefix, and device name.
|
// Enable MQTT_MANUAL_TOPIC_OBJECT_NAME to use custom MQTT topic, object ID prefix, and device name.
|
||||||
// WARNING: If this is not defined, the previous default naming format 'battery-emulator_esp32-XXXXXX' (based on hardware ID) will be used.
|
// WARNING: If this is not defined, the previous default naming format 'battery-emulator_esp32-XXXXXX' (based on hardware ID) will be used.
|
||||||
|
|
|
@ -1,11 +1,9 @@
|
||||||
#include "DALY-BMS.h"
|
#include "../include.h"
|
||||||
#ifdef DALY_BMS
|
#ifdef DALY_BMS
|
||||||
#include <cstdint>
|
#include <cstdint>
|
||||||
#include "../datalayer/datalayer.h"
|
#include "../datalayer/datalayer.h"
|
||||||
#include "../devboard/utils/events.h"
|
#include "../devboard/utils/events.h"
|
||||||
#include "../include.h"
|
#include "DALY-BMS.h"
|
||||||
#include "RENAULT-TWIZY.h"
|
|
||||||
#include "RJXZS-BMS.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 */
|
||||||
|
|
||||||
|
@ -33,7 +31,7 @@ void update_values_battery() {
|
||||||
// limit power when SoC is low or high
|
// limit power when SoC is low or high
|
||||||
uint32_t adaptive_power_limit = 999999;
|
uint32_t adaptive_power_limit = 999999;
|
||||||
if (SOC < 2000)
|
if (SOC < 2000)
|
||||||
adaptive_power_limit = ((uint32_t)SOC * POWER_PER_PERCENT) / 100;
|
adaptive_power_limit = ((uint32_t)(SOC + 100) * POWER_PER_PERCENT) / 100;
|
||||||
else if (SOC > 8000)
|
else if (SOC > 8000)
|
||||||
adaptive_power_limit = ((10000 - (uint32_t)SOC) * POWER_PER_PERCENT) / 100;
|
adaptive_power_limit = ((10000 - (uint32_t)SOC) * POWER_PER_PERCENT) / 100;
|
||||||
|
|
||||||
|
@ -42,9 +40,15 @@ void update_values_battery() {
|
||||||
if (SOC < 2000 && adaptive_power_limit < datalayer.battery.status.max_discharge_power_W)
|
if (SOC < 2000 && adaptive_power_limit < datalayer.battery.status.max_discharge_power_W)
|
||||||
datalayer.battery.status.max_discharge_power_W = adaptive_power_limit;
|
datalayer.battery.status.max_discharge_power_W = adaptive_power_limit;
|
||||||
|
|
||||||
// always allow to charge at least a little bit
|
int32_t temperature_limit = POWER_PER_DEGREE_C * (int32_t)temperature_min_dC / 10 + POWER_AT_0_DEGREE_C;
|
||||||
if (datalayer.battery.status.max_charge_power_W < POWER_PER_PERCENT)
|
if (temperature_limit <= 0 || temperature_min_dC < BATTERY_MINTEMPERATURE ||
|
||||||
datalayer.battery.status.max_charge_power_W = POWER_PER_PERCENT;
|
temperature_max_dC > BATTERY_MAXTEMPERATURE)
|
||||||
|
temperature_limit = 0;
|
||||||
|
|
||||||
|
if (temperature_limit < datalayer.battery.status.max_discharge_power_W)
|
||||||
|
datalayer.battery.status.max_discharge_power_W = temperature_limit;
|
||||||
|
if (temperature_limit < datalayer.battery.status.max_charge_power_W)
|
||||||
|
datalayer.battery.status.max_charge_power_W = temperature_limit;
|
||||||
|
|
||||||
memcpy(datalayer.battery.status.cell_voltages_mV, cellvoltages_mV, sizeof(cellvoltages_mV));
|
memcpy(datalayer.battery.status.cell_voltages_mV, cellvoltages_mV, sizeof(cellvoltages_mV));
|
||||||
datalayer.battery.status.cell_min_voltage_mV = cellvoltage_min_mV;
|
datalayer.battery.status.cell_min_voltage_mV = cellvoltage_min_mV;
|
||||||
|
|
|
@ -3,11 +3,13 @@
|
||||||
|
|
||||||
/* Tweak these according to your battery build */
|
/* Tweak these according to your battery build */
|
||||||
#define CELL_COUNT 14
|
#define CELL_COUNT 14
|
||||||
#define MAX_PACK_VOLTAGE_DV 588 //588 = 58.8V
|
#define MAX_PACK_VOLTAGE_DV 580 //580 = 58.0V
|
||||||
#define MIN_PACK_VOLTAGE_DV 518 //518 = 51.8V
|
#define MIN_PACK_VOLTAGE_DV 460 //480 = 48.0V
|
||||||
#define MAX_CELL_VOLTAGE_MV 4250 //Battery is put into emergency stop if one cell goes over this value
|
#define MAX_CELL_VOLTAGE_MV 4200 //Battery is put into emergency stop if one cell goes over this value
|
||||||
#define MIN_CELL_VOLTAGE_MV 2700 //Battery is put into emergency stop if one cell goes below this value
|
#define MIN_CELL_VOLTAGE_MV 3200 //Battery is put into emergency stop if one cell goes below this value
|
||||||
#define POWER_PER_PERCENT 50 // below 20% and above 80% limit power to 50W * SOC (i.e. 150W at 3%, 500W at 10%, ...)
|
#define POWER_PER_PERCENT 50 // below 20% and above 80% limit power to 50W * SOC (i.e. 150W at 3%, 500W at 10%, ...)
|
||||||
|
#define POWER_PER_DEGREE_C 60 // max power added/removed per degree above/below 0°C
|
||||||
|
#define POWER_AT_0_DEGREE_C 800 // power at 0°C
|
||||||
|
|
||||||
/* Do not modify any rows below*/
|
/* Do not modify any rows below*/
|
||||||
#define BATTERY_SELECTED
|
#define BATTERY_SELECTED
|
||||||
|
|
|
@ -25,16 +25,30 @@ static String object_id_prefix = "";
|
||||||
static String device_name = "";
|
static String device_name = "";
|
||||||
static String device_id = "";
|
static String device_id = "";
|
||||||
|
|
||||||
static void publish_common_info(void);
|
static bool publish_common_info(void);
|
||||||
static void publish_cell_voltages(void);
|
static bool publish_cell_voltages(void);
|
||||||
static void publish_events(void);
|
static bool publish_events(void);
|
||||||
|
|
||||||
/** Publish global values and call callbacks for specific modules */
|
/** Publish global values and call callbacks for specific modules */
|
||||||
static void publish_values(void) {
|
static void publish_values(void) {
|
||||||
mqtt_publish((topic_name + "/status").c_str(), "online", false);
|
|
||||||
publish_events();
|
if (mqtt_publish((topic_name + "/status").c_str(), "online", false) == false) {
|
||||||
publish_common_info();
|
return;
|
||||||
publish_cell_voltages();
|
}
|
||||||
|
|
||||||
|
if (publish_events() == false) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (publish_common_info() == false) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
#ifdef MQTT_PUBLISH_CELL_VOLTAGES
|
||||||
|
if (publish_cell_voltages() == false) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
#endif
|
||||||
}
|
}
|
||||||
|
|
||||||
#ifdef HA_AUTODISCOVERY
|
#ifdef HA_AUTODISCOVERY
|
||||||
|
@ -169,7 +183,7 @@ void set_battery_attributes(JsonDocument& doc, const DATALAYER_BATTERY_TYPE& bat
|
||||||
|
|
||||||
static std::vector<EventData> order_events;
|
static std::vector<EventData> order_events;
|
||||||
|
|
||||||
static void publish_common_info(void) {
|
static bool publish_common_info(void) {
|
||||||
static JsonDocument doc;
|
static JsonDocument doc;
|
||||||
static String state_topic = topic_name + "/info";
|
static String state_topic = topic_name + "/info";
|
||||||
#ifdef HA_AUTODISCOVERY
|
#ifdef HA_AUTODISCOVERY
|
||||||
|
@ -191,6 +205,8 @@ static void publish_common_info(void) {
|
||||||
serializeJson(doc, mqtt_msg);
|
serializeJson(doc, mqtt_msg);
|
||||||
if (mqtt_publish(generateCommonInfoAutoConfigTopic(config.object_id).c_str(), mqtt_msg, true)) {
|
if (mqtt_publish(generateCommonInfoAutoConfigTopic(config.object_id).c_str(), mqtt_msg, true)) {
|
||||||
ha_common_info_published = true;
|
ha_common_info_published = true;
|
||||||
|
} else {
|
||||||
|
return false;
|
||||||
}
|
}
|
||||||
doc.clear();
|
doc.clear();
|
||||||
}
|
}
|
||||||
|
@ -211,18 +227,20 @@ static void publish_common_info(void) {
|
||||||
}
|
}
|
||||||
#endif // DOUBLE_BATTERY
|
#endif // DOUBLE_BATTERY
|
||||||
serializeJson(doc, mqtt_msg);
|
serializeJson(doc, mqtt_msg);
|
||||||
if (!mqtt_publish(state_topic.c_str(), mqtt_msg, false)) {
|
if (mqtt_publish(state_topic.c_str(), mqtt_msg, false) == false) {
|
||||||
#ifdef DEBUG_LOG
|
#ifdef DEBUG_LOG
|
||||||
logging.println("Common info MQTT msg could not be sent");
|
logging.println("Common info MQTT msg could not be sent");
|
||||||
#endif // DEBUG_LOG
|
#endif // DEBUG_LOG
|
||||||
|
return false;
|
||||||
}
|
}
|
||||||
doc.clear();
|
doc.clear();
|
||||||
#ifdef HA_AUTODISCOVERY
|
#ifdef HA_AUTODISCOVERY
|
||||||
}
|
}
|
||||||
#endif // HA_AUTODISCOVERY
|
#endif // HA_AUTODISCOVERY
|
||||||
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
static void publish_cell_voltages(void) {
|
static bool publish_cell_voltages(void) {
|
||||||
static JsonDocument doc;
|
static JsonDocument doc;
|
||||||
static String state_topic = topic_name + "/spec_data";
|
static String state_topic = topic_name + "/spec_data";
|
||||||
#ifdef DOUBLE_BATTERY
|
#ifdef DOUBLE_BATTERY
|
||||||
|
@ -244,6 +262,7 @@ static void publish_cell_voltages(void) {
|
||||||
serializeJson(doc, mqtt_msg, sizeof(mqtt_msg));
|
serializeJson(doc, mqtt_msg, sizeof(mqtt_msg));
|
||||||
if (mqtt_publish(generateCellVoltageAutoConfigTopic(cellNumber, "").c_str(), mqtt_msg, true) == false) {
|
if (mqtt_publish(generateCellVoltageAutoConfigTopic(cellNumber, "").c_str(), mqtt_msg, true) == false) {
|
||||||
failed_to_publish = true;
|
failed_to_publish = true;
|
||||||
|
return false;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
doc.clear(); // clear after sending autoconfig
|
doc.clear(); // clear after sending autoconfig
|
||||||
|
@ -260,6 +279,7 @@ static void publish_cell_voltages(void) {
|
||||||
serializeJson(doc, mqtt_msg, sizeof(mqtt_msg));
|
serializeJson(doc, mqtt_msg, sizeof(mqtt_msg));
|
||||||
if (mqtt_publish(generateCellVoltageAutoConfigTopic(cellNumber, "_2_").c_str(), mqtt_msg, true) == false) {
|
if (mqtt_publish(generateCellVoltageAutoConfigTopic(cellNumber, "_2_").c_str(), mqtt_msg, true) == false) {
|
||||||
failed_to_publish = true;
|
failed_to_publish = true;
|
||||||
|
return false;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
doc.clear(); // clear after sending autoconfig
|
doc.clear(); // clear after sending autoconfig
|
||||||
|
@ -286,6 +306,7 @@ static void publish_cell_voltages(void) {
|
||||||
#ifdef DEBUG_LOG
|
#ifdef DEBUG_LOG
|
||||||
logging.println("Cell voltage MQTT msg could not be sent");
|
logging.println("Cell voltage MQTT msg could not be sent");
|
||||||
#endif // DEBUG_LOG
|
#endif // DEBUG_LOG
|
||||||
|
return false;
|
||||||
}
|
}
|
||||||
doc.clear();
|
doc.clear();
|
||||||
}
|
}
|
||||||
|
@ -306,13 +327,15 @@ static void publish_cell_voltages(void) {
|
||||||
#ifdef DEBUG_LOG
|
#ifdef DEBUG_LOG
|
||||||
logging.println("Cell voltage MQTT msg could not be sent");
|
logging.println("Cell voltage MQTT msg could not be sent");
|
||||||
#endif // DEBUG_LOG
|
#endif // DEBUG_LOG
|
||||||
|
return false;
|
||||||
}
|
}
|
||||||
doc.clear();
|
doc.clear();
|
||||||
}
|
}
|
||||||
#endif // DOUBLE_BATTERY
|
#endif // DOUBLE_BATTERY
|
||||||
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
void publish_events() {
|
bool publish_events() {
|
||||||
static JsonDocument doc;
|
static JsonDocument doc;
|
||||||
static String state_topic = topic_name + "/events";
|
static String state_topic = topic_name + "/events";
|
||||||
#ifdef HA_AUTODISCOVERY
|
#ifdef HA_AUTODISCOVERY
|
||||||
|
@ -331,6 +354,8 @@ void publish_events() {
|
||||||
serializeJson(doc, mqtt_msg);
|
serializeJson(doc, mqtt_msg);
|
||||||
if (mqtt_publish(generateEventsAutoConfigTopic("event").c_str(), mqtt_msg, true)) {
|
if (mqtt_publish(generateEventsAutoConfigTopic("event").c_str(), mqtt_msg, true)) {
|
||||||
ha_events_published = true;
|
ha_events_published = true;
|
||||||
|
} else {
|
||||||
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
doc.clear();
|
doc.clear();
|
||||||
|
@ -368,6 +393,7 @@ void publish_events() {
|
||||||
#ifdef DEBUG_LOG
|
#ifdef DEBUG_LOG
|
||||||
logging.println("Common info MQTT msg could not be sent");
|
logging.println("Common info MQTT msg could not be sent");
|
||||||
#endif // DEBUG_LOG
|
#endif // DEBUG_LOG
|
||||||
|
return false;
|
||||||
} else {
|
} else {
|
||||||
set_event_MQTTpublished(event_handle);
|
set_event_MQTTpublished(event_handle);
|
||||||
}
|
}
|
||||||
|
@ -378,9 +404,10 @@ void publish_events() {
|
||||||
#ifdef HA_AUTODISCOVERY
|
#ifdef HA_AUTODISCOVERY
|
||||||
}
|
}
|
||||||
#endif // HA_AUTODISCOVERY
|
#endif // HA_AUTODISCOVERY
|
||||||
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
static void publish_buttons_discovery(void) {
|
static bool publish_buttons_discovery(void) {
|
||||||
#ifdef HA_AUTODISCOVERY
|
#ifdef HA_AUTODISCOVERY
|
||||||
if (ha_buttons_published == false) {
|
if (ha_buttons_published == false) {
|
||||||
#ifdef DEBUG_LOG
|
#ifdef DEBUG_LOG
|
||||||
|
@ -397,11 +424,14 @@ static void publish_buttons_discovery(void) {
|
||||||
serializeJson(doc, mqtt_msg);
|
serializeJson(doc, mqtt_msg);
|
||||||
if (mqtt_publish(generateButtonAutoConfigTopic(config.object_id).c_str(), mqtt_msg, true)) {
|
if (mqtt_publish(generateButtonAutoConfigTopic(config.object_id).c_str(), mqtt_msg, true)) {
|
||||||
ha_buttons_published = true;
|
ha_buttons_published = true;
|
||||||
|
} else {
|
||||||
|
return false;
|
||||||
}
|
}
|
||||||
doc.clear();
|
doc.clear();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
#endif // HA_AUTODISCOVERY
|
#endif // HA_AUTODISCOVERY
|
||||||
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
static void subscribe() {
|
static void subscribe() {
|
||||||
|
@ -511,6 +541,7 @@ void init_mqtt(void) {
|
||||||
mqtt_cfg.session.last_will.retain = true;
|
mqtt_cfg.session.last_will.retain = true;
|
||||||
mqtt_cfg.session.last_will.msg = "offline";
|
mqtt_cfg.session.last_will.msg = "offline";
|
||||||
mqtt_cfg.session.last_will.msg_len = strlen(mqtt_cfg.session.last_will.msg);
|
mqtt_cfg.session.last_will.msg_len = strlen(mqtt_cfg.session.last_will.msg);
|
||||||
|
mqtt_cfg.network.timeout_ms = MQTT_TIMEOUT;
|
||||||
client = esp_mqtt_client_init(&mqtt_cfg);
|
client = esp_mqtt_client_init(&mqtt_cfg);
|
||||||
esp_mqtt_client_register_event(client, MQTT_EVENT_ANY, mqtt_event_handler, client);
|
esp_mqtt_client_register_event(client, MQTT_EVENT_ANY, mqtt_event_handler, client);
|
||||||
}
|
}
|
||||||
|
|
|
@ -25,8 +25,13 @@ String settings_processor(const String& var) {
|
||||||
"<h4 style='color: white;'>Password: ######## <span id='Password'></span> <button "
|
"<h4 style='color: white;'>Password: ######## <span id='Password'></span> <button "
|
||||||
"onclick='editPassword()'>Edit</button></h4>";
|
"onclick='editPassword()'>Edit</button></h4>";
|
||||||
|
|
||||||
|
#ifndef RS485_BATTERY_SELECTED
|
||||||
content += "<h4 style='color: white;'>Battery interface: <span id='Battery'>" +
|
content += "<h4 style='color: white;'>Battery interface: <span id='Battery'>" +
|
||||||
String(getCANInterfaceName(can_config.battery)) + "</span></h4>";
|
String(getCANInterfaceName(can_config.battery)) + "</span></h4>";
|
||||||
|
#endif
|
||||||
|
#ifdef RS485_BATTERY_SELECTED
|
||||||
|
content += "<h4 style='color: white;'>Battery interface: RS485<span id='Battery'></span></h4>";
|
||||||
|
#endif
|
||||||
|
|
||||||
#ifdef DOUBLE_BATTERY
|
#ifdef DOUBLE_BATTERY
|
||||||
content += "<h4 style='color: white;'>Battery #2 interface: <span id='Battery'>" +
|
content += "<h4 style='color: white;'>Battery #2 interface: <span id='Battery'>" +
|
||||||
|
|
|
@ -25,6 +25,7 @@
|
||||||
*/
|
*/
|
||||||
#define TASK_CORE_PRIO 4
|
#define TASK_CORE_PRIO 4
|
||||||
#define TASK_CONNECTIVITY_PRIO 3
|
#define TASK_CONNECTIVITY_PRIO 3
|
||||||
|
#define TASK_MQTT_PRIO 2
|
||||||
#define TASK_MODBUS_PRIO 8
|
#define TASK_MODBUS_PRIO 8
|
||||||
#define TASK_ACAN2515_PRIORITY 10
|
#define TASK_ACAN2515_PRIORITY 10
|
||||||
#define TASK_ACAN2517FD_PRIORITY 10
|
#define TASK_ACAN2517FD_PRIORITY 10
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue