I am having issue in sending data to my server hosted on render following is my code
#include <HardwareSerial.h>
#define EC200U_RX 12
#define EC200U_TX 13
HardwareSerial ecSerial(2); // UART2
void sendCommand(String cmd, int wait = 2000) {
ecSerial.println(cmd);
delay(wait);
while (ecSerial.available()) {
Serial.write(ecSerial.read());
}
}
void setup() {
Serial.begin(115200);
ecSerial.begin(115200, SERIAL_8N1, EC200U_RX, EC200U_TX);
delay(5000); // Wait for EC200U to boot
Serial.println("Initializing EC200U...");
// 1. Set APN
sendCommand("AT+QICSGP=1,1,\"airtelgprs.com\",\"\",\"\",1"); // Use your APN
sendCommand("AT+QIACT=1");
sendCommand("AT+QIACT?");
// 2. Enable SSL
sendCommand("AT+QSSLCFG=\"sslversion\",1,4");
sendCommand("AT+QSSLCFG=\"ciphersuite\",1,0XFFFF");
sendCommand("AT+QSSLCFG=\"seclevel\",1,0");
// 3. Setup HTTPS context
sendCommand("AT+QHTTPCFG=\"contextid\",1");
sendCommand("AT+QHTTPCFG=\"sslctxid\",1");
// 4. Set URL to your Render endpoint
sendCommand("AT+QHTTPURL=49", 100);
sendCommand("https://iot-x0kv.onrender.com/api/fuel-data/heptan", 4000); // Adjust length accordingly
// 5. Send POST request
String json = "{\"latitude\":30.7421,\"fuel\":85,\"longitude\":76.7781}";
int payloadLength = json.length();
sendCommand("AT+QHTTPPOST=" + String(payloadLength) + ",60,60", 100);
sendCommand(json, 3000);
// 6. Read response
sendCommand("AT+QHTTPREAD=60", 3000);
}
void loop() {
// nothing here
}
when i am trying to send https on thingsboard it’s working but when i try to do with my server it’s failing and giving +CME ERROR 732.
i checked cipher suites supports of device and it support one of my cipher suite. on tls1.2
as i am runing server on render it don’t require any certificate also.
what could be the problem ?