Closed SandroSartoni closed 6 months ago
You may have to increase TINY_GSM_RX_BUFFER
in GSM library.
The rx buffer setting via setBufferSizes
should be larger than your data + some cipher suite.
This depends on the fragmentation supports on server.
If server does not support fragmentation, this buffer should set to 16k which is possible in ESP32.
Hi @mobizt, I have updated both TINY_GSM_RX_BUFFER and setBuffersizes function to have 16384 bytes for the RX buffer but the error still occurs. It does not happen for every transmission, sometimes it goes through just fine while other times it shows the error I reported in the previous post. On another note, a new error that I had never seen before came up in one of the POST requests:
ERROR.mUpdateEngine: Error reading bytes from basic client. Write Error: 0 ERROR.mConnectSSL: Failed to initlalize the SSL layer. ERROR.mConnectSSL: Unknown error code
You're starting SSL connection (SSL handshake) without stopping the current connection which there are some data that is waiting for read.
You have to review your code logic to make it work properly.
Thank you for your reply. I am not sure what you mean by stopping the current connection: the code I reported is taken from one of the sketch examples reported in the library, the "http upgrade" one.
I mean session or TCP session hope you understand.
The session was not re-used in the examples, and it works normally.
The error showed that you start a new connection while the session was opened and the BearSSL engine is in writing or reading for incoming data state. You have to terminate the sever connection before starting new connection.
This is your code logic and timing issue.
The http upgrade is not needed for normal application unless IMAP and SMTP applications.
For GSM module, the simple example is here. https://github.com/mobizt/ESP_SSLClient/blob/main/examples/gsm/gsm.ino
Hi,
I am using the ESP_SSLClient library on a LilyGo TCALL v1.4 with a SIM800H module mounted inside. The project I am working on measures a few parameters (air humidity, temperature and soil moisture), then sends them to a server through HTTPS. I can only rely on GSM, since the place where this board will be installed does not have access to WiFi.
Below is the code I have written:
The issue I am encountering is that from time to time the connectSSL() function fails, and that can happen multiple times in a row thus stalling the whole transmission process. Setting the debug option to 4, this is what I read when such failures occur:
Is it something related to my code/settings? How can I fix this problem? Sometimes the board will be able to connect at the first try and everything goes smoothly, sometimes it takes few retries and other times is completely stuck. I am using the latest version of this library.