";
+ modHtml += "
" + String(iv->name) + "";
+ uint8_t list[8] = {FLD_UAC, FLD_IAC, FLD_PAC, FLD_F, FLD_PCT, FLD_T, FLD_YT, FLD_YD};
+
+ for(uint8_t fld = 0; fld < 8; fld++) {
+ pos = (iv->getPosByChFld(CH0, list[fld]));
+ if(0xff != pos) {
+ modHtml += "
";
+ modHtml += "" + String(iv->getValue(pos));
+ modHtml += "" + String(iv->getUnit(pos)) + "";
+ modHtml += "" + String(iv->getFieldName(pos)) + "";
+ modHtml += "
";
+ }
+ }
+ modHtml += "
";
for(uint8_t ch = 1; ch <= modNum; ch ++) {
modHtml += "
CHANNEL " + String(ch) + "";
diff --git a/tools/esp8266/app.h b/tools/esp8266/app.h
index 75ae6cd5..65225306 100644
--- a/tools/esp8266/app.h
+++ b/tools/esp8266/app.h
@@ -40,9 +40,6 @@ class app : public Main {
}
private:
- void sendTicker(void);
- void mqttTicker(void);
-
void showIndex(void);
void showSetup(void);
void showSave(void);
@@ -74,8 +71,8 @@ class app : public Main {
HmSystemType *mSys;
- Ticker *mSendTicker;
- bool mFlagSend;
+ uint32_t mSendTicker;
+ uint16_t mSendInterval;
uint32_t mCmds[DBG_CMD_LIST_LEN+1];
//uint32_t mChannelStat[4];
@@ -83,8 +80,8 @@ class app : public Main {
// mqtt
mqtt mMqtt;
- Ticker *mMqttTicker;
- bool mMqttEvt;
+ uint32_t mMqttTicker;
+ uint16_t mMqttInterval;
};
#endif /*__APP_H__*/
diff --git a/tools/esp8266/defines.h b/tools/esp8266/defines.h
index 75313155..0dc7a83f 100644
--- a/tools/esp8266/defines.h
+++ b/tools/esp8266/defines.h
@@ -25,7 +25,7 @@
//-------------------------------------
#define VERSION_MAJOR 0
#define VERSION_MINOR 3
-#define VERSION_PATCH 2
+#define VERSION_PATCH 3
//-------------------------------------
diff --git a/tools/esp8266/hmRadio.h b/tools/esp8266/hmRadio.h
index 65a098a5..10075ada 100644
--- a/tools/esp8266/hmRadio.h
+++ b/tools/esp8266/hmRadio.h
@@ -206,6 +206,7 @@ class HmRadio {
uint8_t pinIrq;
uint8_t AmplifierPower;
+ uint32_t mSendCnt;
private:
void sendPacket(uint64_t invId, uint8_t buf[], uint8_t len) {
@@ -265,7 +266,6 @@ class HmRadio {
RF24 mNrf24;
uint8_t mSendChannel;
BUFFER *mBufCtrl;
- uint32_t mSendCnt;
uint8_t mSendBuf[MAX_RF_PAYLOAD_SIZE];
};
diff --git a/tools/esp8266/html/h/style_css.h b/tools/esp8266/html/h/style_css.h
index 491afc1e..128b9ca5 100644
--- a/tools/esp8266/html/h/style_css.h
+++ b/tools/esp8266/html/h/style_css.h
@@ -1,4 +1,4 @@
#ifndef __STYLE_H__
#define __STYLE_H__
-const char style_css[] PROGMEM = "h1 {margin:0;padding:20pt;font-size:22pt;color:#fff;background-color:#006ec0;display:block;text-transform:uppercase;}html, body {font-family:Arial;margin:0;padding:0;}p {text-align:justify;font-size:13pt;}.des {margin-top:35px;font-size:14pt;color:#006ec0;}.subdes {font-size:13pt;color:#006ec0;margin-left:7px;}.fw {width:60px;display:block;float:left;}.color {width:50px;height:50px;border:1px solid #ccc;}.range {width:300px;}a:link, a:visited {text-decoration:none;font-size:13pt;color:#006ec0;}a:hover, a:focus {color:#f00;}a.erase {background-color:#006ec0;color:#fff;padding:7px;display:inline-block;margin-top:30px;float:right;}#content {padding:15px 15px 60px 15px;}#footer {position:fixed;bottom:0px;height:45px;background-color:#006ec0;width:100%;}#footer p {color:#fff;padding-left:20px;padding-right:20px;font-size:10pt !important;}#footer a {color:#fff;}div.content {background-color:#fff;padding-bottom:65px;overflow:hidden;}input, select {padding:7px;font-size:13pt;}input.text, select {width:70%;box-sizing:border-box;margin-bottom:10px;border:1px solid #ccc;}input.btn {background-color:#006ec0;color:#fff;border:0px;float:right;margin:10px 0 30px;text-transform:uppercase;}input.cb {margin-bottom:20px;}label {width:20%;display:inline-block;font-size:12pt;padding-right:10px;margin-left:10px;}.left {float:left;}.right {float:right;}div.ch-group {display:inline-block;}div.ch {width:250px;height:410px;background-color:#006ec0;display:inline-block;margin-right:20px;margin-bottom:20px;}div.ch .value, div.ch .info, div.ch .head {color:#fff;display:block;width:100%;text-align:center;}div.ch .unit {font-size:19px;margin-left:10px;}div.ch .value {margin-top:20px;font-size:30px;}div.ch .info {margin-top:3px;font-size:10px;}div.ch .head {background-color:#003c80;padding:10px 0 10px 0;}";
+const char style_css[] PROGMEM = "h1 {margin:0;padding:20pt;font-size:22pt;color:#fff;background-color:#006ec0;display:block;text-transform:uppercase;}html, body {font-family:Arial;margin:0;padding:0;}p {text-align:justify;font-size:13pt;}.des {margin-top:35px;font-size:14pt;color:#006ec0;}.subdes {font-size:13pt;color:#006ec0;margin-left:7px;}.fw {width:60px;display:block;float:left;}.color {width:50px;height:50px;border:1px solid #ccc;}.range {width:300px;}a:link, a:visited {text-decoration:none;font-size:13pt;color:#006ec0;}a:hover, a:focus {color:#f00;}a.erase {background-color:#006ec0;color:#fff;padding:7px;display:inline-block;margin-top:30px;float:right;}#content {padding:15px 15px 60px 15px;}#footer {position:fixed;bottom:0px;height:45px;background-color:#006ec0;width:100%;}#footer p {color:#fff;padding-left:20px;padding-right:20px;font-size:10pt !important;}#footer a {color:#fff;}div.content {background-color:#fff;padding-bottom:65px;overflow:hidden;}input, select {padding:7px;font-size:13pt;}input.text, select {width:70%;box-sizing:border-box;margin-bottom:10px;border:1px solid #ccc;}input.btn {background-color:#006ec0;color:#fff;border:0px;float:right;margin:10px 0 30px;text-transform:uppercase;}input.cb {margin-bottom:20px;}label {width:20%;display:inline-block;font-size:12pt;padding-right:10px;margin-left:10px;}.left {float:left;}.right {float:right;}div.ch-iv {width:100%;background-color:#32b004;display:inline-block;margin-bottom:20px;padding-bottom:20px;}div.ch {width:250px;height:410px;background-color:#006ec0;display:inline-block;margin-right:20px;margin-bottom:20px;}div.ch .value, div.ch .info, div.ch .head, div.ch-iv .value, div.ch-iv .info, div.ch-iv .head {color:#fff;display:block;width:100%;text-align:center;}.subgrp {float:left;width:250px;}div.ch .unit, div.ch-iv .unit {font-size:19px;margin-left:10px;}div.ch .value, div.ch-iv .value {margin-top:20px;font-size:30px;}div.ch .info, div.ch-iv .info {margin-top:3px;font-size:10px;}div.ch .head {background-color:#003c80;padding:10px 0 10px 0;}div.ch-iv .head {background-color:#1c6800;padding:10px 0 10px 0;}div.iv {max-width:1060px;}div.ch:last-child {margin-right:0px !important;}";
#endif /*__STYLE_H__*/
diff --git a/tools/esp8266/html/style.css b/tools/esp8266/html/style.css
index 88c1b57c..c92fa950 100644
--- a/tools/esp8266/html/style.css
+++ b/tools/esp8266/html/style.css
@@ -136,8 +136,12 @@ label {
float: right;
}
-div.ch-group {
+div.ch-iv {
+ width: 100%;
+ background-color: #32b004;
display: inline-block;
+ margin-bottom: 20px;
+ padding-bottom: 20px;
}
div.ch {
@@ -148,24 +152,29 @@ div.ch {
margin-right: 20px;
margin-bottom: 20px;
}
-div.ch .value, div.ch .info, div.ch .head {
+div.ch .value, div.ch .info, div.ch .head, div.ch-iv .value, div.ch-iv .info, div.ch-iv .head {
color: #fff;
display: block;
width: 100%;
text-align: center;
}
-div.ch .unit {
+.subgrp {
+ float: left;
+ width: 250px;
+}
+
+div.ch .unit, div.ch-iv .unit {
font-size: 19px;
margin-left: 10px;
}
-div.ch .value {
+div.ch .value, div.ch-iv .value {
margin-top: 20px;
font-size: 30px;
}
-div.ch .info {
+div.ch .info, div.ch-iv .info {
margin-top: 3px;
font-size: 10px;
}
@@ -174,3 +183,16 @@ div.ch .head {
background-color: #003c80;
padding: 10px 0 10px 0;
}
+
+div.ch-iv .head {
+ background-color: #1c6800;
+ padding: 10px 0 10px 0;
+}
+
+div.iv {
+ max-width: 1060px;
+}
+
+div.ch:last-child {
+ margin-right: 0px !important;
+}
diff --git a/tools/esp8266/main.cpp b/tools/esp8266/main.cpp
index 25b68c71..83fbef80 100644
--- a/tools/esp8266/main.cpp
+++ b/tools/esp8266/main.cpp
@@ -23,10 +23,9 @@ Main::Main(void) {
mEep = new eep();
Serial.begin(115200);
- mUptimeSecs = 0;
- mUptimeTicker = new Ticker();
- mUptimeTicker->attach(1, std::bind(&Main::uptimeTicker, this));
-
+ mUptimeSecs = 0;
+ mUptimeTicker = 0xffffffff;
+ mUptimeInterval = 1000;
}
@@ -67,6 +66,11 @@ void Main::loop(void) {
if(mApActive)
mDns->processNextRequest();
mWeb->handleClient();
+
+ if(checkTicker(&mUptimeTicker, &mUptimeInterval)) {
+ mUptimeSecs++;
+ mTimestamp++;
+ }
}
@@ -271,14 +275,6 @@ void Main::showReboot(void) {
}
-
-//-----------------------------------------------------------------------------
-void Main::uptimeTicker(void) {
- mUptimeSecs++;
- mTimestamp++;
-}
-
-
//-----------------------------------------------------------------------------
time_t Main::getNtpTime(void) {
time_t date = 0;
diff --git a/tools/esp8266/main.h b/tools/esp8266/main.h
index 6e096789..fede73a0 100644
--- a/tools/esp8266/main.h
+++ b/tools/esp8266/main.h
@@ -6,7 +6,6 @@
#include
#include
#include
-#include
#include
@@ -64,6 +63,20 @@ class Main {
} while(addr < ADDR_START_SETTINGS);
}
+ inline bool checkTicker(uint32_t *ticker, uint16_t *interval) {
+ uint32_t mil = millis();
+ if(mil >= *ticker) {
+ *ticker = mil + *interval;
+ return true;
+ }
+ else if(mil < (*ticker - *interval)) {
+ *ticker = mil + *interval;
+ return true;
+ }
+
+ return false;
+ }
+
char mStationSsid[SSID_LEN];
char mStationPwd[PWD_LEN];
bool mWifiSettingsValid;
@@ -87,14 +100,13 @@ class Main {
void showUptime(void);
void showTime(void);
void showCss(void);
- void uptimeTicker(void);
-
time_t getNtpTime(void);
void sendNTPpacket(IPAddress& address);
time_t offsetDayLightSaving (uint32_t local_t);
- Ticker *mUptimeTicker;
+ uint32_t mUptimeTicker;
+ uint16_t mUptimeInterval;
uint32_t mUptimeSecs;
DNSServer *mDns;