I have the TEL0124 SIM7600 modem 4G LTE module connected to an Arduino board. will.
While I am able to send AT and get an OK, I would like to use a php to transfer data to the server. I am not able to send any data to the server
void setup()
{
Serial.begin(115200);
Serial1.begin(115200);
sendData("AT+CCID/r", 3000, DEBUG);
sendData("AT+CREG?/r", 3000, DEBUG);
sendData("AT+CGATT=1/r", 1000, DEBUG);
sendData("AT+CGACT=1,1/r", 1000, DEBUG);
sendData("AT+CGDCONT=1,\"IP\",\"TM\"/r", 1000, DEBUG);
sendData("AT+CIPSTART=\"TCP\",\"www.sxxxxde/data2mysql.php?key=xxx",80/r", 2000, DEBUG);
Serial.println("4G HTTP Test Begin!");
}
void loop()
string http_str = "AT+HTTPPARA=\"URL\","HTTPP:www.sxxxxde.de/data2mysql.php?key=xxxx&ID=9999A0200A1300A21024A324A426A510A614A714A828A90A10A110A120"\"\r";
Serial.println(http_str);
sendData("AT+HTTPINIT\r", 2000, DEBUG);
sendData(http_str, 2000, DEBUG);
sendData("AT+HTTPACTION=0\r", 3000, DEBUG);
sendData("AT+HTTPTERM\r", 3000, DEBUG);}
String sendData(String command, const int timeout, boolean debug){
String response = "";
Serial1.println(command);
long int time = millis();
while ( (time + timeout) > millis())
{
while (Serial1.available())
{
char c = Serial1.read();
response += c;
}
}
This is simply an example (written here), but it somewhat illustrates what I am doing. ,sendingg a string of data tto the server via a PHP call.
I want to send data via 4g but as GSM isn't working anymore for my modems SIM800 SIM900. This is why I opted for the 4G LTE version.
Any idea on how to send a string of data stream to the server on 4G?
Any help is much appreciated!
Updated the code