Track note card status and handle failure scenarios

Hi @RobLauer

How to handle below error conditions when adding/calling function
*req = notecard.newRequest(“note.add”);

I observed below error messages and planning to reset the notecard “{“req”:“card.restore”,“delete”:true}: in following error conditions.

[INFO] {“err”:"error adding note: can’t exceed 100 notes per file (currently 100; see note.template)”}

[INFO] {“err”:“error adding note: note cannot be added to outbound queue because voltage indicates device is ‘dead’ {dead}”}

[ERROR] serial-over-i2c: unexpected protocol byte count {io}
[WARN] serial-over-i2c: reattempting to read Notecard response
[ERROR] serial-over-i2c: unexpected protocol byte count {io}
[ERROR] error occured during receive

Hi @Srihari,

Please don’t use the card.restore or card.restart APIs as part of your product’s function. The usage of these will increase wear on flash and also cause you to consume more cellular data (since the Notecard would have to “cold boot” and reestablish a network connection).

Rather, focus on the root causes of these problems:

  1. Use Notefile Templates to avoid the 100 Note limit.
  2. If your voltage is going so low that your device is “dead”, you’ll really want to look at how you are supplying power.
  3. Are you using Notecard WiFi? Those serial-over-i2c errors remind me of issues that were recently fixed in the latest versions of the Notecard firmware.

How to increase Note limit? Do I need to increase memory size?
#3 Using external sim card.

If you’re using Notefile Templates there is no longer a 100 Note limit, so in essence that’s all you have to do to “increase” the Note limit.

Re: the I2C errors, this is a case of double checking your wiring AND making sure other components using I2C aren’t interfering. Feel free to post an image of your wiring so we can check it.

2 Likes

Information not clear.
Below is the sample Notefile templates. I don’t see “increase” configuration field and how can we see existing template configuration?

From the doc referenced above:

…the design of the Notefile system is primarily memory based and designed to support no more than 100 Notes per Notefile.

Some applications, however, will need to track and stage bursts of data that may eclipse the 100 Note limit in a short period of time, and before a sync can occur. For these types of use cases, the Notecard supports using a flash-based storage system based on Note templates.

There is nothing you need to do to eclipse the 100 Note limit if you use templates, there is no longer a limit to worry about.

1 Like

And here is an example of how you view the schema of an existing template, from the note.template API docs:

{
  "req":    "note.template",
  "file":   "readings.qo",
  "verify": true
}
1 Like

Hi Rob, I am seeing duplicate messaages when notecard failed to deliver the messages.
Could you please explain me what happening here and how to handle it?
My apllication is multitasking and each task will send messages continously when their turn up.

My concern is Why it is sending same message multiple times if it fails to deliver to the notehub, it supposed to be send same message not duplicate messages.

Error code:
“crc”:“0109:E85920A3”
“crc”:“0109:F35C6157”
“crc”:“000A:5F59E48B”
“crc”:“000C:7150A922”
“crc”:“000F:7CB890BD”
“crc”:“000C:75BD8C46”
“crc”:“0034:D24E37C9” …

Hi @Srihari - Please take a look at this forum post as it may apply to your project:

Hi @RobLauer I updated notecard firmware to latest version 7.4.2 but still I can see duplicate messages and am using note template. Can you please advise if there is any better solution? And also am exploring to build a rule in the notehub to filter these kind of duplicate messages.

Hi @Srihari,

You’re right, this definitely should not be happening. I’m curious, would you be able to paste in the full JSON for two Notes that are identical? You can find it under the JSON tab when viewing an individual event (feel free to omit the product or any other uniquely identifiable data):