mirror of
https://github.com/dalathegreat/Battery-Emulator.git
synced 2025-10-03 09:49:32 +02:00
Progress
This commit is contained in:
parent
1cc4a021c2
commit
fb62b2cdb1
4 changed files with 19 additions and 24 deletions
|
@ -52,8 +52,12 @@ TaskHandle_t mqtt_loop_task;
|
|||
|
||||
Logging logging;
|
||||
|
||||
static std::list<Transmitter*> transmitters;
|
||||
std::string mqtt_user; //TODO, move?
|
||||
std::string mqtt_password; //TODO, move?
|
||||
std::string http_username; //TODO, move?
|
||||
std::string http_password; //TODO, move?
|
||||
|
||||
static std::list<Transmitter*> transmitters;
|
||||
void register_transmitter(Transmitter* transmitter) {
|
||||
transmitters.push_back(transmitter);
|
||||
DEBUG_PRINTF("transmitter registered, total: %d\n", transmitters.size());
|
||||
|
|
|
@ -20,23 +20,21 @@ volatile CAN_Configuration can_config = {
|
|||
.shunt = CAN_NATIVE // (OPTIONAL) Which CAN is your shunt connected to?
|
||||
};
|
||||
|
||||
std::string ssid;
|
||||
std::string password;
|
||||
std::string passwordAP;
|
||||
|
||||
const uint8_t wifi_channel = 0; // Set to 0 for automatic channel selection
|
||||
|
||||
std::string http_username;
|
||||
std::string http_password;
|
||||
|
||||
// Set your Static IP address. Only used incase WIFICONFIG is set in USER_SETTINGS.h
|
||||
IPAddress local_IP(192, 168, 10, 150);
|
||||
IPAddress gateway(192, 168, 10, 1);
|
||||
IPAddress subnet(255, 255, 255, 0);
|
||||
|
||||
std::string ssid;
|
||||
std::string password;
|
||||
std::string passwordAP;
|
||||
|
||||
const uint8_t wifi_channel = 0; // Set to 0 for automatic channel selection
|
||||
|
||||
|
||||
// MQTT
|
||||
std::string mqtt_user;
|
||||
std::string mqtt_password;
|
||||
|
||||
|
||||
const char* mqtt_topic_name =
|
||||
"BE"; // Custom MQTT topic name. Previously, the name was automatically set to "battery-emulator_esp32-XXXXXX"
|
||||
|
|
|
@ -4,14 +4,6 @@
|
|||
#include <stdint.h>
|
||||
#include "src/devboard/utils/types.h"
|
||||
|
||||
/* This file is being transitioned towards COMMON_IMAGE. Use v8.16 if you are taking this software into use! */
|
||||
|
||||
/* Select hardware used for Battery-Emulator */
|
||||
//#define HW_LILYGO
|
||||
//#define HW_STARK
|
||||
//#define HW_3LB
|
||||
//#define HW_DEVKIT
|
||||
|
||||
/* Shunt/Contactor settings (Optional) */
|
||||
//#define BMW_SBOX // SBOX relay control & battery current/voltage measurement
|
||||
|
||||
|
@ -22,10 +14,6 @@
|
|||
/* Connectivity options */
|
||||
//#define WIFICONFIG //Enable this line to set a static IP address / gateway /subnet mask for the device. see USER_SETTINGS.cpp for the settings
|
||||
|
||||
#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
|
||||
|
||||
/* Do not change any code below this line */
|
||||
/* Only change battery specific settings above and in "USER_SETTINGS.cpp" */
|
||||
typedef struct {
|
||||
|
|
|
@ -24,11 +24,16 @@ int mqtt_port = mqtt_port_default;
|
|||
std::string mqtt_server = mqtt_server_default;
|
||||
|
||||
bool mqtt_manual_topic_object_name =
|
||||
true; //TODO, should this be configurable from webserver? Or legacy option removed?
|
||||
true; //TODO: should this be configurable from webserver? Or legacy option removed?
|
||||
// If this is not true, the previous default naming format 'battery-emulator_esp32-XXXXXX' (based on hardware ID) will be used.
|
||||
// This naming convention was in place until version 7.5.0. Users should check the version from which they are updating, as this change
|
||||
// may break compatibility with previous versions of MQTT naming
|
||||
|
||||
#define MQTT_PUBLISH_CELL_VOLTAGES // Enable this line to publish cell voltages to MQTT
|
||||
#define MQTT_QOS 0 // MQTT Quality of Service (0, 1, or 2)
|
||||
#define MQTT_TIMEOUT 2000 // MQTT timeout in milliseconds
|
||||
//TODO: Should all these defines be a configurable option?
|
||||
|
||||
esp_mqtt_client_config_t mqtt_cfg;
|
||||
esp_mqtt_client_handle_t client;
|
||||
char mqtt_msg[MQTT_MSG_BUFFER_SIZE];
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue