Hi,
We've flashed around 10 Borons with a set of code running on 6.1.0. This code has a ledger implementation meant to receive a cloud-to-device ledger update on occasion which updates various configuration settings (a long list, the ledger is 1.2k). Out of this group 2/10 of the devices don't seem to ever receive a ledger update though. They are both registered along with all other devices to receive the ledger, and we alter a parameter or more in the ledger and can see the cloud update the "Last Updated On" timestamp on the ledger, but the registered callback function in firmware never fires (firmware is identical on all 10 units):
deviceConfig = Particle.ledger("test-conf1");
...
// Register onSync callback
deviceConfig.onSync(&LedgerLoader::onLedgerSync);
...
void LedgerLoader::onLedgerSync(particle::Ledger ledger, void* context) {
Serial.println("Ledger sync callback triggered.");
LedgerLoader::instance().load();
LedgerLoader::instance().hasSynced = true;
Particle.publish("ledgerSync", "{\"e\":" + String::format("%x", LedgerLoader::instance().hasSynced) + "}",60, PRIVATE, WITH_ACK);
}
The other 8/10 devices all seem to work fine, receive the ledger, update parameters and function as expected. On the 2 failing devices nothing inside onLedgerSync() seems to fire, which I believe means something is broken between saving the ledger in the cloud and the callback firing.
A couple of questions:
- Can I force a ledger sync from the device in any manner to try to ensure the device is actively receiving the ledger?
- Can I use any debug indication between the ledger update timestamp verification, and the callback verification to trace the failure to receive?
- Is there any device parameter other than the firmware version, ledger registration, ledger content, of device OS that I should check that may be out of sorts on these 2 misbehaving units?
Another anecdotal note, both were previously loaded with other firmware which was replaced with the ledger enabled code. We ran a particle doctor wipe on the main test unit and that didn't seem to fix the issue. ...At the end of my list of ideas now on how to isolate the failure point in the ledger sync communication. Any ideas?