I got some problems with sending data from SIM800C to a website.
The first, I upload the following codes to Arduino (Use the Serial Monitor in Arduino IDE to send AT command to SIM800 and read the response).
#include <SoftwareSerial.h>
#define TX 10
#define RX 11
#define t 2000
SoftwareSerial mySerial(RX, TX);
int k=0, aS=0, amS=0;
void setup(){
Serial.begin(9600);
while(!Serial); // Wait for Serial ready
Serial.println("Intalizing...");
mySerial.begin(9600);
delay(5000);
mySerial.println("AT"); // Send the first AT command to auto set baud rate
delay(1000);
Serial.println("You can type AT command and send to SIM800 by using Serial Monitor");
}
void loop(){
k=0;
aS=Serial.available(); // aS: The number of bytes available to read from the buff of Serial
amS=mySerial.available(); // amS: The number of bytes available to read from the buff of mySerial
while(aS>0){
mySerial.write(Serial.read());
k=1; aS--;
}
if (k==1){
mySerial.println();
}
while (amS>0){
Serial.write(mySerial.read());
k=2; amS--;
}
delay(1000);
}
Next, I send the AT commands below one by one and view responses. All the AT commands and responses can be seen at the Serial Monitor.
AT+SAPBR=3,1,"Contype","GPRS"
AT+SAPBR=3,1,"APN","m3-world"
AT+SAPBR=3,1,"USER","mms"
AT+SAPBR=3,1,"PWD","mms"
AT+CSTT="m3-world","mms","mms"
AT+SAPBR=1,1
AT+HTTPINIT
AT+HTTPPARA="CID",1
AT+HTTPPARA="URL","http://weatherstation.byethost3.com/"
AT+HTTPDATA=9,10000
value=YOU
AT+HTTPACTION=1
The last response below shows that the data (value=YOU) have been sent successfully.
OK
++HTTPACTION:1,200,839
I have created a website to read data with GET-method. The link below: http://weatherstation.byethost3.com/
My problem is nothing change on the website. That means the website has not read the data sent from SIM800 yet.