blues / sparrow-reference-firmware

The accelerator app for the Sparrow Device Cluster use case.
6 stars 9 forks source link

Note `body` exceeding `MESSAGE_MAX_BODY` causes Sparrow Application Host to become unstable. #12

Closed zfields closed 2 years ago

zfields commented 2 years ago

I'm attempting to send the following Note to Notehub:

{
  "req": "note.add",
  "sync": true,
  "file": "012345678901234567890123#diag.qo",
  "id": 9171979,
  "body": {
    "mem.alloc.bytes": 1004,
    "mem.free.bytes": 888,
    "mem.heap.bytes": 53488,
    "voltage": 3.261
  }
}

"file": value has been expanded from * to demonstrate its actual size

Here are the character count statistics... image

As you can see, even in the best case (177), the Note body is greater than MESSAGE_MAX_BODY (170).

MESSAGE_MAX_BODY is defined in config_radio.h:

#define MESSAGE_MAX_BODY        170      // TIMEOUT:4000 BW:250 SPREAD:12 CODING:4/5 w/LDRO

The crazy thing is that the message arrives at Notehub, but the Sparrow application becomes unstable after it attempts to send the Note.

zfields commented 2 years ago

fix with #14