I am trying to use a ledger (cloud-to-device) with the tracker-edge firmware (V19), I found an example on Particle Docs. Using this example (Ledger example from Particle docs) on my photon 2 the Ledger worked perfectly however when I try to use it within the tracker-edge firmware on a tracker SoM eval board, the device does not sync to the ledger in the cloud on the console (I am assuming)
I have initialized the ledger as cloud-to-device on the console, put in the correct device ID as it is a device scoped ledger, and made sure that the name of the ledger and the key in the ledger (myData) in the firmware match that of the ledger on the console
The value of the variable "myTestData" does not change from 0 to the value specified in the Ledger, 4 in this case. I know this as the code publishes the value of this variable several times in the loop, the value is always 0.
Not sure if there is a different way I should be using the ledger in the tracker-edge firmware? But to my understanding this should work. Thank you for your time
Since Tracker Edge only works in a product, make sure you first go into your Tracker product, then Cloud Services, then Ledger within the product, not the one at the top level of the sandbox.
Also the USB serial debug log includes some messages when Ledger is synchronized, so getting those logs would be helpful.
Ok that makes sense. I just tried to do that now with the tracker product, but when I click on within the tracker product cloud services I do not get the ledger or logic as an option. I will attach a screenshot below
There is an option for the ledger in my photon 2 product, however that device belongs to me. The tracker project I am working on is on a device owned by another person, could this be why I don't have the option?
Is there something they can do being the owner to get the ledger option there?
Yes, it's because you don't have sufficient permissions in the tracker project. In an organization you could be granted the appropriate permission, but I don't think you can for a sandbox product owned by another user.
What I would do is create a test tracker project in your own account and move your tracker into it temporarily. Once you get everything working you can worry about creating the ledger or permissions.
Sorry bring the issue back to life, however there is now a new problem. After the owner of the device created a ledger for the product, the device was able to access the ledger perfectly, once. I then added some extra code, NO change to the ledger code in the firmware. Once this new firmware was flashed, the device no longer accesses the ledger at all. When I look at the serial monitor, it appears the device tries to find two previous ledgers from a previous firmware that I flashed even though that code is completely removed. No matter what I flash the device tries to access these two ledgers that have been completely removed, even if I flash unchanged tracker-edge version 19 firmware. This is what appears in the serial monitor:
0001846257 [system.ledger] WARN: Ledger not found: pressures-ledger
0001846258 [system.ledger] WARN: Ledger not found: testing
I have NOT tried to access these ledgers at all in the current firmware, I did however in previous firmware. I have reset and re-flashed the device a number of times and the device still tries to access these ledgers.
The latest code I have flashed is that of the first post, which worked after the ledger was declared correctly in the cloud (by the owner in the product)
After a few days now I cannot get it to stop trying to access these ledgers, let alone access the right one which was previously working with the same code. No matter what is flashed it tries to access these ledgers.
Can this be some kind of compilation error? like the compiler not compiling new code and just taking shortcuts by using previous code? or maybe the device flash memory not being updated properly?
It's just a warning and isn't particularly harmful. The issue is that the ledger configuration remains on the device flash after you've flashed new firmware. This is intentional, so if you temporarily flash other firmware then go back to your normal firmware that uses ledgers, the ledger does not have to be downloaded again.
I believe if you flash code that uses different ledgers the old references will be removed.
Ok, I understand. I have flashed the initial code posted when I first opened the topic, and the owner of the device has created the ledger in the product. The device does not find the ledger, and the old ledgers are still not removed.
Have I possibly used the ledger incorrectly in the firmware?
To be more specific, is there a better way to check if the device is finding the ledger within the code?