removed RemoteDebug-Library Stuff
This commit is contained in:
parent
a446a51c07
commit
32107a45db
@ -32,14 +32,13 @@ build_flags =
|
||||
-DWIFI_AP_PASSWORD=${wifi_cred.wifi_ap_password}
|
||||
-DWIFI_AP_IP_GW=10,0,0,1
|
||||
-DATOMIC_FS_UPDATE
|
||||
;-DFEATURE_ENABLE_WIFI_CLIENT
|
||||
;-DFEATURE_ENABLE_REMOTE_DEBUG
|
||||
-DFEATURE_ENABLE_WIFI_CLIENT
|
||||
-DFEATURE_ENABLE_OLED
|
||||
-DFEATURE_ENABLE_CAN
|
||||
;-DFEATURE_ENABLE_GPS
|
||||
-DFEATURE_ENABLE_WEBSOCKETS
|
||||
-DPCB_REV=4
|
||||
-DNO_MODE_FLASH
|
||||
;-DNO_MODE_FLASH
|
||||
|
||||
;build_type = debug
|
||||
|
||||
@ -53,7 +52,6 @@ board_build.ldscript = eagle.flash.4m1m.ld
|
||||
lib_ldf_mode = deep
|
||||
lib_deps =
|
||||
olikraus/U8g2 @ ^2.28.8
|
||||
joaolopesf/RemoteDebug @ ^2.1.2
|
||||
https://github.com/FastLED/FastLED.git#3d2ab78 ;fastled/FastLED @ ^3.5.0
|
||||
sstaub/Ticker @ ^4.2.0
|
||||
coryjfowler/mcp_can @ ^1.5.0
|
||||
|
@ -2,20 +2,17 @@
|
||||
|
||||
DebugStatus_t DebuggerStatus[dbg_cntElements];
|
||||
|
||||
#ifdef FEATURE_ENABLE_REMOTE_DEBUG
|
||||
RemoteDebug Debug;
|
||||
String IpAddress2String(const IPAddress &ipAddress);
|
||||
void processCmdRemoteDebug();
|
||||
void RemoteDebug_formatCFG();
|
||||
void RemoteDebug_formatPersistence();
|
||||
void RemotDebug_printSystemInfo();
|
||||
void RemoteDebug_printWifiInfo();
|
||||
void RemoteDebug_CheckEEPOM();
|
||||
void RemoteDebug_dumpConfig();
|
||||
void RemoteDebug_dumpPersistance();
|
||||
void RemoteDebug_ShowDTCs();
|
||||
void RemoteDebug_dumpGlobals();
|
||||
#endif
|
||||
void processCmdDebug();
|
||||
void Debug_formatCFG();
|
||||
void Debug_formatPersistence();
|
||||
void Debug_printSystemInfo();
|
||||
void Debug_printWifiInfo();
|
||||
void Debug_CheckEEPOM();
|
||||
void Debug_dumpConfig();
|
||||
void Debug_dumpPersistance();
|
||||
void Debug_ShowDTCs();
|
||||
void Debug_dumpGlobals();
|
||||
|
||||
void initDebugger()
|
||||
{
|
||||
@ -23,33 +20,13 @@ void initDebugger()
|
||||
DebuggerStatus[dbg_Webui] = disabled;
|
||||
|
||||
Serial.setDebugOutput(false);
|
||||
|
||||
#ifdef FEATURE_ENABLE_REMOTE_DEBUG
|
||||
Debug.begin(globals.DeviceName);
|
||||
Debug.setResetCmdEnabled(true);
|
||||
Debug.showProfiler(false);
|
||||
Debug.showColors(true);
|
||||
Debug.setPassword(QUOTE(ADMIN_PASSWORD));
|
||||
Debug.setSerialEnabled(true);
|
||||
Debug.showDebugLevel(true);
|
||||
|
||||
Debug.setHelpProjectsCmds(helpCmd);
|
||||
Debug.setCallBackProjectCmds(&processCmdRemoteDebug);
|
||||
#endif
|
||||
}
|
||||
|
||||
void Debugger_Process()
|
||||
{
|
||||
#ifdef FEATURE_ENABLE_REMOTE_DEBUG
|
||||
Debug.handle();
|
||||
#endif
|
||||
}
|
||||
|
||||
void SetDebugportStatus(DebugPorts_t port, DebugStatus_t status)
|
||||
{
|
||||
if (status == disabled)
|
||||
Debug_pushMessage("disable DebugPort %s", sDebugPorts[port]);
|
||||
|
||||
|
||||
DebuggerStatus[port] = status;
|
||||
|
||||
if (status == enabled)
|
||||
@ -102,136 +79,133 @@ void pushCANDebug(uint32_t id, uint8_t dlc, uint8_t *data)
|
||||
}
|
||||
}
|
||||
|
||||
#ifdef FEATURE_ENABLE_REMOTE_DEBUG
|
||||
void processCmdRemoteDebug()
|
||||
void processCmdDebug(String command)
|
||||
{
|
||||
String lastCmd = Debug.getLastCommand();
|
||||
|
||||
if (lastCmd == "sysinfo")
|
||||
RemotDebug_printSystemInfo();
|
||||
else if (lastCmd == "netinfo")
|
||||
RemoteDebug_printWifiInfo();
|
||||
else if (lastCmd == "formatCFG")
|
||||
RemoteDebug_formatCFG();
|
||||
else if (lastCmd == "formatPDS")
|
||||
RemoteDebug_formatPersistence();
|
||||
else if (lastCmd == "checkEE")
|
||||
RemoteDebug_CheckEEPOM();
|
||||
else if (lastCmd == "dumpEE1k")
|
||||
if (command == "sysinfo")
|
||||
Debug_printSystemInfo();
|
||||
else if (command == "netinfo")
|
||||
Debug_printWifiInfo();
|
||||
else if (command == "formatCFG")
|
||||
Debug_formatCFG();
|
||||
else if (command == "formatPDS")
|
||||
Debug_formatPersistence();
|
||||
else if (command == "checkEE")
|
||||
Debug_CheckEEPOM();
|
||||
else if (command == "dumpEE1k")
|
||||
dumpEEPROM(0, 1024);
|
||||
else if (lastCmd == "dumpEE")
|
||||
else if (command == "dumpEE")
|
||||
dumpEEPROM(0, EEPROM_SIZE_BYTES);
|
||||
else if (lastCmd == "resetPageEE")
|
||||
else if (command == "resetPageEE")
|
||||
MovePersistencePage_EEPROM(true);
|
||||
else if (lastCmd == "dumpCFG")
|
||||
RemoteDebug_dumpConfig();
|
||||
else if (lastCmd == "dumpPDS")
|
||||
RemoteDebug_dumpPersistance();
|
||||
else if (lastCmd == "saveEE")
|
||||
else if (command == "dumpCFG")
|
||||
Debug_dumpConfig();
|
||||
else if (command == "dumpPDS")
|
||||
Debug_dumpPersistance();
|
||||
else if (command == "saveEE")
|
||||
globals.requestEEAction = EE_ALL_SAVE;
|
||||
else if (lastCmd == "showdtc")
|
||||
RemoteDebug_ShowDTCs();
|
||||
else if (lastCmd == "dumpGlobals")
|
||||
RemoteDebug_dumpGlobals();
|
||||
else if (command == "showdtc")
|
||||
Debug_ShowDTCs();
|
||||
else if (command == "dumpGlobals")
|
||||
Debug_dumpGlobals();
|
||||
}
|
||||
|
||||
void RemoteDebug_formatCFG()
|
||||
void Debug_formatCFG()
|
||||
{
|
||||
debugA("Formatting Config-EEPROM and reseting to default");
|
||||
Debug_pushMessage("Formatting Config-EEPROM and reseting to default");
|
||||
FormatConfig_EEPROM();
|
||||
}
|
||||
|
||||
void RemoteDebug_formatPersistence()
|
||||
void Debug_formatPersistence()
|
||||
{
|
||||
debugA("Formatting Persistence-EEPROM and reseting to default");
|
||||
Debug_pushMessage("Formatting Persistence-EEPROM and reseting to default");
|
||||
FormatPersistence_EEPROM();
|
||||
}
|
||||
|
||||
void RemotDebug_printSystemInfo()
|
||||
{
|
||||
debugA("Souko's ChainOiler Mk1");
|
||||
debugA("Hostname: %s", globals.DeviceName);
|
||||
Debug_pushMessage("Souko's ChainOiler Mk1");
|
||||
Debug_pushMessage("Hostname: %s", globals.DeviceName);
|
||||
|
||||
FlashMode_t ideMode = ESP.getFlashChipMode();
|
||||
debugA("Sdk version: %s", ESP.getSdkVersion());
|
||||
debugA("Core Version: %s", ESP.getCoreVersion().c_str());
|
||||
debugA("Boot Version: %u", ESP.getBootVersion());
|
||||
debugA("Boot Mode: %u", ESP.getBootMode());
|
||||
debugA("CPU Frequency: %u MHz", ESP.getCpuFreqMHz());
|
||||
debugA("Reset reason: %s", ESP.getResetReason().c_str());
|
||||
debugA("Flash Size: %d", ESP.getFlashChipRealSize());
|
||||
debugA("Flash Size IDE: %d", ESP.getFlashChipSize());
|
||||
debugA("Flash ide mode: %s", (ideMode == FM_QIO ? "QIO" : ideMode == FM_QOUT ? "QOUT"
|
||||
Debug_pushMessage("Sdk version: %s", ESP.getSdkVersion());
|
||||
Debug_pushMessage("Core Version: %s", ESP.getCoreVersion().c_str());
|
||||
Debug_pushMessage("Boot Version: %u", ESP.getBootVersion());
|
||||
Debug_pushMessage("Boot Mode: %u", ESP.getBootMode());
|
||||
Debug_pushMessage("CPU Frequency: %u MHz", ESP.getCpuFreqMHz());
|
||||
Debug_pushMessage("Reset reason: %s", ESP.getResetReason().c_str());
|
||||
Debug_pushMessage("Flash Size: %d", ESP.getFlashChipRealSize());
|
||||
Debug_pushMessage("Flash Size IDE: %d", ESP.getFlashChipSize());
|
||||
Debug_pushMessage("Flash ide mode: %s", (ideMode == FM_QIO ? "QIO" : ideMode == FM_QOUT ? "QOUT"
|
||||
: ideMode == FM_DIO ? "DIO"
|
||||
: ideMode == FM_DOUT ? "DOUT"
|
||||
: "UNKNOWN"));
|
||||
debugA("OTA-Pass: %s", QUOTE(ADMIN_PASSWORD));
|
||||
debugA("Git-Revison: %s", GIT_REV);
|
||||
debugA("Sw-Version: %s", QUOTE(SW_VERSION));
|
||||
Debug_pushMessage("OTA-Pass: %s", QUOTE(ADMIN_PASSWORD));
|
||||
Debug_pushMessage("Git-Revison: %s", GIT_REV);
|
||||
Debug_pushMessage("Sw-Version: %s", QUOTE(SW_VERSION));
|
||||
}
|
||||
|
||||
void RemoteDebug_dumpConfig()
|
||||
void Debug_dumpConfig()
|
||||
{
|
||||
debugA("DistancePerLube_Default: %d", LubeConfig.DistancePerLube_Default);
|
||||
debugA("DistancePerLube_Rain: %d", LubeConfig.DistancePerLube_Rain);
|
||||
debugA("tankCapacity_ml: %d", LubeConfig.tankCapacity_ml);
|
||||
debugA("amountPerDose_microL: %d", LubeConfig.amountPerDose_microL);
|
||||
debugA("TankRemindAtPercentage: %d", LubeConfig.TankRemindAtPercentage);
|
||||
debugA("PulsePerRevolution: %d", LubeConfig.PulsePerRevolution);
|
||||
debugA("TireWidth_mm: %d", LubeConfig.TireWidth_mm);
|
||||
debugA("TireWidthHeight_Ratio: %d", LubeConfig.TireWidth_mm);
|
||||
debugA("RimDiameter_Inch: %d", LubeConfig.RimDiameter_Inch);
|
||||
debugA("DistancePerRevolution_mm: %d", LubeConfig.DistancePerRevolution_mm);
|
||||
debugA("BleedingPulses: %d", LubeConfig.BleedingPulses);
|
||||
debugA("SpeedSource: %d", LubeConfig.SpeedSource);
|
||||
Debug_pushMessage("DistancePerLube_Default: %d", LubeConfig.DistancePerLube_Default);
|
||||
Debug_pushMessage("DistancePerLube_Rain: %d", LubeConfig.DistancePerLube_Rain);
|
||||
Debug_pushMessage("tankCapacity_ml: %d", LubeConfig.tankCapacity_ml);
|
||||
Debug_pushMessage("amountPerDose_microL: %d", LubeConfig.amountPerDose_microL);
|
||||
Debug_pushMessage("TankRemindAtPercentage: %d", LubeConfig.TankRemindAtPercentage);
|
||||
Debug_pushMessage("PulsePerRevolution: %d", LubeConfig.PulsePerRevolution);
|
||||
Debug_pushMessage("TireWidth_mm: %d", LubeConfig.TireWidth_mm);
|
||||
Debug_pushMessage("TireWidthHeight_Ratio: %d", LubeConfig.TireWidth_mm);
|
||||
Debug_pushMessage("RimDiameter_Inch: %d", LubeConfig.RimDiameter_Inch);
|
||||
Debug_pushMessage("DistancePerRevolution_mm: %d", LubeConfig.DistancePerRevolution_mm);
|
||||
Debug_pushMessage("BleedingPulses: %d", LubeConfig.BleedingPulses);
|
||||
Debug_pushMessage("SpeedSource: %d", LubeConfig.SpeedSource);
|
||||
#ifdef FEATURE_ENABLE_GPS
|
||||
debugA("GPSBaudRate: %d", LubeConfig.GPSBaudRate);
|
||||
Debug_pushMessage("GPSBaudRate: %d", LubeConfig.GPSBaudRate);
|
||||
#endif
|
||||
#ifdef FEATURE_ENABLE_CAN
|
||||
debugA("CANSource: %d", LubeConfig.CANSource);
|
||||
Debug_pushMessage("CANSource: %d", LubeConfig.CANSource);
|
||||
#endif
|
||||
debugA("checksum: 0x%08X", LubeConfig.checksum);
|
||||
Debug_pushMessage("checksum: 0x%08X", LubeConfig.checksum);
|
||||
}
|
||||
|
||||
void RemoteDebug_dumpGlobals()
|
||||
void Debug_dumpGlobals()
|
||||
{
|
||||
debugA("systemStatus: %d", globals.systemStatus);
|
||||
debugA("resumeStatus: %d", globals.resumeStatus);
|
||||
debugA("systemStatustxt: %s", globals.systemStatustxt);
|
||||
debugA("purgePulses: %d", globals.purgePulses);
|
||||
debugA("requestEEAction: %d", globals.requestEEAction);
|
||||
debugA("DeviceName: %s", globals.DeviceName);
|
||||
debugA("FlashVersion: %s", globals.FlashVersion);
|
||||
debugA("eePersistanceAdress: %d", globals.eePersistanceAdress);
|
||||
debugA("TankPercentage: %d", globals.TankPercentage);
|
||||
debugA("hasDTC: %d", globals.hasDTC);
|
||||
Debug_pushMessage("systemStatus: %d", globals.systemStatus);
|
||||
Debug_pushMessage("resumeStatus: %d", globals.resumeStatus);
|
||||
Debug_pushMessage("systemStatustxt: %s", globals.systemStatustxt);
|
||||
Debug_pushMessage("purgePulses: %d", globals.purgePulses);
|
||||
Debug_pushMessage("requestEEAction: %d", globals.requestEEAction);
|
||||
Debug_pushMessage("DeviceName: %s", globals.DeviceName);
|
||||
Debug_pushMessage("FlashVersion: %s", globals.FlashVersion);
|
||||
Debug_pushMessage("eePersistanceAdress: %d", globals.eePersistanceAdress);
|
||||
Debug_pushMessage("TankPercentage: %d", globals.TankPercentage);
|
||||
Debug_pushMessage("hasDTC: %d", globals.hasDTC);
|
||||
}
|
||||
|
||||
void RemoteDebug_dumpPersistance()
|
||||
void Debug_dumpPersistance()
|
||||
{
|
||||
debugA("writeCycleCounter: %d", PersistenceData.writeCycleCounter);
|
||||
debugA("tankRemain_microL: %d", PersistenceData.tankRemain_microL);
|
||||
debugA("TravelDistance_highRes_mm: %d", PersistenceData.TravelDistance_highRes_mm);
|
||||
debugA("checksum: %d", PersistenceData.checksum);
|
||||
debugA("PSD Adress: 0x%04X", globals.eePersistanceAdress);
|
||||
Debug_pushMessage("writeCycleCounter: %d", PersistenceData.writeCycleCounter);
|
||||
Debug_pushMessage("tankRemain_microL: %d", PersistenceData.tankRemain_microL);
|
||||
Debug_pushMessage("TravelDistance_highRes_mm: %d", PersistenceData.TravelDistance_highRes_mm);
|
||||
Debug_pushMessage("checksum: %d", PersistenceData.checksum);
|
||||
Debug_pushMessage("PSD Adress: 0x%04X", globals.eePersistanceAdress);
|
||||
}
|
||||
|
||||
void RemoteDebug_printWifiInfo()
|
||||
void Debug_printWifiInfo()
|
||||
{
|
||||
}
|
||||
|
||||
void RemoteDebug_CheckEEPOM()
|
||||
void Debug_CheckEEPOM()
|
||||
{
|
||||
uint32_t checksum = PersistenceData.checksum;
|
||||
PersistenceData.checksum = 0;
|
||||
|
||||
if (Checksum_EEPROM((uint8_t *)&PersistenceData, sizeof(PersistenceData)) == checksum)
|
||||
{
|
||||
debugA("PersistenceData EEPROM Checksum OK\n");
|
||||
Debug_pushMessage("PersistenceData EEPROM Checksum OK\n");
|
||||
}
|
||||
else
|
||||
{
|
||||
debugA("PersistenceData EEPROM Checksum BAD\n");
|
||||
Debug_pushMessage("PersistenceData EEPROM Checksum BAD\n");
|
||||
}
|
||||
|
||||
PersistenceData.checksum = checksum;
|
||||
@ -241,16 +215,16 @@ void RemoteDebug_CheckEEPOM()
|
||||
|
||||
if (Checksum_EEPROM((uint8_t *)&LubeConfig, sizeof(LubeConfig)) == checksum)
|
||||
{
|
||||
debugA("LubeConfig EEPROM Checksum OK\n");
|
||||
Debug_pushMessage("LubeConfig EEPROM Checksum OK\n");
|
||||
}
|
||||
else
|
||||
{
|
||||
debugA("LubeConfig EEPROM Checksum BAD\n");
|
||||
Debug_pushMessage("LubeConfig EEPROM Checksum BAD\n");
|
||||
}
|
||||
LubeConfig.checksum = checksum;
|
||||
}
|
||||
|
||||
void RemoteDebug_ShowDTCs()
|
||||
void Debug_ShowDTCs()
|
||||
{
|
||||
char buff_timestamp[16]; // Format: DD-hh:mm:ss:xxx
|
||||
char buff_active[9];
|
||||
@ -273,8 +247,7 @@ void RemoteDebug_ShowDTCs()
|
||||
else
|
||||
strcpy(buff_active, "none");
|
||||
|
||||
debugA("%s \t %6d \t %s", buff_timestamp, DTCStorage[i].Number, buff_active);
|
||||
Debug_pushMessage("%s \t %6d \t %s", buff_timestamp, DTCStorage[i].Number, buff_active);
|
||||
}
|
||||
}
|
||||
}
|
||||
#endif
|
||||
}
|
@ -4,31 +4,40 @@
|
||||
#include <Arduino.h>
|
||||
#include "webui.h"
|
||||
|
||||
#ifdef FEATURE_ENABLE_REMOTE_DEBUG
|
||||
#include <RemoteDebug.h>
|
||||
#include "rmtdbghelp.h"
|
||||
#endif
|
||||
const char helpCmd[] = "sysinfo - System Info\r\n"
|
||||
"netinfo - WiFi Info\r\n"
|
||||
"formatPDS - Format Persistence EEPROM Data\r\n"
|
||||
"formatCFG - Format Configuration EEPROM Data\r\n"
|
||||
"checkEE - Check EEPROM with checksum\r\n"
|
||||
"dumpEE1k - dump the first 1kb of EEPROM to Serial\r\n"
|
||||
"dumpEE - dump the whole EPPROM to Serial\r\n"
|
||||
"resetPageEE - Reset the PersistenceData Page\r\n"
|
||||
"dumpCFG - print Config struct\r\n"
|
||||
"dumpPDS - print PersistanceStruct\r\n"
|
||||
"saveEE - save EE-Data\r\n"
|
||||
"showdtc - Show all DTCs\r\n"
|
||||
"dumpGlobals - print globals\r\n";
|
||||
|
||||
typedef enum DebugStatus_e{
|
||||
enabled,
|
||||
disabled
|
||||
}DebugStatus_t;
|
||||
typedef enum DebugStatus_e
|
||||
{
|
||||
disabled,
|
||||
enabled
|
||||
} DebugStatus_t;
|
||||
|
||||
typedef enum DebugPorts_e{
|
||||
typedef enum DebugPorts_e
|
||||
{
|
||||
dbg_Serial,
|
||||
dbg_Webui,
|
||||
dbg_cntElements
|
||||
}DebugPorts_t;
|
||||
} DebugPorts_t;
|
||||
|
||||
const char sDebugPorts[dbg_cntElements][7] = {
|
||||
"Serial",
|
||||
"WebUI"
|
||||
};
|
||||
"WebUI"};
|
||||
|
||||
extern DebugStatus_t DebuggerStatus[dbg_cntElements];
|
||||
|
||||
void initDebugger();
|
||||
void Debugger_Process();
|
||||
void pushCANDebug(uint32_t id, uint8_t dlc, uint8_t *data);
|
||||
void Debug_pushMessage(const char *format, ...);
|
||||
void SetDebugportStatus(DebugPorts_t port, DebugStatus_t status);
|
||||
|
@ -193,7 +193,6 @@ void loop()
|
||||
LED_Process();
|
||||
EEPROM_Process();
|
||||
Webserver_Process();
|
||||
Debugger_Process();
|
||||
|
||||
ArduinoOTA.handle();
|
||||
|
||||
|
@ -1,13 +0,0 @@
|
||||
const char helpCmd[] = "sysinfo - System Info\r\n"
|
||||
"netinfo - WiFi Info\r\n"
|
||||
"formatPDS - Format Persistence EEPROM Data\r\n"
|
||||
"formatCFG - Format Configuration EEPROM Data\r\n"
|
||||
"checkEE - Check EEPROM with checksum\r\n"
|
||||
"dumpEE1k - dump the first 1kb of EEPROM to Serial\r\n"
|
||||
"dumpEE - dump the whole EPPROM to Serial\r\n"
|
||||
"resetPageEE - Reset the PersistenceData Page\r\n"
|
||||
"dumpCFG - print Config struct\r\n"
|
||||
"dumpPDS - print PersistanceStruct\r\n"
|
||||
"saveEE - save EE-Data\r\n"
|
||||
"showdtc - Show all DTCs\r\n"
|
||||
"dumpGlobals - print globals\r\n";
|
@ -39,7 +39,6 @@ void initWebUI()
|
||||
}
|
||||
|
||||
MDNS.begin(globals.DeviceName);
|
||||
MDNS.addService("telnet", "tcp", 23);
|
||||
MDNS.addService("http", "tcp", 80);
|
||||
|
||||
#ifdef FEATURE_ENABLE_WEBSOCKETS
|
||||
|
Loading…
x
Reference in New Issue
Block a user