When using the DeviceInfoLedger by @rickkas7 at GitHub - particle-iot/DeviceInfoLedger and following this app note: Reduce on-site support costs by logging data with Particle’s Device Ledger I have found some odd behavior.
I've set the configuration as such underneath the product:
{
"lastRunLog": 1024,
"connectionLog": 8192,
"logAllConnections": true,
"includeGeneral": true,
"includeDiag": true,
"includeTower": true,
"logLevel": "INFO",
"logFilters": {
"app": "INFO",
"app.network": "TRACE",
"ncp.at": "TRACE"
}
}
Devices will pull the configuration, and it will seemingly work, but no connection log will appear, even after several reconnections. The connection log only appears when a device is reset and goes back through setup (calls ::setup() on the ledger).
This link states it should happen very quickly if the device is online, but if its offline it should occur once reconnection happens: Ledger configuration | Getting Started | Particle
Here is what a device's output looks like pre-resetting.
{
"diag": {
"batt:soc": {
"err": -210
},
"batt:state": 0,
"cloud:connatt": 1,
"cloud:dconn": 0,
"cloud:dconnrsn": 2,
"cloud:err": 0,
"cloud:stat": 2,
"coap:retransmit": 10,
"coap:roundtrip": 361,
"coap:transmit": 308,
"coap:unack": 0,
"net:at": 8,
"net:cell:cgi:ci": 194575284,
"net:cell:cgi:lac": 9998,
"net:cell:cgi:mcc": 310,
"net:cell:cgi:mnc": 410,
"net:connatt": 43,
"net:dconn": 0,
"net:dconnrsn": 7,
"net:err": 0,
"net:sigqual": 22399,
"net:sigqualv": -491520,
"net:sigstr": 7039,
"net:sigstrv": -6815744,
"net:stat": 4,
"pub:limit": 0,
"pwr:src": 0,
"sys:protected": 0,
"sys:tram": 149920,
"sys:uptime": 78463,
"sys:uram": 79168
},
"resetReason": 70,
"sysver": "6.2.1",
"tower": {
"cid": 194575284,
"lac": 9998,
"mcc": 310,
"mnc": 410
}
}
Here is what it will look like once reset:
{
"connLog": ": > AT\n0000009254 [ncp.at] TRACE: < OK\n
REDACTED FOR LENGTH SHORTENING
",
"diag": {
"batt:soc": {
"err": -210
},
"batt:state": 0,
"cloud:connatt": 1,
"cloud:dconn": 0,
"cloud:dconnrsn": 0,
"cloud:err": 0,
"cloud:stat": 2,
"coap:retransmit": 1,
"coap:roundtrip": 302,
"coap:transmit": 16,
"coap:unack": 0,
"net:at": 8,
"net:cell:cgi:ci": 196606991,
"net:cell:cgi:lac": 10003,
"net:cell:cgi:mcc": 310,
"net:cell:cgi:mnc": 410,
"net:connatt": 1,
"net:dconn": 0,
"net:dconnrsn": 7,
"net:err": 0,
"net:sigqual": 19199,
"net:sigqualv": -524288,
"net:sigstr": 10879,
"net:sigstrv": -6422528,
"net:stat": 4,
"pub:limit": 0,
"pwr:src": 0,
"sys:protected": 0,
"sys:tram": 149920,
"sys:uptime": 28,
"sys:uram": 99480
},
"resetReason": 70,
"sysver": "6.2.1",
"tower": {
"cid": 196606991,
"lac": 10003,
"mcc": 310,
"mnc": 410
}
}