Compare commits
9 Commits
a446a51c07
...
Firmware_1
Author | SHA1 | Date | |
---|---|---|---|
367a41527d | |||
5460a70f6d | |||
3b4a22bff7 | |||
df209a788b | |||
a6031798da | |||
00cba7b5ac | |||
034b6c918b | |||
3af678f3f8 | |||
32107a45db |
BIN
Case/up to PCB Rev 4/Case_V1_Bottom.stl
Normal file
BIN
Case/up to PCB Rev 4/Case_V1_Bottom.stl
Normal file
Binary file not shown.
BIN
Case/up to PCB Rev 4/Case_V1_Lid.stl
Normal file
BIN
Case/up to PCB Rev 4/Case_V1_Lid.stl
Normal file
Binary file not shown.
BIN
Case/up to PCB Rev 4/Case_V1_Lid_Display.stl
Normal file
BIN
Case/up to PCB Rev 4/Case_V1_Lid_Display.stl
Normal file
Binary file not shown.
@@ -32,14 +32,13 @@ build_flags =
|
|||||||
-DWIFI_AP_PASSWORD=${wifi_cred.wifi_ap_password}
|
-DWIFI_AP_PASSWORD=${wifi_cred.wifi_ap_password}
|
||||||
-DWIFI_AP_IP_GW=10,0,0,1
|
-DWIFI_AP_IP_GW=10,0,0,1
|
||||||
-DATOMIC_FS_UPDATE
|
-DATOMIC_FS_UPDATE
|
||||||
;-DFEATURE_ENABLE_WIFI_CLIENT
|
-DFEATURE_ENABLE_WIFI_CLIENT
|
||||||
;-DFEATURE_ENABLE_REMOTE_DEBUG
|
|
||||||
-DFEATURE_ENABLE_OLED
|
-DFEATURE_ENABLE_OLED
|
||||||
-DFEATURE_ENABLE_CAN
|
-DFEATURE_ENABLE_CAN
|
||||||
;-DFEATURE_ENABLE_GPS
|
;-DFEATURE_ENABLE_GPS
|
||||||
-DFEATURE_ENABLE_WEBSOCKETS
|
-DFEATURE_ENABLE_WEBSOCKETS
|
||||||
-DPCB_REV=4
|
-DPCB_REV=4
|
||||||
-DNO_MODE_FLASH
|
;-DNO_MODE_FLASH
|
||||||
|
|
||||||
;build_type = debug
|
;build_type = debug
|
||||||
|
|
||||||
@@ -53,7 +52,6 @@ board_build.ldscript = eagle.flash.4m1m.ld
|
|||||||
lib_ldf_mode = deep
|
lib_ldf_mode = deep
|
||||||
lib_deps =
|
lib_deps =
|
||||||
olikraus/U8g2 @ ^2.28.8
|
olikraus/U8g2 @ ^2.28.8
|
||||||
joaolopesf/RemoteDebug @ ^2.1.2
|
|
||||||
https://github.com/FastLED/FastLED.git#3d2ab78 ;fastled/FastLED @ ^3.5.0
|
https://github.com/FastLED/FastLED.git#3d2ab78 ;fastled/FastLED @ ^3.5.0
|
||||||
sstaub/Ticker @ ^4.2.0
|
sstaub/Ticker @ ^4.2.0
|
||||||
coryjfowler/mcp_can @ ^1.5.0
|
coryjfowler/mcp_can @ ^1.5.0
|
||||||
|
@@ -26,8 +26,8 @@
|
|||||||
#define HOST_NAME "ChainLube_%06X" // Use printf-Formatting - Chip-ID (uin32_t) will be added
|
#define HOST_NAME "ChainLube_%06X" // Use printf-Formatting - Chip-ID (uin32_t) will be added
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#define SW_VERSION 1.3
|
#define SW_VERSION 1.4
|
||||||
#define FLASH_FS_VERSION 1.3
|
#define FLASH_FS_VERSION 1.4
|
||||||
|
|
||||||
#ifndef OTA_DELAY
|
#ifndef OTA_DELAY
|
||||||
#define OTA_DELAY 50 // ticks -> 10ms / tick
|
#define OTA_DELAY 50 // ticks -> 10ms / tick
|
||||||
|
@@ -243,7 +243,6 @@ boolean checkEEPROMavailable()
|
|||||||
if (!ee.isConnected())
|
if (!ee.isConnected())
|
||||||
{
|
{
|
||||||
MaintainDTC(DTC_NO_EEPROM_FOUND, DTC_CRITICAL, true);
|
MaintainDTC(DTC_NO_EEPROM_FOUND, DTC_CRITICAL, true);
|
||||||
globals.systemStatus = sysStat_Error;
|
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
MaintainDTC(DTC_NO_EEPROM_FOUND, DTC_CRITICAL, false);
|
MaintainDTC(DTC_NO_EEPROM_FOUND, DTC_CRITICAL, false);
|
||||||
|
@@ -8,7 +8,11 @@
|
|||||||
#include "dtc.h"
|
#include "dtc.h"
|
||||||
#include "common.h"
|
#include "common.h"
|
||||||
|
|
||||||
|
#if PCB_REV == 1 || PCB_REV == 2 || PCB_REV == 3
|
||||||
|
#define EEPROM_SIZE_BYTES I2C_DEVICESIZE_24LC64
|
||||||
|
#elif PCB_REV == 4
|
||||||
#define EEPROM_SIZE_BYTES I2C_DEVICESIZE_24LC256
|
#define EEPROM_SIZE_BYTES I2C_DEVICESIZE_24LC256
|
||||||
|
#endif
|
||||||
|
|
||||||
typedef enum SpeedSource_e
|
typedef enum SpeedSource_e
|
||||||
{
|
{
|
||||||
|
@@ -2,20 +2,17 @@
|
|||||||
|
|
||||||
DebugStatus_t DebuggerStatus[dbg_cntElements];
|
DebugStatus_t DebuggerStatus[dbg_cntElements];
|
||||||
|
|
||||||
#ifdef FEATURE_ENABLE_REMOTE_DEBUG
|
|
||||||
RemoteDebug Debug;
|
|
||||||
String IpAddress2String(const IPAddress &ipAddress);
|
String IpAddress2String(const IPAddress &ipAddress);
|
||||||
void processCmdRemoteDebug();
|
void processCmdDebug();
|
||||||
void RemoteDebug_formatCFG();
|
void Debug_formatCFG();
|
||||||
void RemoteDebug_formatPersistence();
|
void Debug_formatPersistence();
|
||||||
void RemotDebug_printSystemInfo();
|
void Debug_printSystemInfo();
|
||||||
void RemoteDebug_printWifiInfo();
|
void Debug_printWifiInfo();
|
||||||
void RemoteDebug_CheckEEPOM();
|
void Debug_CheckEEPOM();
|
||||||
void RemoteDebug_dumpConfig();
|
void Debug_dumpConfig();
|
||||||
void RemoteDebug_dumpPersistance();
|
void Debug_dumpPersistance();
|
||||||
void RemoteDebug_ShowDTCs();
|
void Debug_ShowDTCs();
|
||||||
void RemoteDebug_dumpGlobals();
|
void Debug_dumpGlobals();
|
||||||
#endif
|
|
||||||
|
|
||||||
void initDebugger()
|
void initDebugger()
|
||||||
{
|
{
|
||||||
@@ -23,26 +20,6 @@ void initDebugger()
|
|||||||
DebuggerStatus[dbg_Webui] = disabled;
|
DebuggerStatus[dbg_Webui] = disabled;
|
||||||
|
|
||||||
Serial.setDebugOutput(false);
|
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)
|
void SetDebugportStatus(DebugPorts_t port, DebugStatus_t status)
|
||||||
@@ -102,136 +79,133 @@ void pushCANDebug(uint32_t id, uint8_t dlc, uint8_t *data)
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
#ifdef FEATURE_ENABLE_REMOTE_DEBUG
|
void processCmdDebug(String command)
|
||||||
void processCmdRemoteDebug()
|
|
||||||
{
|
{
|
||||||
String lastCmd = Debug.getLastCommand();
|
if (command == "sysinfo")
|
||||||
|
Debug_printSystemInfo();
|
||||||
if (lastCmd == "sysinfo")
|
else if (command == "netinfo")
|
||||||
RemotDebug_printSystemInfo();
|
Debug_printWifiInfo();
|
||||||
else if (lastCmd == "netinfo")
|
else if (command == "formatCFG")
|
||||||
RemoteDebug_printWifiInfo();
|
Debug_formatCFG();
|
||||||
else if (lastCmd == "formatCFG")
|
else if (command == "formatPDS")
|
||||||
RemoteDebug_formatCFG();
|
Debug_formatPersistence();
|
||||||
else if (lastCmd == "formatPDS")
|
else if (command == "checkEE")
|
||||||
RemoteDebug_formatPersistence();
|
Debug_CheckEEPOM();
|
||||||
else if (lastCmd == "checkEE")
|
else if (command == "dumpEE1k")
|
||||||
RemoteDebug_CheckEEPOM();
|
|
||||||
else if (lastCmd == "dumpEE1k")
|
|
||||||
dumpEEPROM(0, 1024);
|
dumpEEPROM(0, 1024);
|
||||||
else if (lastCmd == "dumpEE")
|
else if (command == "dumpEE")
|
||||||
dumpEEPROM(0, EEPROM_SIZE_BYTES);
|
dumpEEPROM(0, EEPROM_SIZE_BYTES);
|
||||||
else if (lastCmd == "resetPageEE")
|
else if (command == "resetPageEE")
|
||||||
MovePersistencePage_EEPROM(true);
|
MovePersistencePage_EEPROM(true);
|
||||||
else if (lastCmd == "dumpCFG")
|
else if (command == "dumpCFG")
|
||||||
RemoteDebug_dumpConfig();
|
Debug_dumpConfig();
|
||||||
else if (lastCmd == "dumpPDS")
|
else if (command == "dumpPDS")
|
||||||
RemoteDebug_dumpPersistance();
|
Debug_dumpPersistance();
|
||||||
else if (lastCmd == "saveEE")
|
else if (command == "saveEE")
|
||||||
globals.requestEEAction = EE_ALL_SAVE;
|
globals.requestEEAction = EE_ALL_SAVE;
|
||||||
else if (lastCmd == "showdtc")
|
else if (command == "showdtc")
|
||||||
RemoteDebug_ShowDTCs();
|
Debug_ShowDTCs();
|
||||||
else if (lastCmd == "dumpGlobals")
|
else if (command == "dumpGlobals")
|
||||||
RemoteDebug_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();
|
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();
|
FormatPersistence_EEPROM();
|
||||||
}
|
}
|
||||||
|
|
||||||
void RemotDebug_printSystemInfo()
|
void RemotDebug_printSystemInfo()
|
||||||
{
|
{
|
||||||
debugA("Souko's ChainOiler Mk1");
|
Debug_pushMessage("Souko's ChainOiler Mk1");
|
||||||
debugA("Hostname: %s", globals.DeviceName);
|
Debug_pushMessage("Hostname: %s", globals.DeviceName);
|
||||||
|
|
||||||
FlashMode_t ideMode = ESP.getFlashChipMode();
|
FlashMode_t ideMode = ESP.getFlashChipMode();
|
||||||
debugA("Sdk version: %s", ESP.getSdkVersion());
|
Debug_pushMessage("Sdk version: %s", ESP.getSdkVersion());
|
||||||
debugA("Core Version: %s", ESP.getCoreVersion().c_str());
|
Debug_pushMessage("Core Version: %s", ESP.getCoreVersion().c_str());
|
||||||
debugA("Boot Version: %u", ESP.getBootVersion());
|
Debug_pushMessage("Boot Version: %u", ESP.getBootVersion());
|
||||||
debugA("Boot Mode: %u", ESP.getBootMode());
|
Debug_pushMessage("Boot Mode: %u", ESP.getBootMode());
|
||||||
debugA("CPU Frequency: %u MHz", ESP.getCpuFreqMHz());
|
Debug_pushMessage("CPU Frequency: %u MHz", ESP.getCpuFreqMHz());
|
||||||
debugA("Reset reason: %s", ESP.getResetReason().c_str());
|
Debug_pushMessage("Reset reason: %s", ESP.getResetReason().c_str());
|
||||||
debugA("Flash Size: %d", ESP.getFlashChipRealSize());
|
Debug_pushMessage("Flash Size: %d", ESP.getFlashChipRealSize());
|
||||||
debugA("Flash Size IDE: %d", ESP.getFlashChipSize());
|
Debug_pushMessage("Flash Size IDE: %d", ESP.getFlashChipSize());
|
||||||
debugA("Flash ide mode: %s", (ideMode == FM_QIO ? "QIO" : ideMode == FM_QOUT ? "QOUT"
|
Debug_pushMessage("Flash ide mode: %s", (ideMode == FM_QIO ? "QIO" : ideMode == FM_QOUT ? "QOUT"
|
||||||
: ideMode == FM_DIO ? "DIO"
|
: ideMode == FM_DIO ? "DIO"
|
||||||
: ideMode == FM_DOUT ? "DOUT"
|
: ideMode == FM_DOUT ? "DOUT"
|
||||||
: "UNKNOWN"));
|
: "UNKNOWN"));
|
||||||
debugA("OTA-Pass: %s", QUOTE(ADMIN_PASSWORD));
|
Debug_pushMessage("OTA-Pass: %s", QUOTE(ADMIN_PASSWORD));
|
||||||
debugA("Git-Revison: %s", GIT_REV);
|
Debug_pushMessage("Git-Revison: %s", GIT_REV);
|
||||||
debugA("Sw-Version: %s", QUOTE(SW_VERSION));
|
Debug_pushMessage("Sw-Version: %s", QUOTE(SW_VERSION));
|
||||||
}
|
}
|
||||||
|
|
||||||
void RemoteDebug_dumpConfig()
|
void Debug_dumpConfig()
|
||||||
{
|
{
|
||||||
debugA("DistancePerLube_Default: %d", LubeConfig.DistancePerLube_Default);
|
Debug_pushMessage("DistancePerLube_Default: %d", LubeConfig.DistancePerLube_Default);
|
||||||
debugA("DistancePerLube_Rain: %d", LubeConfig.DistancePerLube_Rain);
|
Debug_pushMessage("DistancePerLube_Rain: %d", LubeConfig.DistancePerLube_Rain);
|
||||||
debugA("tankCapacity_ml: %d", LubeConfig.tankCapacity_ml);
|
Debug_pushMessage("tankCapacity_ml: %d", LubeConfig.tankCapacity_ml);
|
||||||
debugA("amountPerDose_microL: %d", LubeConfig.amountPerDose_microL);
|
Debug_pushMessage("amountPerDose_microL: %d", LubeConfig.amountPerDose_microL);
|
||||||
debugA("TankRemindAtPercentage: %d", LubeConfig.TankRemindAtPercentage);
|
Debug_pushMessage("TankRemindAtPercentage: %d", LubeConfig.TankRemindAtPercentage);
|
||||||
debugA("PulsePerRevolution: %d", LubeConfig.PulsePerRevolution);
|
Debug_pushMessage("PulsePerRevolution: %d", LubeConfig.PulsePerRevolution);
|
||||||
debugA("TireWidth_mm: %d", LubeConfig.TireWidth_mm);
|
Debug_pushMessage("TireWidth_mm: %d", LubeConfig.TireWidth_mm);
|
||||||
debugA("TireWidthHeight_Ratio: %d", LubeConfig.TireWidth_mm);
|
Debug_pushMessage("TireWidthHeight_Ratio: %d", LubeConfig.TireWidth_mm);
|
||||||
debugA("RimDiameter_Inch: %d", LubeConfig.RimDiameter_Inch);
|
Debug_pushMessage("RimDiameter_Inch: %d", LubeConfig.RimDiameter_Inch);
|
||||||
debugA("DistancePerRevolution_mm: %d", LubeConfig.DistancePerRevolution_mm);
|
Debug_pushMessage("DistancePerRevolution_mm: %d", LubeConfig.DistancePerRevolution_mm);
|
||||||
debugA("BleedingPulses: %d", LubeConfig.BleedingPulses);
|
Debug_pushMessage("BleedingPulses: %d", LubeConfig.BleedingPulses);
|
||||||
debugA("SpeedSource: %d", LubeConfig.SpeedSource);
|
Debug_pushMessage("SpeedSource: %d", LubeConfig.SpeedSource);
|
||||||
#ifdef FEATURE_ENABLE_GPS
|
#ifdef FEATURE_ENABLE_GPS
|
||||||
debugA("GPSBaudRate: %d", LubeConfig.GPSBaudRate);
|
Debug_pushMessage("GPSBaudRate: %d", LubeConfig.GPSBaudRate);
|
||||||
#endif
|
#endif
|
||||||
#ifdef FEATURE_ENABLE_CAN
|
#ifdef FEATURE_ENABLE_CAN
|
||||||
debugA("CANSource: %d", LubeConfig.CANSource);
|
Debug_pushMessage("CANSource: %d", LubeConfig.CANSource);
|
||||||
#endif
|
#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);
|
Debug_pushMessage("systemStatus: %d", globals.systemStatus);
|
||||||
debugA("resumeStatus: %d", globals.resumeStatus);
|
Debug_pushMessage("resumeStatus: %d", globals.resumeStatus);
|
||||||
debugA("systemStatustxt: %s", globals.systemStatustxt);
|
Debug_pushMessage("systemStatustxt: %s", globals.systemStatustxt);
|
||||||
debugA("purgePulses: %d", globals.purgePulses);
|
Debug_pushMessage("purgePulses: %d", globals.purgePulses);
|
||||||
debugA("requestEEAction: %d", globals.requestEEAction);
|
Debug_pushMessage("requestEEAction: %d", globals.requestEEAction);
|
||||||
debugA("DeviceName: %s", globals.DeviceName);
|
Debug_pushMessage("DeviceName: %s", globals.DeviceName);
|
||||||
debugA("FlashVersion: %s", globals.FlashVersion);
|
Debug_pushMessage("FlashVersion: %s", globals.FlashVersion);
|
||||||
debugA("eePersistanceAdress: %d", globals.eePersistanceAdress);
|
Debug_pushMessage("eePersistanceAdress: %d", globals.eePersistanceAdress);
|
||||||
debugA("TankPercentage: %d", globals.TankPercentage);
|
Debug_pushMessage("TankPercentage: %d", globals.TankPercentage);
|
||||||
debugA("hasDTC: %d", globals.hasDTC);
|
Debug_pushMessage("hasDTC: %d", globals.hasDTC);
|
||||||
}
|
}
|
||||||
|
|
||||||
void RemoteDebug_dumpPersistance()
|
void Debug_dumpPersistance()
|
||||||
{
|
{
|
||||||
debugA("writeCycleCounter: %d", PersistenceData.writeCycleCounter);
|
Debug_pushMessage("writeCycleCounter: %d", PersistenceData.writeCycleCounter);
|
||||||
debugA("tankRemain_microL: %d", PersistenceData.tankRemain_microL);
|
Debug_pushMessage("tankRemain_microL: %d", PersistenceData.tankRemain_microL);
|
||||||
debugA("TravelDistance_highRes_mm: %d", PersistenceData.TravelDistance_highRes_mm);
|
Debug_pushMessage("TravelDistance_highRes_mm: %d", PersistenceData.TravelDistance_highRes_mm);
|
||||||
debugA("checksum: %d", PersistenceData.checksum);
|
Debug_pushMessage("checksum: %d", PersistenceData.checksum);
|
||||||
debugA("PSD Adress: 0x%04X", globals.eePersistanceAdress);
|
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;
|
uint32_t checksum = PersistenceData.checksum;
|
||||||
PersistenceData.checksum = 0;
|
PersistenceData.checksum = 0;
|
||||||
|
|
||||||
if (Checksum_EEPROM((uint8_t *)&PersistenceData, sizeof(PersistenceData)) == checksum)
|
if (Checksum_EEPROM((uint8_t *)&PersistenceData, sizeof(PersistenceData)) == checksum)
|
||||||
{
|
{
|
||||||
debugA("PersistenceData EEPROM Checksum OK\n");
|
Debug_pushMessage("PersistenceData EEPROM Checksum OK\n");
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
debugA("PersistenceData EEPROM Checksum BAD\n");
|
Debug_pushMessage("PersistenceData EEPROM Checksum BAD\n");
|
||||||
}
|
}
|
||||||
|
|
||||||
PersistenceData.checksum = checksum;
|
PersistenceData.checksum = checksum;
|
||||||
@@ -241,16 +215,16 @@ void RemoteDebug_CheckEEPOM()
|
|||||||
|
|
||||||
if (Checksum_EEPROM((uint8_t *)&LubeConfig, sizeof(LubeConfig)) == checksum)
|
if (Checksum_EEPROM((uint8_t *)&LubeConfig, sizeof(LubeConfig)) == checksum)
|
||||||
{
|
{
|
||||||
debugA("LubeConfig EEPROM Checksum OK\n");
|
Debug_pushMessage("LubeConfig EEPROM Checksum OK\n");
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
debugA("LubeConfig EEPROM Checksum BAD\n");
|
Debug_pushMessage("LubeConfig EEPROM Checksum BAD\n");
|
||||||
}
|
}
|
||||||
LubeConfig.checksum = checksum;
|
LubeConfig.checksum = checksum;
|
||||||
}
|
}
|
||||||
|
|
||||||
void RemoteDebug_ShowDTCs()
|
void Debug_ShowDTCs()
|
||||||
{
|
{
|
||||||
char buff_timestamp[16]; // Format: DD-hh:mm:ss:xxx
|
char buff_timestamp[16]; // Format: DD-hh:mm:ss:xxx
|
||||||
char buff_active[9];
|
char buff_active[9];
|
||||||
@@ -273,8 +247,7 @@ void RemoteDebug_ShowDTCs()
|
|||||||
else
|
else
|
||||||
strcpy(buff_active, "none");
|
strcpy(buff_active, "none");
|
||||||
|
|
||||||
debugA("%s \t %6d \t %s", buff_timestamp, DTCStorage[i].Number, buff_active);
|
Debug_pushMessage("%s \t %6d \t %s \t %d", buff_timestamp, DTCStorage[i].Number, buff_active, DTCStorage[i].severity);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
#endif
|
|
@@ -4,17 +4,28 @@
|
|||||||
#include <Arduino.h>
|
#include <Arduino.h>
|
||||||
#include "webui.h"
|
#include "webui.h"
|
||||||
|
|
||||||
#ifdef FEATURE_ENABLE_REMOTE_DEBUG
|
const char helpCmd[] = "sysinfo - System Info\r\n"
|
||||||
#include <RemoteDebug.h>
|
"netinfo - WiFi Info\r\n"
|
||||||
#include "rmtdbghelp.h"
|
"formatPDS - Format Persistence EEPROM Data\r\n"
|
||||||
#endif
|
"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{
|
typedef enum DebugStatus_e
|
||||||
enabled,
|
{
|
||||||
disabled
|
disabled,
|
||||||
|
enabled
|
||||||
} DebugStatus_t;
|
} DebugStatus_t;
|
||||||
|
|
||||||
typedef enum DebugPorts_e{
|
typedef enum DebugPorts_e
|
||||||
|
{
|
||||||
dbg_Serial,
|
dbg_Serial,
|
||||||
dbg_Webui,
|
dbg_Webui,
|
||||||
dbg_cntElements
|
dbg_cntElements
|
||||||
@@ -22,13 +33,11 @@ typedef enum DebugPorts_e{
|
|||||||
|
|
||||||
const char sDebugPorts[dbg_cntElements][7] = {
|
const char sDebugPorts[dbg_cntElements][7] = {
|
||||||
"Serial",
|
"Serial",
|
||||||
"WebUI"
|
"WebUI"};
|
||||||
};
|
|
||||||
|
|
||||||
extern DebugStatus_t DebuggerStatus[dbg_cntElements];
|
extern DebugStatus_t DebuggerStatus[dbg_cntElements];
|
||||||
|
|
||||||
void initDebugger();
|
void initDebugger();
|
||||||
void Debugger_Process();
|
|
||||||
void pushCANDebug(uint32_t id, uint8_t dlc, uint8_t *data);
|
void pushCANDebug(uint32_t id, uint8_t dlc, uint8_t *data);
|
||||||
void Debug_pushMessage(const char *format, ...);
|
void Debug_pushMessage(const char *format, ...);
|
||||||
void SetDebugportStatus(DebugPorts_t port, DebugStatus_t status);
|
void SetDebugportStatus(DebugPorts_t port, DebugStatus_t status);
|
||||||
|
@@ -39,6 +39,7 @@ void MaintainDTC(DTCNums_t DTC_no, DTCSeverity_t DTC_severity, boolean active, u
|
|||||||
DTCStorage[i].timestamp = millis();
|
DTCStorage[i].timestamp = millis();
|
||||||
DTCStorage[i].active = DTC_ACTIVE;
|
DTCStorage[i].active = DTC_ACTIVE;
|
||||||
DTCStorage[i].debugVal = DebugValue;
|
DTCStorage[i].debugVal = DebugValue;
|
||||||
|
DTCStorage[i].severity = DTC_severity;
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -107,3 +108,32 @@ DTCNums_t getlastDTC_Severity(boolean only_active, DTCSeverity_t severity)
|
|||||||
|
|
||||||
return pointer >= 0 ? DTCStorage[pointer].Number : DTC_LAST_DTC;
|
return pointer >= 0 ? DTCStorage[pointer].Number : DTC_LAST_DTC;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void DTC_Process()
|
||||||
|
{
|
||||||
|
static tSystem_Status preserverSysStatusError;
|
||||||
|
|
||||||
|
if (getlastDTC(false) < DTC_LAST_DTC)
|
||||||
|
{
|
||||||
|
globals.hasDTC = true;
|
||||||
|
if (getlastDTC_Severity(true, DTC_CRITICAL) < DTC_LAST_DTC)
|
||||||
|
{
|
||||||
|
if (globals.systemStatus != sysStat_Error)
|
||||||
|
{
|
||||||
|
preserverSysStatusError = globals.systemStatus;
|
||||||
|
}
|
||||||
|
globals.systemStatus = sysStat_Error;
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
if (globals.systemStatus == sysStat_Error)
|
||||||
|
{
|
||||||
|
globals.systemStatus = preserverSysStatusError;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
globals.hasDTC = false;
|
||||||
|
}
|
||||||
|
}
|
@@ -55,6 +55,7 @@ void ClearDTC(DTCNums_t DTC_no);
|
|||||||
void ClearAllDTC();
|
void ClearAllDTC();
|
||||||
DTCNums_t getlastDTC(boolean only_active);
|
DTCNums_t getlastDTC(boolean only_active);
|
||||||
DTCNums_t getlastDTC_Severity(boolean only_active, DTCSeverity_t severity);
|
DTCNums_t getlastDTC_Severity(boolean only_active, DTCSeverity_t severity);
|
||||||
|
void DTC_Process();
|
||||||
|
|
||||||
extern DTCEntry_s DTCStorage[MAX_DTC_STORAGE];
|
extern DTCEntry_s DTCStorage[MAX_DTC_STORAGE];
|
||||||
#endif
|
#endif
|
@@ -10,32 +10,6 @@ void RunLubeApp(uint32_t add_milimeters)
|
|||||||
MaintainDTC(DTC_TANK_EMPTY, DTC_CRITICAL, (PersistenceData.tankRemain_microL < LubeConfig.amountPerDose_microL));
|
MaintainDTC(DTC_TANK_EMPTY, DTC_CRITICAL, (PersistenceData.tankRemain_microL < LubeConfig.amountPerDose_microL));
|
||||||
MaintainDTC(DTC_TANK_LOW, DTC_WARN, (globals.TankPercentage < LubeConfig.TankRemindAtPercentage));
|
MaintainDTC(DTC_TANK_LOW, DTC_WARN, (globals.TankPercentage < LubeConfig.TankRemindAtPercentage));
|
||||||
|
|
||||||
static tSystem_Status preserverSysStatusError;
|
|
||||||
|
|
||||||
if (getlastDTC(false) < DTC_LAST_DTC)
|
|
||||||
{
|
|
||||||
globals.hasDTC = true;
|
|
||||||
if (getlastDTC_Severity(true, DTC_CRITICAL) < DTC_LAST_DTC)
|
|
||||||
{
|
|
||||||
if (globals.systemStatus != sysStat_Error)
|
|
||||||
{
|
|
||||||
preserverSysStatusError = globals.systemStatus;
|
|
||||||
}
|
|
||||||
globals.systemStatus = sysStat_Error;
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
if (globals.systemStatus == sysStat_Error)
|
|
||||||
{
|
|
||||||
globals.systemStatus = preserverSysStatusError;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
globals.hasDTC = false;
|
|
||||||
}
|
|
||||||
|
|
||||||
// Add traveled Distance in mm
|
// Add traveled Distance in mm
|
||||||
PersistenceData.TravelDistance_highRes_mm += add_milimeters;
|
PersistenceData.TravelDistance_highRes_mm += add_milimeters;
|
||||||
PersistenceData.odometer_mm += add_milimeters;
|
PersistenceData.odometer_mm += add_milimeters;
|
||||||
|
@@ -185,7 +185,6 @@ void loop()
|
|||||||
}
|
}
|
||||||
|
|
||||||
RunLubeApp(wheelDistance);
|
RunLubeApp(wheelDistance);
|
||||||
EEPROMCyclicPDSTicker.update();
|
|
||||||
#ifdef FEATURE_ENABLE_OLED
|
#ifdef FEATURE_ENABLE_OLED
|
||||||
Display_Process();
|
Display_Process();
|
||||||
#endif
|
#endif
|
||||||
@@ -193,10 +192,10 @@ void loop()
|
|||||||
LED_Process();
|
LED_Process();
|
||||||
EEPROM_Process();
|
EEPROM_Process();
|
||||||
Webserver_Process();
|
Webserver_Process();
|
||||||
Debugger_Process();
|
DTC_Process();
|
||||||
|
|
||||||
ArduinoOTA.handle();
|
ArduinoOTA.handle();
|
||||||
|
EEPROMCyclicPDSTicker.update();
|
||||||
#ifdef FEATURE_ENABLE_WIFI_CLIENT
|
#ifdef FEATURE_ENABLE_WIFI_CLIENT
|
||||||
WiFiMaintainConnectionTicker.update();
|
WiFiMaintainConnectionTicker.update();
|
||||||
#endif
|
#endif
|
||||||
|
@@ -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.begin(globals.DeviceName);
|
||||||
MDNS.addService("telnet", "tcp", 23);
|
|
||||||
MDNS.addService("http", "tcp", 80);
|
MDNS.addService("http", "tcp", 80);
|
||||||
|
|
||||||
#ifdef FEATURE_ENABLE_WEBSOCKETS
|
#ifdef FEATURE_ENABLE_WEBSOCKETS
|
||||||
@@ -257,7 +256,7 @@ void WebserverPOST_Callback(AsyncWebServerRequest *request)
|
|||||||
{
|
{
|
||||||
request->send(LittleFS, "/post.htm", "text/html", false, processor);
|
request->send(LittleFS, "/post.htm", "text/html", false, processor);
|
||||||
|
|
||||||
Serial.print("POST:\n");
|
Debug_pushMessage("POST:\n");
|
||||||
int paramsNr = request->params();
|
int paramsNr = request->params();
|
||||||
for (int i = 0; i < paramsNr; i++)
|
for (int i = 0; i < paramsNr; i++)
|
||||||
{
|
{
|
||||||
|
Reference in New Issue
Block a user