Need Help with NINA Firmware

Post here about your Arduino projects, get help - for Adafruit customers!

Moderators: adafruit_support_bill, adafruit

Please be positive and constructive with your questions and comments.
Locked
User avatar
cbourg
 
Posts: 1
Joined: Thu May 11, 2023 5:05 pm

Need Help with NINA Firmware

Post by cbourg »

I am in the process of building a Rust-based driver for a Raspberry PI Pico that interfaces with NINA firmware running on an Adafruit Airlift. I have largely been successful in supporting a subset of the NINA firmware functionality (joining WiFi networks, connecting to TCP servers, sending data over TCP, etc.) though I have run into an issue when receiving data from a connected TCP server. The issue is one involving how the NINA firmware chunks data to be consumed by our driver. It occurs for responses (from a connected TCP server) over 5744 bytes.

For TCP responses less than 5744 bytes things work as we expect and we are able to consume the entire TCP response data stream.

The following occurs once we connect to TCP server, dispatch an HTTP request to the server and attempt to consume the response:

Our driver invokes the NINA firmware availDataTcp function which returns the size of the overall response (lets say 6000 bytes) we then invoke getDatBufTcp. On the first invocation of getDataBufTcp we receive a response length of 5744 and our driver proceeds to read 5744 bytes. The driver understands that if the overall length is 6000 and we've read 5744 then we still need to read 256 bytes to consume the entire response. In order to do so we invoke getDataBufTcp again and we receive an error from the NINA firmware. This result seems to be consistent.

Are we perhaps misusing the NINA firmware API?

Thank you so much for any advice or help.

Locked
Please be positive and constructive with your questions and comments.

Return to “Arduino”