Home/Support/Support Forum/Receving String correctly on RS232
Welcome to Digi Forum, where you can ask questions and receive answers from other members of the community.

Receving String correctly on RS232

0 votes
Hi,

i'm making a software with an RCM3700 module to communicate with a GPRS modem using AT commands.

I've experiencing some problems during receiving.
Sending a request for inserting PIN i'm sending:

"AT+CPIN=7159\x0d\x0a" the modem is doing what expected but i cannot parse the response.

The supposed response is: "0\r" the first time a send the command and "4\r" next times (because the pin is already given)

Unfortunately the response I receive is different every time I send the command. Sometimes "null" other times "šÃšÃ" rarely the correct answer

serDopen(115200);
serDflowcontrolOff();
serDwrite("AT+CPIN=XXXX\x0d\x0a",15);
serDread(buffer,80,2000)

the last two lines are in a costate it shouldn't be a problem I think...


anyone has any advice
asked May 26, 2014 in Rabbit by nicola.pasquali New to the Community (0 points)

Please log in or register to answer this question.

1 Answer

0 votes
Have you tried sending just the command characters? You are specifying 15 characters instead of 14, and the null at the end might be confusing the modem.
answered Feb 3, 2015 by RonBeck62a New to the Community (19 points)
...