Using Ledger Cloud to Device to provide configuration data

I am wondering how to read a configuration dataset for a device and to know when it has been successfully used to set an EEPROM based struct with settings.

I have tried to use a key "VER" which is initially set to 1 and then have the device update this to 0 once it has read the configuration settings.

If I set VER to 0 like this

void setValueDone()
{
    Variant data;
    Log.info("setValueDone");
    data.set("VER",0);
    cloudconfigurationtodevice.set(data);
}

I get an error

[wiring] ERROR: ledger_open() failed: -2003

Now wonder if this is because Cloud to device ledgers cannot be written to!

Are there any other ways to flag that the Ledger data has been used?

You cannot set it. If you need to acknowledge the receipt you need two ledgers, one cloud to device to send the config and one device to cloud so you can write the receipt flag.

Actually, I'd put a version number in the cloud to device, and then write the same version number in the device to cloud ledger.

1 Like

Very quick reply!

I understand. Thanks

That's very clever! Thanks