I am having a strange issue where if I try and create a TCP connection to my service, it doesn't work. But any other website, such as google, works fine. The serial monitor output is also slightly different, but I cannot see any difference in the code. I am using this module for communications.
This is the method that I am using:
void SendPost()
{
Serial1.println("AT+CGATT?");
delay(1000);
ShowSerialData();
Serial1.println("AT+CSTT=\"everywhere\"");//start task and setting the APN,
delay(1000);
ShowSerialData();
Serial1.println("AT+CIICR");//bring up wireless connection
delay(3000);
ShowSerialData();
Serial1.println("AT+CIFSR");//get local IP adress
delay(2000);
ShowSerialData();
Serial1.println("AT+CIPSPRT=0");
delay(3000);
ShowSerialData();
Serial1.println("AT+CIPSTART=\"tcp\",\"www.google.com/\",\"80\"");//start up the connection //https://rocky-garden-56471.herokuapp.com/breadcrum/lifecycle/register
delay(5000);
ShowSerialData();
Serial1.println("AT+CIPSEND");//begin send data to remote server
delay(4000);
ShowSerialData();
Serial1.println("{\"device_info\":\"breadcrum-prototype-a\"}");
delay(500);
ShowSerialData();
Serial1.println((char)26);//sending
delay(5000);//waitting for reply, important! the time is base on the condition of internet
Serial1.println();
ShowSerialData();
Serial1.println("AT+CIPCLOSE");//close the connection
delay(100);
ShowSerialData();
}
Using 'www.google.com' I get an OK upon tcp connection (with an expected error on the data as I try to POST):
Setup CompleteAT+CGATT?
+CGATT: 1
OK
AT+CSTT="everywhere"
OK
AT+CIICR
OK
AT+CIFSR
100.66.4.95
AT+CIPSPRT=0
OK
AT+CIPSTART="tcp","www.google.com/","80"
OK
STATE: IP STAAT+CIPSEND
ERROR
{"device_info":"breadcrum-prototype-a"}
AT+CIPCLOSE
ERROR
But using the address I actually want to post data to (https://rocky-garden-56471.herokuapp.com/breadcrum/lifecycle/register), it cannot connect and I get this:
Setup CompleteAT+CGATT?
+CGATT: 1
OK
AT+CSTT="everywhere"
OK
AT+CIICR
OK
AT+CIFSR
100.66.4.95
AT+CIPSPRT=0
OK
AT+CIPSTART="tcp","https://rocky-garden-56471.herokuapp.com/breAT+CIPSEND
ERROR
{"device_info":"breadcrum-prototype-a"}
AT+CIPCLOSE
ERROR
This errors on connection, and you can also see that the full address isn't printed out for some reason. Does anyone have any idea what could be causing this issue?
Thanks ![]()