Cannot find ledger?

Trying out the new ledger capability. The logging is saying that it cannot find the ledger named blt-ledger even though it is in the console and is mapped as a cloud-device ledger and I have the correct device id on it.

000078073 [system.ledger] INFO: Received ledger info
0000078088 [system.ledger] WARN: Ledger not found: blt-ledger

Here is my test code

#include "Particle.h"

SYSTEM_MODE(AUTOMATIC)

SerialLogHandler logHandler(LOG_LEVEL_INFO);

Ledger patientData; // this will stay in sync with the cloud ledger auto magically

void setup()
{
  patientData = Particle.ledger("blt-ledger");
  Serial.println(System.deviceID());
}

void loop()
{
  auto data = patientData.get();
  if (data.has("UUID"))
  {
    auto value = data.get("UUID");
    Serial.println(value.toString());
  }
}

Hi @iitgrad can you confirm that your ledger is owned by the organization not just the product?

The best way to do this is to go to the root view of your dashboard and click on the ledger icon from there. Do not navigate to ledger from the product view of your dashboard.

If, from the root ledger page, you don't see your ledger, recreate it there.

ah, so this doesn't work from the sandbox?

It does work in the sandbox, but only for devices in a sandbox product. You must add your device to a product in order to use it with ledger.
[That's not true, I was thinking of a different feature, not cloud-to-device ledger.]

1 Like

Interesting, so my device is in a product already, but when I set up the ledger for a specific device it doesn't ask for the product?
Also, I tried creating a ledger at the product level but only two of my 3 products show up in the drop down list to choose from. The product I want has a tag of Photon 2 / P2. The other 2 that show up are Argon and Tracker. Maybe that is the issue?
Is this functionality not yet available for photon 2 even though I am trying out 6.2?

Got it working. Turns out my device was in a product that I could see but must have been shared with me, not my own account. After I created a product and moved the device to this new account was it able to find the ledger.

1 Like

This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.