While using a Notecard Cell+WiFi in WiFi mode, we’re using the following MCU code to retrieve ‘bars’ and ‘rssi’ values from card.wireless, then upload those values as part of our ‘note.add’ payload. We are operating in ‘continuous’ mode, and for the purpose of testing we are sending a new request to Notehub every 20-30 seconds.
J *rsp = notecard.requestAndResponse(notecard.newRequest("card.wireless"));
if (rsp != NULL)
{
signal_rssi = JGetNumber(JGetObject(rsp, "net"), "rssi");
signal_bars = JGetNumber(JGetObject(rsp, "net"), "bars");
notecard.deleteResponse(rsp);
}
J *req = notecard.newRequest("note.add");
if (req != NULL)
{
JAddBoolToObject(req, "sync", true);
J *body = JAddObjectToObject(req, "body");
if (body != NULL)
{
JAddNumberToObject(body, "motor_temp", round(kls.status.motor_temp));
JAddNumberToObject(body, "bms_voltage", bms.get.packVoltage);
JAddNumberToObject(body, "bms_current", bms.get.packCurrent);
JAddNumberToObject(body, "bms_SOC", int(bms.get.packSOC));
JAddNumberToObject(body, "charger_connected", bms.get.chargeState);
JAddNumberToObject(body, "load_connected", bms.get.loadState);
JAddNumberToObject(body, "cell_temp_max", bms.get.tempMax);
JAddNumberToObject(body, "signal_rssi", signal_rssi);
JAddNumberToObject(body, "signal_bars", signal_bars);
}
notecard.sendRequest(req);
}
The issue is that ~75% of the time we see values like 4 bars and -34 dBm, which are sane values given that the hardware is only about 15 feet away from our WiFi access point with nothing blocking/shielding it. However, the other ~25% of the time, bars and rssi are reported as either 0 or 1 bar, and between -80 and -90 dBm. Since the physical orientation of the hardware and access point aren’t changing, I suspect these are errant values due to poor timing. Is the Notecard reporting these rogue values because the readings are ill-timed in relation the radio’s connection cycle? If so, how do we mitigate that so we get consistent/accurate values?
TIA!