mirror of
https://github.com/dalathegreat/Battery-Emulator.git
synced 2025-10-06 03:50:13 +02:00
Add can-configuration to webui
This commit is contained in:
parent
df626c3920
commit
28703453f9
5 changed files with 106 additions and 39 deletions
|
@ -1,13 +1,36 @@
|
|||
#include "USER_SETTINGS.h"
|
||||
#include <string>
|
||||
#include "src/devboard/hal/hal.h"
|
||||
/* This file contains all the battery settings and limits */
|
||||
/* They can be defined here, or later on in the WebUI */
|
||||
|
||||
/* */
|
||||
extern volatile uint8_t CAN_BATTERY;
|
||||
extern volatile uint8_t CAN_BATTERY_DOUBLE;
|
||||
extern volatile uint8_t CAN_INVERTER;
|
||||
/* Select which CAN interface each component is connected to */
|
||||
/*
|
||||
CAN_NATIVE = Native CAN port on the LilyGo & Stark hardware
|
||||
CANFD_NATIVE = Native CANFD port on the Stark CMR hardware
|
||||
CAN_ADDON_MCP2515 = Add-on CAN MCP2515 connected to GPIO pins
|
||||
CAN_ADDON_FD_MCP2518 = Add-on CAN-FD MCP2518 connected to GPIO pins
|
||||
*/
|
||||
|
||||
volatile CAN_Configuration can_config = {
|
||||
.battery = CAN_NATIVE, // Which CAN is your battery connected to?
|
||||
.battery_double = CAN_ADDON_MCP2515, // Which CAN is your optional second battery connected to?
|
||||
.inverter = CAN_NATIVE // Which CAN is your inverter connected to? (Not needed for RS485 inverters)
|
||||
};
|
||||
|
||||
#ifdef WEBSERVER
|
||||
volatile uint8_t AccessPointEnabled = true; //Set to either true/false to enable direct wifi access point
|
||||
std::string ssid = "REPLACE_WITH_YOUR_SSID"; // Maximum of 63 characters;
|
||||
std::string password = "REPLACE_WITH_YOUR_PASSWORD"; // Minimum of 8 characters;
|
||||
const char* ssidAP = "Battery Emulator"; // Maximum of 63 characters;
|
||||
const char* passwordAP = "123456789"; // Minimum of 8 characters; set to NULL if you want the access point to be open
|
||||
const uint8_t wifi_channel = 0; // Set to 0 for automatic channel selection
|
||||
// MQTT
|
||||
#ifdef MQTT
|
||||
const char* mqtt_user = "REDACTED";
|
||||
const char* mqtt_password = "REDACTED";
|
||||
#endif // USE_MQTT
|
||||
#endif // WEBSERVER
|
||||
|
||||
/* Charger settings (Optional, when using generator charging) */
|
||||
volatile float CHARGER_SET_HV = 384; // Reasonably appropriate 4.0v per cell charging of a 96s pack
|
||||
|
@ -16,19 +39,3 @@ volatile float CHARGER_MIN_HV = 200; // Min permissible output (VDC) of cha
|
|||
volatile float CHARGER_MAX_POWER = 3300; // Max power capable of charger, as a ceiling for validating config
|
||||
volatile float CHARGER_MAX_A = 11.5; // Max current output (amps) of charger
|
||||
volatile float CHARGER_END_A = 1.0; // Current at which charging is considered complete
|
||||
|
||||
#ifdef WEBSERVER
|
||||
volatile uint8_t AccessPointEnabled = true; //Set to either true/false to enable direct wifi access point
|
||||
std::string ssid = "REPLACE_WITH_YOUR_SSID"; // Maximum of 63 characters;
|
||||
std::string password = "REPLACE_WITH_YOUR_PASSWORD"; // Minimum of 8 characters;
|
||||
const char* ssidAP = "Battery Emulator"; // Maximum of 63 characters;
|
||||
const char* passwordAP = "123456789"; // Minimum of 8 characters; set to NULL if you want the access point to be open
|
||||
const uint8_t wifi_channel = 0; // set to 0 for automatic channel selection
|
||||
|
||||
// MQTT
|
||||
#ifdef MQTT
|
||||
const char* mqtt_user = "REDACTED";
|
||||
const char* mqtt_password = "REDACTED";
|
||||
#endif // USE_MQTT
|
||||
|
||||
#endif
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue