May I ask questions about how the 3G module of ARM-LINUX sends AT commands?

Source: Internet
Author: User
I would like to ask about the ARM-LINUX 3G module to send AT command-Linux general technology-Linux technology and application information, the following is a detailed reading. [I = s] This post was last edited by sdsy1212 at, January 13 ,.

Hello, everyone...
I am new to play ARM-LINUX I mainly do something about 3G module data transmission Shenma...

The current Module I use is SIM5218. It is normal to send AT commands or transmit data on my Ubuntu 12 (3.2.0 ).

However, on OK6410, FOLINX (3.0.1) uses the open function write read to send and receive AT commands, which always results in multiple times or even errors, but can be connected together.

I tried to use Huawei MU509 for another module, and similar problems may occur.

Each time the data sent is "at", it is exactly the command in the AT command (actually the data is sent) after receiving the data, the arm Receiver immediately sent the data as a command from the USB port. The result is a tragedy...

Please give me some advice... Thank you...

The C file is:


WriteCom (CommFd, "ATE0 \ r ");

Sleep (1 );

Printf ("the serial id1 is % d \ n", CommFd );

WriteCom (CommFd, "AT + CGDCONT = 1, \" IP \ ", \" uk.lebara.mobi \ ", 0, 0 \ r ");

Sleep (1 );


WriteCom (CommFd, "AT + CFUN = 1 \ r ");

Sleep (1 );

Sleep (1 );


WriteCom (CommFd, "AT + cmscurl? \ R ");

Sleep (1 );

Sleep (1 );
Flg1:


WriteCom (CommFd, "AT + NETCLOSE \ r ");

Sleep (1 );

Sleep (1 );

Sleep (1 );

Sleep (1 );


WriteCom (CommFd, "AT + NETOPEN = \" TCP \ ", 80, 0 \ r ");

Sleep (1 );

Sleep (1 );

Sleep (1 );

Sleep (1 );


WriteCom (CommFd, "AT + TCPCONNECT = \" xxx. xx. xx. xxx \ ", 16882 \ r ");


While (1)

{Read (CommFd, buf, sizeof (buf ));

Printf ("% s", buf );

If (strstr (buf, "RING "))

{Sleep (1 );


WriteCom (CommFd, "ATA \ r ");

Sleep (1 );}

If (strstr (buf, "IPCLOSE "))

{Goto flg1 ;}

Memset (buf, 0,160 );

}


The symptoms are sorted as LOG:

[Root @ FORLINX6410] #./sdcard/arm-
Start
Argv = (null)
Argc = 1
Id is 3, device port is 3
The serial id1 is3


Network opened



OK

AT + CGDCONT = 1, "IP", "uk.lebara.mobi", 0, 0


OK

AT + CGDCONT = 1, "IP", "uk.lebara.mobi", 0, 0


OK

(More than 20 times)

AT + CGDCONT = 1, "IP", "uk.lebara.mobi", 0, 0


OK

AT + CGDCONT = 1, "IP", "uk.lebara.mobi", 0, 0


OK
AT + CGDCONT = 1, "IP", "uk.lebara.mobi", 0, 0


OK

AT + CGDCONT = 1, "IP", "uk. lecon. mobiAT + CFUN = 1


ERROR

AT + CGDCONT = 1, "IP", "uk. lecon. mobiAT + CFUN = 1


ERROR

AT + CGDCONT = 1, "IP", "uk. lecon. mobiAT + CFUN = 1


ERROR

AT + CGDCONT = 1, "IP", "uk. lecon. mobiAT + CFUN = 1


ERROR

(This appears more than 50 times)

AT + CGDCONT = 1, "IP", "uk. lecon. mobiAT + CFUN = 1


ERROR

AT + CGDCONT = 1, "IP", "uk. lecon. mobiAT + CFUN = 1


ERROR

AT + CGDCONT = 1, "IP", "uAT + cmscurl?


ERROR

AAT + CFUN = 1


OK

AT + CGDCONT = 1, "IP", "uAT + cmscurl?


ERROR

AT + NETOPEN = "TCP", 80, 0


+ Ip error: Network is already opened



ERROR

AT + TCPCONNECT = "xxx. xx. xx. xxx", 16882


Connect OK



OK


Recvs FROM: xxx. xx. xx. xxx: 16882

+ IPD6

123456



Recvs FROM: xxx. xx. xx. xxx: 16882

+ IPD3

Ata

Ata


NO CARRIER

Ata


NO CARRIER

Ata


NO CARRIER

Ata


NO CARRIER

Ata


NO CARRIER

Ata


NO CARRIER

Ata


NO CARRIER

Ata
(Ata no carrier will appear continuously)
Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.