Continue to Site

Welcome to EDAboard.com

Welcome to our site! EDAboard.com is an international Electronics Discussion Forum focused on EDA software, circuits, schematics, books, theory, papers, asic, pld, 8051, DSP, Network, RF, Analog Design, PCB, Service Manuals... and a whole lot more! To participate you need to register. Registration is free. Click here to register now.

How to read responds from wavecom's modem ?

Status
Not open for further replies.

hasmibaih

Junior Member level 2
Junior Member level 2
Joined
Dec 7, 2013
Messages
23
Helped
1
Reputation
2
Reaction score
0
Trophy points
8
Visit site
Activity points
286
hai,
can you help me how to read responds from wavecom's modem ?
like as when i type "AT" in wavecom modem through hyperterminal, it will respond "ok"
but i use microcontroller in this case and display the respond in LCD

i had done make a program for this case, but it did not complete
the respond is not like as it should be

this is my syntax :
Code:
void main(void)
{
char data[32];
int i;
lcd_clear();
lcd_putsf("Hasmi Baih");
delay_ms(5000);
printf("AT+CSQ");
putchar(10);
putchar(13);
for (i=0;i<32;i++)
data[i]=0; //bersihkan variabel
for (i=0;i<32;i++)
{
data[i] = getchar();
if(data[i]==0x0A)//char enter
break;
}
lcd_clear(); 
lcd_puts(data); 
delay_ms(2000);
}


baudrate between microcontroller and wavecom modem is fine, serial cable is ok
because i can using it for sms gateway
but i can not read responds from wavecom modem

help me please
 

are you sure that the line terminator is 0x0A?

you you look for any control character, e.g.
Code:
if(data[i]<' ')//char enter
break;
 

dear horece1

i had tried scan character from keyboard'input throught hyperterminal, my program is ok
but it doesn't ok when i tried it in wavecom modem

and please tell me about your code, i am a little confused sir
 

dear horece1

i had tried scan character from keyboard'input throught hyperterminal, my program is ok
but it doesn't ok when i tried it in wavecom modem

and please tell me about your code, i am a little confused sir
your code
Code:
if(data[i]==0x0A)//char enter
break;
will only exit the loop on receiving a line feed character

my version
Code:
if(data[i]<' ')//char enter
break;
will exit on any control charcater

what microcontroller are you using? are you sure that the baud rate is correct?
my Fastrack Wavecom is 115200baud but I seem to remember the default is 9600
 

i use microcontroller ATmega 162, and i'm sure that the baud rate is correct, my sim900 is 115200 baud

your code is :
Code:
if(data[i]<'(space)'
break;

right ?
 

i use microcontroller ATmega 162, and i'm sure that the baud rate is correct, my sim900 is 115200 baud

your code is :
Code:
if(data[i]<'(space)'
break;

right ?

yes, in the ASCII code values < space (value 32 decimal or 20)hex are the control characters
https://www.asciitable.com/

so if you receive a control character to loop exists
 

You'll think about suitable debugging means for your problem.
Hardware means:
- an oscilloscope to monitor the Rx and Tx data
- an UART spy adapter that taps Rx and Tx data and send it to a PC, at best two RS232 channels and Docklight software
Software means:
- AVR in system debugger

Regarding possible baudrate problems. The usual way is to utilize modem auto baud function. To make it work, you have to send 'A' and 'T' characters with surrounding pause (delay). printf("AT") doesn't work for auto baud.
 

HTML:
You'll think about suitable debugging means for your problem.
Hardware means:
- an oscilloscope to monitor the Rx and Tx data
- an UART spy adapter that taps Rx and Tx data and send it to a PC, at best two RS232 channels and Docklight software
Software means:
- AVR in system debugger

Regarding possible baudrate problems. The usual way is to utilize modem auto baud function. To make it work, you have to send 'A' and 'T' characters with surrounding pause (delay). printf("AT") doesn't work for auto baud.

dear sir,

so what you mean that when i want to see a respond from Wavecom modem i must give delay each charachters ?
so when i want to know respond from wavecom modem, like as i give AT command like "AT+CSQ"
i must type "A" "delay" "T" "delay" "+" "C" etc.
so wavecom modem will respond my AT command, right?
 

I'm referring to autobaud function. If the modem is not initially setup to the peer's baud rate, it can adjust to it on the first A T characters received. But this works only when the characters are send separately, like typed in at Hyperterminal. Once the baudrate is adjusted, you can send command strings regularly. If you're sure about the initially set baud rate (stored in non-volatile modem settings), you can ignore the autobaud point.
 

Dear FvM
so how i know that the modem is in initially setup to the peer's baud rate or not, sir?

thanks

- - - Updated - - -

Dear horece1,

i had tried with your code, the result is same with output for my code
when i give AT+CSQ to modem wavecom, it replys owed
it should be reply the signal, right?
what's wrong?

thanks
 

Dear horece1,

i had tried with your code, the result is same with output for my code
when i give AT+CSQ to modem wavecom, it replys owed
it should be reply the signal, right?
what's wrong?

thanks
my Wavecom manual says AT+CSQ should give you a strength indication and the channel bit error rate in the form
Code:
+CSQ: <rssi>,<ber>
where an rssi of 99 means not known or not detectable, e.g. no signal
e.g.
Code:
+CSQ: 17,1
OK

your response of owed does nor make any sense (looks like incorrect baud rate)

with regard to baudrate you said in the first post that when you tried with hyperterm AT received a response of OK so I would assume the baud rate you were using then is correct - are you sure the microcontroller baud rate is set up correctly?
 

Dear horece1,

i think the microcontroller baud rate is ok, i set it on 115200,
and i can use it for sms gateway sir, but for scan modem respond, it can not
 

Hello hasmibaih,
you must setting LCD too.
what microcontroller u use? and what compiler for program u use?
 

Status
Not open for further replies.

Similar threads

Part and Inventory Search

Welcome to EDABoard.com

Sponsor

Back
Top