Hello all.
I am trying to communicate with a GSM modem at a baudrate of 115200 but I get wrong characters. The maximmum bauderate I can read is 57600.
Is this normal?
Your help is appreciated.
regards,
Manuel
Hello all.
I am trying to communicate with a GSM modem at a baudrate of 115200 but I get wrong characters. The maximmum bauderate I can read is 57600.
Is this normal?
Your help is appreciated.
regards,
Manuel
What else is your sketch doing? Is it a 16mhz board or 8mhz? If 8, I think 57600 is the best you can do.
Software serial is always going to be a little flakier than real hardware serial, it's probably best to not try to push it.
DrAzzy, thanks for your reply.
It is an Arduino Mega2560 (16 MHz). It is waiting for input, nothing else.
Thanks.
Manuel
It's a mega? then why use software serial?
You have 4 hardware UARTs to choose from (one is used for communicating with the computer), and they work much, much better than software serial.
(Serial, Serial1, Serial2, Serial3, the first being connected to the USB serial adapter)
The sketch is to be used in an Arduino Uno and I need the hardware serial port for debug.
Any way thanks for your inputs I may change it for the mega.
Manuel
Aaah I see.
I mean, it should work according to documentation on SoftwareSerial, but it sounds like it's not able to keep up at 115200...
Software serial is always kinda flaky. I avoid it like the plague.
DrAzzy thanks for your inputs.
Regards,
Manuel
Sometimes you can look up the charcodes of the gibberish you get, and the characters it's supposed to be, and figure out what it's doing wrong - though the usefulness of this is debatable, as software serial library is not exactly easy to modify at home.
(meant to edit this into above post, and wrote it right after, but I didn't hit post)
Maybe the GSM modem has not so big transmit-receive rate and when you send characters so fast is not able to save them, there is no more space in its buffer, and the characters lost!!!
I guess ![]()
The modem takes about 350ms to answer and I changed also the buffer size in the SoftwareSerial library to 128 bytes.
I send an AT command and immediately I go see the answer and wait for it 500ms. With a baud rate of 57600 it already works OK.
I think it is a response problem of the softwareserial. I would like to know if some one had the same problema and how solved it.
Thanks and regards,
Manuel
I too have a GSM modem with 115kbaud default speed. It almost worked with Mega2560. In my modem there was an AT command to lower the speed, after I did that I had no problems.
BY the way: I used HW serial 3 or so.
Software serial will not work at 115200,
see my experiments & tests here - SoftwareSerial magic numbers - Libraries - Arduino Forum