GSM GPRS A6
why getting garbage output in serial monitor (image attached)?
i trying send data web server using gsm gprs a6, in doing so, getting garbage output in serial monitor.
here code:
#include <softwareserial.h>
softwareserial mygsm(7,8);
void setup()
{
mygsm.begin(115200);
serial.begin(9600);
delay(500);
mygsm.println("at+cipshut");
delay(1000);
printserialdata();
mygsm.println("at+cipmux=0");
delay(2000);
printserialdata();
mygsm.println("at+cgatt=1");
delay(1000);
printserialdata();
mygsm.println("at+cstt=\"internet\",\"\",\"\"");//setting apn,2nd parameter empty works networks
delay(5000);
printserialdata();
mygsm.println();
mygsm.println("at+ciicr");
delay(6000);
printserialdata();
mygsm.println("at+cifsr"); //init http request
delay(2000);
printserialdata();
mygsm.println("at+cipstart=\"tcp\",\"159.203.180.107\",\"80\"");
delay(5000);
printserialdata();
delay(5000);
mygsm.println("at+cipsend");
delay(2000);
printserialdata();
mygsm.println("data sent gprs gsm a6 using arduino!!!");
mygsm.write(0x1a); //0x1a
delay(3000);
mygsm.println("at+cipclose");
printserialdata();
mygsm.println("at+cipshut");
delay(1000);
printserialdata();
}
void loop()
{
}
void printserialdata()
{
while(mygsm.available()!=0)
serial.write(mygsm.read());
}
i trying send data web server using gsm gprs a6, in doing so, getting garbage output in serial monitor.
here code:
#include <softwareserial.h>
softwareserial mygsm(7,8);
void setup()
{
mygsm.begin(115200);
serial.begin(9600);
delay(500);
mygsm.println("at+cipshut");
delay(1000);
printserialdata();
mygsm.println("at+cipmux=0");
delay(2000);
printserialdata();
mygsm.println("at+cgatt=1");
delay(1000);
printserialdata();
mygsm.println("at+cstt=\"internet\",\"\",\"\"");//setting apn,2nd parameter empty works networks
delay(5000);
printserialdata();
mygsm.println();
mygsm.println("at+ciicr");
delay(6000);
printserialdata();
mygsm.println("at+cifsr"); //init http request
delay(2000);
printserialdata();
mygsm.println("at+cipstart=\"tcp\",\"159.203.180.107\",\"80\"");
delay(5000);
printserialdata();
delay(5000);
mygsm.println("at+cipsend");
delay(2000);
printserialdata();
mygsm.println("data sent gprs gsm a6 using arduino!!!");
mygsm.write(0x1a); //0x1a
delay(3000);
mygsm.println("at+cipclose");
printserialdata();
mygsm.println("at+cipshut");
delay(1000);
printserialdata();
}
void loop()
{
}
void printserialdata()
{
while(mygsm.available()!=0)
serial.write(mygsm.read());
}
you running softwareserial gsm modem @ 115200 baud
i have found in practice softwareserial looses/corrupts information above 38400baud or 57600baud (depends on board)
also serial output 9600 baud tend loose information if gsm 115200baud if i/o buffers fill up - try serial @ 115200baud
i recommend reducing gsm baud rate or using arduino serial hardware ports sush mega
i have found in practice softwareserial looses/corrupts information above 38400baud or 57600baud (depends on board)
also serial output 9600 baud tend loose information if gsm 115200baud if i/o buffers fill up - try serial @ 115200baud
i recommend reducing gsm baud rate or using arduino serial hardware ports sush mega
Arduino Forum > Using Arduino > Networking, Protocols, and Devices (Moderator: fabioc84) > GSM GPRS A6
arduino
Comments
Post a Comment