Hi. My goal is to send packets with Mongoose OS on an ESP8266 that are larger than the available memory.
It appears to me that the Mongoose OS API is structured in such a way that you must fit an entire packet (HTTPS in my case) in memory in order to send it. In our application, multiple messages are not an option, so I need the means of providing data to the system in a way that it will transmit partial data until the packet is complete. The data to be sent is from a larger external memory.
Is there a way to do so in the API, and I just missed it? Can I somehow go straight to the Mongoose API for providing partial data?
Searches in this forum for “send large packet” show one topic, but that author was able to divide the data into multiple packets.
Thanks, Asondo. I will take a look at those. I did fail to say originally that this is an HTTPS client application. Saving to a file is not an option for us due to very long term flash memory issues, but I’ll look to see how it is done. The principle is probably the same.
Update: The file upload does multipart transfers, which means each part of a file is sent as a separate packet. So that is not sufficient for my needs. The fwrite() in the client example is just to print a received message body to stdout rather than writing to the packet stream.
Do you really need to send everything in a single packet? Or do you really just want to open a socket connection and then close the connection when the “large packet” is complete?
It has to be in a single HTTPS put. I don’t think I can close the socket when the packet is complete because we need to get a response.
This is for an AWS S3 upload application. Suppose we have data that is 1 MiB in length. We cannot use S3 multipart upload because it has a minimum chunk size of 5 MiB. But we cannot use Mongoose/Mongoose OS as I understand it so far because you cannot fit a 1 MiB packet in ESP8266 memory. Seems like a fundamental problem in Mongoose’s packet model.