|
@ -107,7 +107,6 @@ void app::setup(uint32_t timeout) { |
|
|
mSys->Radio.pinIrq = RF24_IRQ_PIN; |
|
|
mSys->Radio.pinIrq = RF24_IRQ_PIN; |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
// nrf24 amplifier power
|
|
|
// nrf24 amplifier power
|
|
|
mEep->read(ADDR_RF24_AMP_PWR, &mSys->Radio.AmplifierPower); |
|
|
mEep->read(ADDR_RF24_AMP_PWR, &mSys->Radio.AmplifierPower); |
|
|
|
|
|
|
|
@ -122,6 +121,12 @@ void app::setup(uint32_t timeout) { |
|
|
mSerialDebug = (tmp == 0x01); |
|
|
mSerialDebug = (tmp == 0x01); |
|
|
mSys->Radio.mSerialDebug = mSerialDebug; |
|
|
mSys->Radio.mSerialDebug = mSerialDebug; |
|
|
|
|
|
|
|
|
|
|
|
// ntp
|
|
|
|
|
|
char ntpAddr[NTP_ADDR_LEN]; |
|
|
|
|
|
uint16_t ntpPort; |
|
|
|
|
|
mEep->read(ADDR_NTP_ADDR, ntpAddr, NTP_ADDR_LEN); |
|
|
|
|
|
mEep->read(ADDR_NTP_PORT, &ntpPort); |
|
|
|
|
|
// TODO set ntpAddr & ntpPort in main
|
|
|
|
|
|
|
|
|
// mqtt
|
|
|
// mqtt
|
|
|
uint16_t mqttPort; |
|
|
uint16_t mqttPort; |
|
@ -358,6 +363,7 @@ void app::loop(void) { |
|
|
|
|
|
|
|
|
yield(); |
|
|
yield(); |
|
|
if(mSerialDebug) |
|
|
if(mSerialDebug) |
|
|
|
|
|
DPRINTLN(DBG_DEBUG, F("app:loop WiFi WiFi.status ") + String(WiFi.status()) ); |
|
|
DPRINTLN(DBG_INFO, F("Requesting Inverter SN ") + String(iv->serial.u64, HEX)); |
|
|
DPRINTLN(DBG_INFO, F("Requesting Inverter SN ") + String(iv->serial.u64, HEX)); |
|
|
mSys->Radio.sendTimePacket(iv->radioId.u64, mPayload[iv->id].ts); |
|
|
mSys->Radio.sendTimePacket(iv->radioId.u64, mPayload[iv->id].ts); |
|
|
mRxTicker = 0; |
|
|
mRxTicker = 0; |
|
@ -579,6 +585,13 @@ void app::showSetup(void) { |
|
|
mEep->read(ADDR_SER_DEBUG, &tmp); |
|
|
mEep->read(ADDR_SER_DEBUG, &tmp); |
|
|
html.replace(F("{SER_DBG_CB}"), (tmp == 0x01) ? "checked" : ""); |
|
|
html.replace(F("{SER_DBG_CB}"), (tmp == 0x01) ? "checked" : ""); |
|
|
|
|
|
|
|
|
|
|
|
char ntpAddr[NTP_ADDR_LEN] = {0}; |
|
|
|
|
|
uint16_t ntpPort; |
|
|
|
|
|
mEep->read(ADDR_NTP_ADDR, ntpAddr, NTP_ADDR_LEN); |
|
|
|
|
|
mEep->read(ADDR_NTP_PORT, &ntpPort); |
|
|
|
|
|
html.replace(F("{NTP_ADDR}"), String(ntpAddr)); |
|
|
|
|
|
html.replace(F("{NTP_PORT}"), String(ntpPort)); |
|
|
|
|
|
|
|
|
char mqttAddr[MQTT_ADDR_LEN] = {0}; |
|
|
char mqttAddr[MQTT_ADDR_LEN] = {0}; |
|
|
uint16_t mqttPort; |
|
|
uint16_t mqttPort; |
|
|
mEep->read(ADDR_MQTT_ADDR, mqttAddr, MQTT_ADDR_LEN); |
|
|
mEep->read(ADDR_MQTT_ADDR, mqttAddr, MQTT_ADDR_LEN); |
|
@ -837,6 +850,14 @@ void app::saveValues(bool webSend = true) { |
|
|
mSys->Radio.AmplifierPower = mWeb->arg("rf24Power").toInt() & 0x03; |
|
|
mSys->Radio.AmplifierPower = mWeb->arg("rf24Power").toInt() & 0x03; |
|
|
mEep->write(ADDR_RF24_AMP_PWR, mSys->Radio.AmplifierPower); |
|
|
mEep->write(ADDR_RF24_AMP_PWR, mSys->Radio.AmplifierPower); |
|
|
|
|
|
|
|
|
|
|
|
// ntp
|
|
|
|
|
|
char ntpAddr[NTP_ADDR_LEN] = {0}; |
|
|
|
|
|
uint16_t ntpPort; |
|
|
|
|
|
mWeb->arg("ntpAddr").toCharArray(ntpAddr, NTP_ADDR_LEN); |
|
|
|
|
|
ntpPort = mWeb->arg("ntpPort").toInt(); |
|
|
|
|
|
mEep->write(ADDR_NTP_ADDR, ntpAddr, NTP_ADDR_LEN); |
|
|
|
|
|
mEep->write(ADDR_NTP_PORT, ntpPort); |
|
|
|
|
|
|
|
|
// mqtt
|
|
|
// mqtt
|
|
|
char mqttAddr[MQTT_ADDR_LEN] = {0}; |
|
|
char mqttAddr[MQTT_ADDR_LEN] = {0}; |
|
|
uint16_t mqttPort; |
|
|
uint16_t mqttPort; |
|
|