I created a device that monitors air quality. The measured data is then sent to a web server using an ESP32 (programmed in C++ with Arduino framework) and SIM800C module, which stores them in an SQLite database.
So, the device is constantly turned on (except the time when the battery is recharged), and in code is used deep sleep to maximise the runtime. Also, all modules, including mentioned SIM800C are put into sleep mode.
The problem is that after three days of the whole device being constantly powered on, SIM800C starts having problems with opening HTTP communication. Those issues started showing up after one or two months of using the module.
I am pretty sure the problem is in the module since replacing it with a brand-new one solved the issue. Probably it is because those modules are not the original ones — they are bought from Aliexpress.
Commands I am using for communicating with the module with responses:
// Disable echoing of commands
> ATE0
< (nothing because the module was sleeping)
// Put module to normal mode
> AT+CSCLK=0
< OK
// Configure bearer profile
> AT+SAPBR=3,1,Contype,GPRS
< OK
> AT+SAPBR=3,1,APN,internet
< OK
// Configure GPRS context
> AT+SAPBR=1,1
< OK
> AT+SAPBR=2,1
< +SAPBR: 1,1,"***.***.***.***"
// Configure HTTP connection
> AT+HTTPINIT
< ERROR (here lies the problem)
> AT+HTTPPARA=CID,1
< OK
> AT+HTTPPARA=URL,http://example.com/post.php
< OK
> AT+HTTPPARA=CONTENT,application/json
< OK
// Upload 18 bytes of data (the value is dynamically changed based on the data in code) and wait for 10000 ms
> AT+HTTPDATA=18,10000
< DOWNLOAD
> {"example":"JSON"}
< OK
// Send an HTTP POST request
> AT+HTTPACTION=1
< OK
// Terminate HTTP connection
> AT+HTTPTERM
< ERROR (HTTP was not started, so it can not be terminated)
// Close GPRS context
> AT+SAPBR=0,1
< +HTTPACTION: 1,601,0 (the correct response should be "OK")
// Put module to sleep mode
> AT+CSCLK=2
< OK
Do you have any idea what could cause those problems?