I am writing code for ESP8266 which connects SIMCom 76xx to get data using HTTP. That's my code:
SoftwareSerial gsm(14, 12); // RX, TX
void setup() {
Serial.begin(115200); //Serial of ESP
gsm.begin(115200); //SIMCom's serial, configured by SoftwareSerial
/* orther code/*
}
void loop {
String http_str = "AT+HTTPPARA=\"URL\",\"http://api.openweathermap.org/data/2.5/weather?xxxxxxxx\"\r\n";
/* xxxxxx is longitude, latitude and apikey */
sendD("AT+HTTPINIT\r\n", 4000, DEBUG);
sendD(http_str, 6000, DEBUG);
sendD("AT+HTTPACTION=0\r\n", 5000, DEBUG);
sendD("AT+HTTPTERM\r\n", 3000, DEBUG);
}
String sendD(String command, const int timeout, boolean debug)
{
/* It helps me to send AT command to SIMCom (gsm serial) and read information from gsm serial to display on serial monitor */
}
My code have problem at sendD(http_str, 6000, DEBUG) <=> (AT+HTTPPARA).
When I open Serial monitor, I see ⸮⸮⸮⸮
. Example:
AT+HTTPPARA="URL","http://api.openw⸮
AT+HTTPPARA="URL","http://api.openw⸮athermap.org"
I want to send a code to gsm and display it on the monitor as:
AT+HTTPPARA="URL","http://api.openweathermap.org/data/2.5/weather?xxxxxxxxxx"
It works correctly because I tested in the software "AT Command Test"
`⸮⸮⸮⸮ causes my code to have a URL error. How should I solve it? Thank you!