# Note Red Sample Application

**URL:** <https://discuss.blues.com/t/note-red-sample-application/103>\
**Category:** Tools & SDKs\
**Created:** [January 15, 2021, 6:29pm UTC](https://discuss.blues.com/t/note-red-sample-application/103 "2021-01-15T18:29:02Z")\
**Posts on this page:** 11\
**Page:** 2

<div class="post-metadata">

**Author:** ![leehouse](https://avatars.discourse-cdn.com/v4/letter/l/cc9497/32.png) [@leehouse](https://discuss.blues.com/u/leehouse)\
**Post date:** [February 2, 2021, 12:15am UTC](https://discuss.blues.com/t/note-red-sample-application/103/21 "2021-02-02T00:15:20Z")

</div>

Thanks, that helps in understanding the syntax, however, I am still having problems.

If I send short messages to the notecard things seem to work fine, but if I have multiple values in the JSON (4 sometimes works, 10 almost never works (but I can get “lucky”)) the transaction fails and I get this message in the terminal: (node:17838) UnhandledPromiseRejectionWarning: Unhandled promise rejection. This error originated either by throwing inside of an async function without a catch block, or by rejecting a promise which was not handled with .catch(). To terminate the node process on unhandled promise rejection, use the CLI flag `--unhandled-rejections=strict` (see [Command-line options | Node.js v15.7.0 Documentation](https://nodejs.org/api/cli.html#cli_unhandled_rejections_mode)). (rejection id: 356)

Per this message, the issue seems to be with the I2CTransactor.

---

<div class="post-metadata">

**Author:** ![leehouse](https://avatars.discourse-cdn.com/v4/letter/l/cc9497/32.png) [@leehouse](https://discuss.blues.com/u/leehouse)\
**Post date:** [February 2, 2021, 12:16am UTC](https://discuss.blues.com/t/note-red-sample-application/103/22 "2021-02-02T00:16:22Z")

</div>

If I take the same JSON object format and shorten it to only include ,say, 2 name value pairs it works.

---

<div class="post-metadata">

**Author:** ![gwolff](https://avatars.discourse-cdn.com/v4/letter/g/a88e57/32.png) [@gwolff](https://discuss.blues.com/u/gwolff)\
**Post date:** [February 2, 2021, 2:23am UTC](https://discuss.blues.com/t/note-red-sample-application/103/23 "2021-02-02T02:23:15Z")

</div>

Hi Lee. Thanks very much. I’ll expect to take a deeper dive tomorrow afternoon.

I know what error message isn’t caught. I know why the error is thrown. But I’m not sure yet why the condition that the error message is thrown by is occurring. I’ll keep you updated on my progress.

---

<div class="post-metadata">

**Author:** ![gwolff](https://avatars.discourse-cdn.com/v4/letter/g/a88e57/32.png) [@gwolff](https://discuss.blues.com/u/gwolff)\
**Post date:** [February 2, 2021, 5:41pm UTC](https://discuss.blues.com/t/note-red-sample-application/103/24 "2021-02-02T17:41:16Z")

</div>

I have been able to reproduce the issue. Working on figuring out the cause.

---

<div class="post-metadata">

**Author:** ![leehouse](https://avatars.discourse-cdn.com/v4/letter/l/cc9497/32.png) [@leehouse](https://discuss.blues.com/u/leehouse)\
**Post date:** [February 2, 2021, 7:21pm UTC](https://discuss.blues.com/t/note-red-sample-application/103/25 "2021-02-02T19:21:31Z")

</div>

Thanks! Sounds great.

---

<div class="post-metadata">

**Author:** ![gwolff](https://avatars.discourse-cdn.com/v4/letter/g/a88e57/32.png) [@gwolff](https://discuss.blues.com/u/gwolff)\
**Post date:** [February 2, 2021, 7:48pm UTC](https://discuss.blues.com/t/note-red-sample-application/103/26 "2021-02-02T19:48:00Z")

</div>

Found one issue where the I2C was sending message chunks too rapidly. When a message exceeds 253 bytes, it has to be chunked. I initially had the chunks stacking on top of each other on the Notecard.

I’m refactoring now to handle including delay between sending message chunks. I’ll update once that’s complete.

---

<div class="post-metadata">

**Author:** ![gwolff](https://avatars.discourse-cdn.com/v4/letter/g/a88e57/32.png) [@gwolff](https://discuss.blues.com/u/gwolff)\
**Post date:** [February 2, 2021, 8:37pm UTC](https://discuss.blues.com/t/note-red-sample-application/103/27 "2021-02-02T20:37:49Z")

</div>

Pushed update to Node Red repo v1.0.1 :

> **[node-red-contrib-notecard](https://flows.nodered.org/node/node-red-contrib-notecard)**
>
> A Node-RED node to talk to the Notecard via Raspberry PI's I2C port

---

<div class="post-metadata">

**Author:** ![leehouse](https://avatars.discourse-cdn.com/v4/letter/l/cc9497/32.png) [@leehouse](https://discuss.blues.com/u/leehouse)\
**Post date:** [February 3, 2021, 6:17am UTC](https://discuss.blues.com/t/note-red-sample-application/103/28 "2021-02-03T06:17:38Z")

</div>

This upgrade is more reliable, but stressing it with and object with 11 attributes, I get this message:  
(node:1154) UnhandledPromiseRejectionWarning: Unhandled promise rejection. This error originated either by throwing inside of an async function without a catch block, or by rejecting a promise which was not handled with .catch(). To terminate the node process on unhandled promise rejection, use the CLI flag `--unhandled-rejections=strict` (see [Command-line options | Node.js v15.8.0 Documentation](https://nodejs.org/api/cli.html#cli_unhandled_rejections_mode)). (rejection id: 8)

The upgraded node handles more name:value pairs / JSON, but still seems to have issues with pacing on the I2C or with data ingestion on the notecard … just my guess!

Best,

Lee

---

<div class="post-metadata">

**Author:** ![leehouse](https://avatars.discourse-cdn.com/v4/letter/l/cc9497/32.png) [@leehouse](https://discuss.blues.com/u/leehouse)\
**Post date:** [February 3, 2021, 6:19am UTC](https://discuss.blues.com/t/note-red-sample-application/103/29 "2021-02-03T06:19:03Z")

</div>

Oh, sorry, and with smaller JSON uploads, I get the ack { total: x }, but with larger JSON objects this does not occur & I get the console message above.

---

<div class="post-metadata">

**Author:** ![gwolff](https://avatars.discourse-cdn.com/v4/letter/g/a88e57/32.png) [@gwolff](https://discuss.blues.com/u/gwolff)\
**Post date:** [February 4, 2021, 10:48pm UTC](https://discuss.blues.com/t/note-red-sample-application/103/30 "2021-02-04T22:48:21Z")

</div>

@leehouse  
Able to reproduce the issue you are still experiencing. Not sure the reason why the is failing. Digging in now.

---

<div class="post-metadata">

**Author:** ![gwolff](https://avatars.discourse-cdn.com/v4/letter/g/a88e57/32.png) [@gwolff](https://discuss.blues.com/u/gwolff)\
**Post date:** [February 5, 2021, 1:19pm UTC](https://discuss.blues.com/t/note-red-sample-application/103/31 "2021-02-05T13:19:18Z")

</div>

Resolved with a Notecard firmware upgrade. Build 12432 or later. Currently requires Blues Support staff to enable this upgrade. Please email [support@blues.com](mailto:support@blues.com) and reference this thread on the forum.

I may enhance the Node Red Notecard Config node to enable a workaround that seems to avoid the issue. I will post here if I do include that enhancement.

[Previous page](https://discuss.blues.com/t/note-red-sample-application/103.md?page=1)
