First build under Platformio. SEEMS to have improved the 10 second timeout in websocket.
Most significant change was moving BlueWireSerialPort variable in TxManage.h ..... Secondary was a few operator= were not returning *this ....
This commit is contained in:
parent
52ecbcedae
commit
9513d787a6
23 changed files with 52 additions and 69 deletions
|
@ -119,8 +119,8 @@
|
||||||
#define RX_DATA_TIMOUT 50
|
#define RX_DATA_TIMOUT 50
|
||||||
|
|
||||||
const int FirmwareRevision = 23;
|
const int FirmwareRevision = 23;
|
||||||
const int FirmwareSubRevision = 2;
|
const int FirmwareSubRevision = 3;
|
||||||
const char* FirmwareDate = "16 Jun 2019";
|
const char* FirmwareDate = "25 Jun 2019";
|
||||||
|
|
||||||
|
|
||||||
#ifdef ESP32
|
#ifdef ESP32
|
||||||
|
@ -156,6 +156,7 @@ long lastTemperatureTime; // used to moderate DS18B20 access
|
||||||
float fFilteredTemperature = -100; // -100: force direct update uopn first pass
|
float fFilteredTemperature = -100; // -100: force direct update uopn first pass
|
||||||
const float fAlpha = 0.95; // exponential mean alpha
|
const float fAlpha = 0.95; // exponential mean alpha
|
||||||
int DS18B20holdoff = 2;
|
int DS18B20holdoff = 2;
|
||||||
|
int DS18B20holdon = 0;
|
||||||
int BoardRevision = 0;
|
int BoardRevision = 0;
|
||||||
|
|
||||||
unsigned long lastAnimationTime; // used to sequence updates to LCD for animation
|
unsigned long lastAnimationTime; // used to sequence updates to LCD for animation
|
||||||
|
@ -296,7 +297,7 @@ void listDir(fs::FS &fs, const char * dirname, uint8_t levels)
|
||||||
listDir(fs, file.name(), levels - 1);
|
listDir(fs, file.name(), levels - 1);
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
DebugPort.printf(" FILE: %s SIZE: %ld\r\n", file.name(), file.size());
|
DebugPort.printf(" FILE: %s SIZE: %d\r\n", file.name(), file.size());
|
||||||
}
|
}
|
||||||
file = root.openNextFile();
|
file = root.openNextFile();
|
||||||
}
|
}
|
||||||
|
@ -311,8 +312,6 @@ void interruptReboot()
|
||||||
|
|
||||||
void setup() {
|
void setup() {
|
||||||
|
|
||||||
char msg[128];
|
|
||||||
|
|
||||||
// initially, ensure the GPIO outputs are not activated during startup
|
// initially, ensure the GPIO outputs are not activated during startup
|
||||||
// (GPIO2 tends to be one with default chip startup)
|
// (GPIO2 tends to be one with default chip startup)
|
||||||
pinMode(GPIOout1_pin, OUTPUT);
|
pinMode(GPIOout1_pin, OUTPUT);
|
||||||
|
@ -326,9 +325,11 @@ void setup() {
|
||||||
// Serial is the usual USB connection to a PC
|
// Serial is the usual USB connection to a PC
|
||||||
// DO THIS BEFORE WE TRY AND SEND DEBUG INFO!
|
// DO THIS BEFORE WE TRY AND SEND DEBUG INFO!
|
||||||
|
|
||||||
DebugPort.setWelcomeMsg("*************************************************\r\n"
|
DebugPort.setWelcomeMsg((char*)(
|
||||||
|
"*************************************************\r\n"
|
||||||
"* Connected to BTC heater controller debug port *\r\n"
|
"* Connected to BTC heater controller debug port *\r\n"
|
||||||
"*************************************************\r\n");
|
"*************************************************\r\n"
|
||||||
|
));
|
||||||
DebugPort.setBufferSize(8192);
|
DebugPort.setBufferSize(8192);
|
||||||
DebugPort.begin(115200);
|
DebugPort.begin(115200);
|
||||||
DebugPort.println("_______________________________________________________________");
|
DebugPort.println("_______________________________________________________________");
|
||||||
|
@ -348,7 +349,7 @@ void setup() {
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
DebugPort.println("Mounted SPIFFS OK");
|
DebugPort.println("Mounted SPIFFS OK");
|
||||||
DebugPort.printf("SPIFFS usage: %ld/%ld\r\n", SPIFFS.usedBytes(), SPIFFS.totalBytes());
|
DebugPort.printf("SPIFFS usage: %d/%d\r\n", SPIFFS.usedBytes(), SPIFFS.totalBytes());
|
||||||
listDir(SPIFFS, "/", 2);
|
listDir(SPIFFS, "/", 2);
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
|
@ -779,12 +780,13 @@ void loop()
|
||||||
// update temperature reading,
|
// update temperature reading,
|
||||||
// synchronised with serial reception as interrupts do get disabled in the OneWire library
|
// synchronised with serial reception as interrupts do get disabled in the OneWire library
|
||||||
tDelta = timenow - lastTemperatureTime;
|
tDelta = timenow - lastTemperatureTime;
|
||||||
if(tDelta > TEMPERATURE_INTERVAL) { // maintain a minimum holdoff period
|
if(tDelta > MIN_TEMPERATURE_INTERVAL) { // maintain a minimum holdoff period
|
||||||
lastTemperatureTime += TEMPERATURE_INTERVAL; // reset time to observe temeprature
|
lastTemperatureTime = millis(); // reset time to observe temeprature
|
||||||
fTemperature = TempSensor.getTempCByIndex(0); // read sensor
|
fTemperature = TempSensor.getTempCByIndex(0); // read sensor
|
||||||
// DebugPort.printf("DS18B20 = %f\r\n", fTemperature);
|
// DebugPort.printf("DS18B20 = %f\r\n", fTemperature);
|
||||||
// initialise filtered temperature upon very first pass
|
// initialise filtered temperature upon very first pass
|
||||||
if(fTemperature > -80) { // avoid disconnected sensor readings being integrated
|
if(fTemperature > -80) { // avoid disconnected sensor readings being integrated
|
||||||
|
DS18B20holdon = 0;
|
||||||
if(DS18B20holdoff)
|
if(DS18B20holdoff)
|
||||||
DS18B20holdoff--; // first value upon sensor connect is bad
|
DS18B20holdoff--; // first value upon sensor connect is bad
|
||||||
else {
|
else {
|
||||||
|
@ -798,9 +800,15 @@ void loop()
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
|
DS18B20holdon++;
|
||||||
|
if(DS18B20holdon > 2) {
|
||||||
|
DS18B20holdon = 2;
|
||||||
|
if(!DS18B20holdoff)
|
||||||
|
DebugPort.println("\007DS18B20 sensor removed?");
|
||||||
DS18B20holdoff = 2;
|
DS18B20holdoff = 2;
|
||||||
fFilteredTemperature = -100;
|
fFilteredTemperature = -100;
|
||||||
}
|
}
|
||||||
|
}
|
||||||
TempSensor.requestTemperatures(); // prep sensor for future reading
|
TempSensor.requestTemperatures(); // prep sensor for future reading
|
||||||
|
|
||||||
ScreenManager.reqUpdate();
|
ScreenManager.reqUpdate();
|
||||||
|
@ -914,7 +922,7 @@ void heaterOff()
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
bool reqTemp(unsigned char newTemp)
|
bool reqTemp(unsigned char newTemp, bool save)
|
||||||
{
|
{
|
||||||
if(bHasOEMController)
|
if(bHasOEMController)
|
||||||
return false;
|
return false;
|
||||||
|
@ -934,6 +942,7 @@ bool reqTemp(unsigned char newTemp)
|
||||||
else
|
else
|
||||||
settings.demandPump = newTemp;
|
settings.demandPump = newTemp;
|
||||||
NVstore.setUserSettings(settings);
|
NVstore.setUserSettings(settings);
|
||||||
|
if(save)
|
||||||
NVstore.save();
|
NVstore.save();
|
||||||
|
|
||||||
ScreenManager.reqUpdate();
|
ScreenManager.reqUpdate();
|
||||||
|
@ -1090,8 +1099,10 @@ void checkDebugCommands()
|
||||||
{
|
{
|
||||||
// check for test commands received from PC Over USB
|
// check for test commands received from PC Over USB
|
||||||
if(DebugPort.available()) {
|
if(DebugPort.available()) {
|
||||||
|
#ifdef PROTOCOL_INVESTIGATION
|
||||||
static int mode = 0;
|
static int mode = 0;
|
||||||
static int val = 0;
|
static int val = 0;
|
||||||
|
#endif
|
||||||
|
|
||||||
char rxVal = DebugPort.read();
|
char rxVal = DebugPort.read();
|
||||||
|
|
||||||
|
@ -1355,8 +1366,8 @@ void ShowOTAScreen(int percent, eOTAmodes updateType)
|
||||||
void feedWatchdog()
|
void feedWatchdog()
|
||||||
{
|
{
|
||||||
uint64_t timeRem = timerRead(watchdogTimer);
|
uint64_t timeRem = timerRead(watchdogTimer);
|
||||||
if(timeRem > 100000) // 100ms
|
if(timeRem > 500000) // 500ms
|
||||||
DebugPort.printf("WD time = %lld\r\n", timeRem); // print longer WD intervals
|
DebugPort.printf("\007WD time = %lld\r\n", timeRem); // print longer WD intervals
|
||||||
|
|
||||||
timerWrite(watchdogTimer, 0); //reset timer (feed watchdog)
|
timerWrite(watchdogTimer, 0); //reset timer (feed watchdog)
|
||||||
}
|
}
|
||||||
|
|
27
Arduino/BTCDieselHeater/data/gauge.min.js
vendored
27
Arduino/BTCDieselHeater/data/gauge.min.js
vendored
File diff suppressed because one or more lines are too long
|
@ -130,8 +130,6 @@ C128x64_OLED::drawDotFactoryChar(int16_t x, int16_t y, unsigned char c, uint16_t
|
||||||
DBG(pr); DBG(F(" fg=")); DBG(color); DBG(F(" bg=")); DBGln(bg);
|
DBG(pr); DBG(F(" fg=")); DBG(color); DBG(F(" bg=")); DBGln(bg);
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
uint16_t char2print = c;
|
|
||||||
|
|
||||||
if(c >= pFontDescriptor->StartChar && c <= pFontDescriptor->EndChar) {
|
if(c >= pFontDescriptor->StartChar && c <= pFontDescriptor->EndChar) {
|
||||||
|
|
||||||
#ifdef DEBUG_FONT
|
#ifdef DEBUG_FONT
|
||||||
|
|
|
@ -86,7 +86,6 @@ CBasicScreen::show()
|
||||||
|
|
||||||
if(_showModeTime) {
|
if(_showModeTime) {
|
||||||
const int border = 3;
|
const int border = 3;
|
||||||
const int radius = 4;
|
|
||||||
// Show selection between Fixed or Thermostat mode
|
// Show selection between Fixed or Thermostat mode
|
||||||
long tDelta = millis() - _showModeTime;
|
long tDelta = millis() - _showModeTime;
|
||||||
if(tDelta < 0) {
|
if(tDelta < 0) {
|
||||||
|
|
|
@ -79,8 +79,6 @@ CDetailedScreen::show()
|
||||||
{
|
{
|
||||||
CScreenHeader::show();
|
CScreenHeader::show();
|
||||||
|
|
||||||
const char* c = String(getTemperatureSensor()).c_str();
|
|
||||||
|
|
||||||
int runstate = getHeaterInfo().getRunStateEx();
|
int runstate = getHeaterInfo().getRunStateEx();
|
||||||
int errstate = getHeaterInfo().getErrState();
|
int errstate = getHeaterInfo().getErrState();
|
||||||
if(errstate) errstate--; // correct for +1 biased return value
|
if(errstate) errstate--; // correct for +1 biased return value
|
||||||
|
|
|
@ -66,7 +66,6 @@ CFuelMixtureScreen::show()
|
||||||
{
|
{
|
||||||
char str[16];
|
char str[16];
|
||||||
int xPos, yPos;
|
int xPos, yPos;
|
||||||
const int col2 = 90;
|
|
||||||
const int col3 = _display.width() - border;
|
const int col3 = _display.width() - border;
|
||||||
|
|
||||||
_display.clearDisplay();
|
_display.clearDisplay();
|
||||||
|
|
|
@ -155,7 +155,6 @@ CPasswordScreen::_showPassword()
|
||||||
_display.getTextExtents("X", extents);
|
_display.getTextExtents("X", extents);
|
||||||
int charWidth = extents.width;
|
int charWidth = extents.width;
|
||||||
_display.getTextExtents(" ", extents);
|
_display.getTextExtents(" ", extents);
|
||||||
int spaceWidth = extents.width;
|
|
||||||
|
|
||||||
for(int idx =0 ; idx < 4; idx++) {
|
for(int idx =0 ; idx < 4; idx++) {
|
||||||
|
|
||||||
|
|
|
@ -53,7 +53,7 @@ CRebootScreen::show()
|
||||||
char msg[20];
|
char msg[20];
|
||||||
char fillmsg[20];
|
char fillmsg[20];
|
||||||
memset(fillmsg, ' ', 20);
|
memset(fillmsg, ' ', 20);
|
||||||
sprintf(msg, " REBOOT %d ", tDelta);
|
sprintf(msg, " REBOOT %ld ", tDelta);
|
||||||
fillmsg[strlen(msg)] = 0;
|
fillmsg[strlen(msg)] = 0;
|
||||||
|
|
||||||
_printInverted(_display.xCentre(), yPos, fillmsg, true, eCentreJustify);
|
_printInverted(_display.xCentre(), yPos, fillmsg, true, eCentreJustify);
|
||||||
|
|
|
@ -136,6 +136,8 @@ CScreen::_adjustExtents(CRect& extents, eJUSTIFY justify, const char* str)
|
||||||
{
|
{
|
||||||
_display.getTextExtents(str, extents);
|
_display.getTextExtents(str, extents);
|
||||||
switch(justify) {
|
switch(justify) {
|
||||||
|
case eLeftJustify:
|
||||||
|
break;
|
||||||
case eCentreJustify:
|
case eCentreJustify:
|
||||||
extents.xPos -= extents.width/2;
|
extents.xPos -= extents.width/2;
|
||||||
break;
|
break;
|
||||||
|
|
|
@ -71,8 +71,6 @@ CSetClockScreen::show()
|
||||||
|
|
||||||
char str[16];
|
char str[16];
|
||||||
int xPos, yPos;
|
int xPos, yPos;
|
||||||
const int col2 = 90;
|
|
||||||
const int col3 = _display.width() - border;
|
|
||||||
|
|
||||||
_printInverted(0, 15, " Set Clock ", true);
|
_printInverted(0, 15, " Set Clock ", true);
|
||||||
|
|
||||||
|
@ -226,7 +224,6 @@ CSetClockScreen::keyHandler(uint8_t event)
|
||||||
void
|
void
|
||||||
CSetClockScreen::_adjTimeDate(int dir)
|
CSetClockScreen::_adjTimeDate(int dir)
|
||||||
{
|
{
|
||||||
int days;
|
|
||||||
switch(_rowSel) {
|
switch(_rowSel) {
|
||||||
case 1:
|
case 1:
|
||||||
working.adjustDay(dir);
|
working.adjustDay(dir);
|
||||||
|
|
|
@ -316,7 +316,6 @@ CSetTimerScreen::keyHandler(uint8_t event)
|
||||||
void
|
void
|
||||||
CSetTimerScreen::_adjust(int dir)
|
CSetTimerScreen::_adjust(int dir)
|
||||||
{
|
{
|
||||||
int days;
|
|
||||||
int maskDOW = 0x01 << _colSel; // if doing Day of Week - (_rowSel == 2)
|
int maskDOW = 0x01 << _colSel; // if doing Day of Week - (_rowSel == 2)
|
||||||
|
|
||||||
switch(_colSel) {
|
switch(_colSel) {
|
||||||
|
|
|
@ -87,7 +87,6 @@ CTimerChartScreen::show()
|
||||||
|
|
||||||
|
|
||||||
for(int dow = 0; dow < 7; dow++) {
|
for(int dow = 0; dow < 7; dow++) {
|
||||||
int day = 0x01 << dow;
|
|
||||||
int ypos = dow*linespacing + 7; // top of first line
|
int ypos = dow*linespacing + 7; // top of first line
|
||||||
int pixel = 0;
|
int pixel = 0;
|
||||||
int subpixel = 0;
|
int subpixel = 0;
|
||||||
|
|
|
@ -147,7 +147,6 @@ CWiFiScreen::show()
|
||||||
bool
|
bool
|
||||||
CWiFiScreen::animate()
|
CWiFiScreen::animate()
|
||||||
{
|
{
|
||||||
bool retval = false;
|
|
||||||
// show next/prev menu navigation line
|
// show next/prev menu navigation line
|
||||||
if(_rowSel == 0) {
|
if(_rowSel == 0) {
|
||||||
_printMenuText(_display.xCentre(), 53, " \021 \020 ", true, eCentreJustify);
|
_printMenuText(_display.xCentre(), 53, " \021 \020 ", true, eCentreJustify);
|
||||||
|
|
|
@ -40,6 +40,7 @@ public:
|
||||||
const CProtocol& getFrame() const { return m_TxFrame; };
|
const CProtocol& getFrame() const { return m_TxFrame; };
|
||||||
|
|
||||||
private:
|
private:
|
||||||
|
HardwareSerial& m_BlueWireSerial;
|
||||||
CProtocol m_TxFrame;
|
CProtocol m_TxFrame;
|
||||||
bool m_bOnReq;
|
bool m_bOnReq;
|
||||||
bool m_bOffReq;
|
bool m_bOffReq;
|
||||||
|
@ -47,7 +48,6 @@ private:
|
||||||
int m_nTxGatePin;
|
int m_nTxGatePin;
|
||||||
unsigned char _rawCommand;
|
unsigned char _rawCommand;
|
||||||
unsigned long m_nStartTime;
|
unsigned long m_nStartTime;
|
||||||
HardwareSerial& m_BlueWireSerial;
|
|
||||||
|
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
|
@ -36,6 +36,7 @@ struct sHourMin {
|
||||||
sHourMin& operator=(const sHourMin& rhs) {
|
sHourMin& operator=(const sHourMin& rhs) {
|
||||||
hour = rhs.hour;
|
hour = rhs.hour;
|
||||||
min = rhs.min;
|
min = rhs.min;
|
||||||
|
return *this;
|
||||||
}
|
}
|
||||||
bool operator!=(const sHourMin& rhs) {
|
bool operator!=(const sHourMin& rhs) {
|
||||||
return (hour != rhs.hour) || (min != rhs.min);
|
return (hour != rhs.hour) || (min != rhs.min);
|
||||||
|
@ -62,6 +63,7 @@ struct sTimer : public CESP32_NVStorage {
|
||||||
repeat = rhs.repeat;
|
repeat = rhs.repeat;
|
||||||
temperature = rhs.temperature;
|
temperature = rhs.temperature;
|
||||||
timerID = rhs.timerID;
|
timerID = rhs.timerID;
|
||||||
|
return *this;
|
||||||
}
|
}
|
||||||
void init(int idx) {
|
void init(int idx) {
|
||||||
start.hour = 0;
|
start.hour = 0;
|
||||||
|
|
|
@ -61,7 +61,7 @@ void interpretJsonCommand(char* pLine)
|
||||||
for(it = obj.begin(); it != obj.end(); ++it) {
|
for(it = obj.begin(); it != obj.end(); ++it) {
|
||||||
|
|
||||||
if(strcmp("TempDesired", it->key) == 0) {
|
if(strcmp("TempDesired", it->key) == 0) {
|
||||||
if(!reqTemp(it->value.as<unsigned char>())) { // this request is blocked if OEM controller active
|
if( !reqTemp(it->value.as<unsigned char>(), false) ) { // this request is blocked if OEM controller active
|
||||||
JSONmoderator.reset("TempDesired");
|
JSONmoderator.reset("TempDesired");
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -80,8 +80,8 @@ bool TModerator<T>::shouldSend(const char* name, T value)
|
||||||
template<class T>
|
template<class T>
|
||||||
bool TModerator<T>::addJson(const char* name, T value, JsonObject& root)
|
bool TModerator<T>::addJson(const char* name, T value, JsonObject& root)
|
||||||
{
|
{
|
||||||
bool retval;
|
bool retval = shouldSend(name, value);
|
||||||
if( retval = shouldSend(name, value ) )
|
if(retval)
|
||||||
root.set(name, value);
|
root.set(name, value);
|
||||||
return retval;
|
return retval;
|
||||||
}
|
}
|
||||||
|
|
|
@ -339,6 +339,7 @@ public:
|
||||||
void setCredentials(const sCredentials& info);
|
void setCredentials(const sCredentials& info);
|
||||||
CHeaterStorage& operator=(const CHeaterStorage& rhs) {
|
CHeaterStorage& operator=(const CHeaterStorage& rhs) {
|
||||||
_calValues = rhs._calValues;
|
_calValues = rhs._calValues;
|
||||||
|
return *this;
|
||||||
}
|
}
|
||||||
void setUserSettings(const sUserSettings& info);
|
void setUserSettings(const sUserSettings& info);
|
||||||
void setHeaterTuning(const sHeaterTuning& info);
|
void setHeaterTuning(const sHeaterTuning& info);
|
||||||
|
|
|
@ -61,8 +61,13 @@ public:
|
||||||
bool checkValidStart(unsigned char val);
|
bool checkValidStart(unsigned char val);
|
||||||
void setDelay(int ms);
|
void setDelay(int ms);
|
||||||
bool delayExpired();
|
bool delayExpired();
|
||||||
bool toggleReporting() { _report = !_report; };
|
bool toggleReporting() {
|
||||||
bool isReporting() {return _report != 0;};
|
_report = !_report;
|
||||||
|
return isReporting();
|
||||||
|
};
|
||||||
|
bool isReporting() {
|
||||||
|
return _report != 0;
|
||||||
|
};
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
||||||
|
@ -76,6 +81,7 @@ public:
|
||||||
}
|
}
|
||||||
void reset() {
|
void reset() {
|
||||||
newData = false;
|
newData = false;
|
||||||
|
Value = 0;
|
||||||
}
|
}
|
||||||
void setValue(int value) {
|
void setValue(int value) {
|
||||||
newData = true;
|
newData = true;
|
||||||
|
@ -135,7 +141,7 @@ public:
|
||||||
};
|
};
|
||||||
void report() {
|
void report() {
|
||||||
prevTime = millis();
|
prevTime = millis();
|
||||||
DebugPort.printf("%8dlms ", prevTime - refTime);
|
DebugPort.printf("%8ldms ", prevTime - refTime);
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
|
@ -31,7 +31,7 @@ struct sGPIO;
|
||||||
extern void requestOn();
|
extern void requestOn();
|
||||||
extern void requestOff();
|
extern void requestOff();
|
||||||
extern bool reqTempDelta(int delta);
|
extern bool reqTempDelta(int delta);
|
||||||
extern bool reqTemp(unsigned char newTemp);
|
extern bool reqTemp(unsigned char newTemp, bool save=true);
|
||||||
extern bool reqThermoToggle();
|
extern bool reqThermoToggle();
|
||||||
extern bool setThermostatMode(unsigned char);
|
extern bool setThermostatMode(unsigned char);
|
||||||
extern bool getThermostatModeActive(); // OEM: actual mode from blue wire, BTC: or our NV
|
extern bool getThermostatModeActive(); // OEM: actual mode from blue wire, BTC: or our NV
|
||||||
|
|
|
@ -70,7 +70,7 @@ bool handleFileRead(String path) { // send the right file to the client (if it e
|
||||||
String contentType = getContentType(path); // Get the MIME type
|
String contentType = getContentType(path); // Get the MIME type
|
||||||
if (SPIFFS.exists(path)) { // If the file exists
|
if (SPIFFS.exists(path)) { // If the file exists
|
||||||
File file = SPIFFS.open(path, "r"); // Open it
|
File file = SPIFFS.open(path, "r"); // Open it
|
||||||
size_t sent = server.streamFile(file, contentType); // And send it to the client
|
server.streamFile(file, contentType); // And send it to the client
|
||||||
file.close(); // Then close the file again
|
file.close(); // Then close the file again
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
@ -401,7 +401,7 @@ void initWebServer(void) {
|
||||||
server.onNotFound([]()
|
server.onNotFound([]()
|
||||||
{ // If the client requests any URI
|
{ // If the client requests any URI
|
||||||
if (!handleFileRead(server.uri())) { // send it if it exists
|
if (!handleFileRead(server.uri())) { // send it if it exists
|
||||||
DebugPort.printf("WEB: NOT FOUND : %s\r\n", server.uri());
|
DebugPort.printf("WEB: NOT FOUND : %s\r\n", server.uri().c_str());
|
||||||
server.send(404, "text/plain", "404: Not Found"); // otherwise, respond with a 404 (Not Found) error
|
server.send(404, "text/plain", "404: Not Found"); // otherwise, respond with a 404 (Not Found) error
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
@ -423,6 +423,7 @@ bool doWebServer(void)
|
||||||
{
|
{
|
||||||
webSocket.loop();
|
webSocket.loop();
|
||||||
server.handleClient();
|
server.handleClient();
|
||||||
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
bool isWebServerClientChange()
|
bool isWebServerClientChange()
|
||||||
|
|
|
@ -45,4 +45,4 @@
|
||||||
void wifiFactoryDefault();
|
void wifiFactoryDefault();
|
||||||
int isWifiButton();
|
int isWifiButton();
|
||||||
|
|
||||||
#endif __BTCWIFI_H__
|
#endif // __BTCWIFI_H__
|
||||||
|
|
|
@ -74,7 +74,7 @@
|
||||||
///////////////////////////////////////////////////////////////////////////////
|
///////////////////////////////////////////////////////////////////////////////
|
||||||
// DS18B20 temperature sensing
|
// DS18B20 temperature sensing
|
||||||
//
|
//
|
||||||
#define TEMPERATURE_INTERVAL 1000
|
#define MIN_TEMPERATURE_INTERVAL 500
|
||||||
|
|
||||||
///////////////////////////////////////////////////////////////////////////////
|
///////////////////////////////////////////////////////////////////////////////
|
||||||
// Real Time Clock support
|
// Real Time Clock support
|
||||||
|
|
Loading…
Reference in a new issue