mirror of
https://github.com/lumapu/ahoy.git
synced 2025-05-31 01:36:11 +02:00
NRF signal quality aprox
This commit is contained in:
parent
55b087ba77
commit
df2b012093
3 changed files with 15 additions and 2 deletions
|
@ -21,7 +21,7 @@
|
|||
#define ALL_FRAMES 0x80
|
||||
#define SINGLE_FRAME 0x81
|
||||
|
||||
const char* const rf24AmpPowerNames[] = {"MIN", "LOW", "HIGH", "MAX"};
|
||||
const char* const rf24AmpPowerNames[] = {"MIN (recommended)", "LOW", "HIGH", "MAX (experimental)"};
|
||||
|
||||
|
||||
//-----------------------------------------------------------------------------
|
||||
|
@ -205,6 +205,7 @@ class HmRadio {
|
|||
}
|
||||
cnt++;
|
||||
}
|
||||
|
||||
sendPacket(invId, cnt, isRetransmit, isNoMI);
|
||||
}
|
||||
|
||||
|
@ -239,6 +240,14 @@ class HmRadio {
|
|||
return mNrf24.isPVariant();
|
||||
}
|
||||
|
||||
bool goodSignal(void) {
|
||||
bool goodSignal = mNrf24.testRPD();
|
||||
DPRINT(DBG_INFO, F("NRF Signal: "));
|
||||
DPRINT(DBG_INFO, String(goodSignal));
|
||||
mNrf24.read(0,0);
|
||||
return goodSignal;
|
||||
}
|
||||
|
||||
std::queue<packet_t> mBufCtrl;
|
||||
|
||||
uint32_t mSendCnt;
|
||||
|
|
|
@ -502,6 +502,7 @@ class RestApi {
|
|||
obj[F("isconnected")] = mRadio->isChipConnected();
|
||||
obj[F("DataRate")] = mRadio->getDataRate();
|
||||
obj[F("isPVariant")] = mRadio->isPVariant();
|
||||
obj[F("goodSignal")] = mRadio->goodSignal();
|
||||
obj[F("en")] = (bool) mConfig->nrf.enabled;
|
||||
}
|
||||
|
||||
|
@ -570,6 +571,8 @@ class RestApi {
|
|||
warn.add(F("reboot your ESP to apply all your configuration changes"));
|
||||
if(0 == mApp->getTimestamp())
|
||||
warn.add(F("time not set. No communication to inverter possible"));
|
||||
|
||||
|
||||
/*if(0 == mSys->getNumInverters())
|
||||
warn.add(F("no inverter configured"));*/
|
||||
|
||||
|
|
|
@ -50,7 +50,7 @@
|
|||
}
|
||||
|
||||
function parseRadio(obj, stat) {
|
||||
const pa = ["MIN", "LOW", "HIGH", "MAX"];
|
||||
const pa = ["MIN (recommended)", "LOW", "HIGH", "MAX"];
|
||||
const datarate = ["1 MBps", "2 MBps", "250 kbps"];
|
||||
|
||||
var main = document.getElementById("radio");
|
||||
|
@ -61,6 +61,7 @@
|
|||
main.appendChild(h);
|
||||
|
||||
main.appendChild(genTabRow("nrf24l01" + (obj["isPVariant"] ? "+ " : ""), (obj["isconnected"] ? "is connected " : "is not connected ")));
|
||||
main.appendChild(genTabRow("NRF Signal: ", (obj["goodSignal"] ? "Strong signal > 64dBm" : "Weak signal < 64dBm")));
|
||||
|
||||
if(obj["isconnected"]) {
|
||||
main.appendChild(genTabRow("Datarate", datarate[obj["DataRate"]]));
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue