I am trying to send messages to the Notecard via the serial port. It works fine when the body is 1 kB or a bit over, but the message I am trying to send is about 2,100 bytes. When I send that I get an error:
The string in the error message occurs about 1500 bytes into he message. The message body contains three fields; An Id field of 32 characters, one numeric value and 2060 characters representing hex bytes.
Is there a limitation on the size of the message, or a a single field within the body?
The problem does not exist when I am connected to the Notecard using the USB virtual serial port on the notecarrier. The message is queued with no problem.
The problem occurs when I have a SiLabs virtual serial port connected to N_RX and TN_TX. Is that the correct port to be using?
I would recommend using a Note Template (if you aren’t already) which will help to optimize the physical size of your Notes. Are you sending a single Note or multiple Notes of this size at once?
The good news is that we have a new feature coming in the next Developer Release of the Notecard firmware that will help immensely when sending large payloads like this.
Thanks for your reply. I am currently not using templates, although the application may support them. The message contains a success code and a the hex content. The hex content may be empty, about 100 bytes or 2062 bytes. There may be up to 13 messages in a total job, but it is usually one or two.
The content is data from a temperature logger. It is usually downloaded twice a day. If it has been unattended for weeks it will have up to 13 pages of data. Do you have any idea how many 2200 byte messages I can queue up before syncing?
I don’t understand templates very well. I have only been working with Blues for a few days, having failed to get [the P word} to work despite trying for several weeks.
I got my STLINK-V3Minie just now. I will move the Arduino code I have been using over to the Swan and see if I still have problems.
There is roughly 1MB of user-addressable flash available on the Notecard, so in theory that’s ~450 2200 byte Notes. In this scenario you’ll be far better off using templates as you’ll save space on the Notecard and in transit.
My first priority is getting a solution working. I am late delivering if because of the time I wasted on another IOT platform provider. Once I prove Blues works I will look at templates.
I am struggling with the documentation. I am somewhat on the spectrum and some of it is pretty opaque to me. Also there are gaps in it that experienced users would not notice. Are there any code examples for setting up templates?
@RobLauer@gwolff Despite using templated notes, I still see this same error ("err":"JSON object expected: … {io} at around 1500 bytes, when sending data via UART. This is on LTS Firmware 6.2.5.16868. If you’re able to provide any additional guidance privately or publicly, it would be greatly appreciated
This error likely doesn’t have anything to do with whether the Note is templated or not, but rather that the Notecard didn’t receive a complete JSON object over UART (meaning your transmission got truncated or wasn’t properly delimited). Are you using one of our SDKS (like note-c, note-arduino, or similar)?
I think for large Notes like this you’d be much better served to use the web.post API instead as it’s far more efficient:
Hi Rob, I was able to scope on my logic analyzer and it doesn’t seem to be a truncation or delimiter issue. However, updating to newer notecard firmware seemed to resolve the issue.