0710 the function of the MUX protocol (how to interact with GPRS for at instruction when PPP dials)

Source: Internet
Author: User

It is a problem that PPP dialing enables GPRS to interact with the GPRS module at the same time.


In Linux, PPP dial-up is supported in the kernel and only needs to be selected in the kernel configuration.

The way of PPP dialing enables GPRS to surf the Internet with at command to make GPRS surf the Internet, there is a difference between them. PPP is a package that will be used at the command to make the GPRS online. As long as you have successfully ported PPP to your root filesystem, then you use PPPD call as the equivalent of using the AT command to let GPRS online, the encapsulated part, including some at commands, authentication and some other columns of the process. Finally, the two sides certification through, agreed to give your terminal an IP address, then your terminal can be mobile base station and the other base station of the things to communicate, that is, your terminal at this time on the Internet.


Between PPP and GPRS module through a physical serial port to communicate with each other, here if this serial port is ttyS6, if you use PPPD call method using the TtyS6 this serial port to dial, so that the GPRS module to surf the Internet. This time, your serial port 6 and the socket in the application is related, when you in the application socket communication, the kernel PPP part will be in your socket data through the physical serial port 6 to reach the GPRS module, the GPRS module to send data to the mobile base station, etc. Finally, the mobile base station is routed to the destination address. At this time, the serial port 6 can only be used as network communication, data link communication, then the GPRS module is unable to enter the AT command mode, that is, the application can not send at command and GPRS for at command interaction, because your serial port 6 and GPRS have been used as network communication, So the AT command is not given to the regular meeting. This is a big problem, because you may want to surf the Internet at the same time, you can read the text messages in GPRS, or make voice calls and so on some columns and GPRS between the at interaction. But because your only interface with GPRS to interact with the serial port has been done for the data mode, the AT command can not be interactive.


So this time, there is a thing, this thing is Cmux Protocol (gsm0710) specifically what I am not very clear, multiplexing serial port technology, many SIM card modules are supported by this protocol, you may see in the SIM card details of his support 0710 MUX protocol features. This cmux is a thing between your MCU or SOC and GPRS, it will make your serial port become more than three, it will also make the GPRS module over the other side of the serial port has become multiple. Of course, this change out of the serial port is virtual out, is to use this protocol virtual out of the serial port. This virtual out of the serial port, on your side and GPRS over there is one by one corresponding to the communication between them is the agreement.


At this time, you can use PPP dial using Cmux through the serial port 6 virtual out of the serial port, such as/dev/mux0 as a dial-up network communication with the serial port. can use virtual out of the/dev/mux1 serial port as and GPRS module between the at interaction with the serial port, of course, this virtual out of the serial port and the normal serial port is the same operation, but is used for GPRS. Because GPRS supports this protocol.


The principle of their communication should be this: you in the application through the socket communication, the data went to your dial-up virtual serial port/dev/mux0, this virtual serial port through the GSM0710 protocol, will go to the physical serial port 6, in the GPRS module, because this time, You must have chosen the GPRS module to work under the Cmux, so go to the GPRS module, will also pass this protocol, and then understand that this data is used by the network, and then sent to the network; and when you use another serial port in the application/dev/mux1 with the GPRS module to send the AT command, will also go through the protocol to the physical serial port 6 and then to GPRS, and then through the protocol to the command interaction at. This virtual out of the serial port is time-sharing multiplexing. May be 10ms time to mux1, it may be 10ms time to mux0.


This will enable you to dial the PPP at the same time, but also with the GPRS module at command interaction.


Use of the GSM0710 protocol:

Go online to find and download gsm0710 protocol code, generally four files are enough, generally gsm0710.c and corresponding header files, buffer.c and corresponding header files, it is possible that you download the protocol code without buffer, then you need to continue to look for downloads online.


Download down the protocol code, you can try to compile and build executable program, and then put on the arm board to run, you directly run will see some information about the use of help, etc., according to the reasonable parameters to run successfully after you can see more than two virtual serial port, then you can use, but sometimes, You may compile the chain to deliver the executable program successfully, but you run and did not achieve your effect, it may be you download this protocol code is uploaded people have changed, you can read the whole protocol code, understand the next idea, and then download a copy, in the run try to compare with each other to debug. Finally, you want this protocol code to become a daemon, in the code there is a _DEBUG global variable, set it to 0, you can become a daemon, will be removed debugging information, if it can not become a daemon, it may be the result of others modification.


My simple process of understanding the GSM0710 code:

/dev/modem for your modem device is where your GPRS module is connected with which serial port, the latter is usb,modem you and GPRS connection of the real physical interface, serial port, USB port and so on.

Gets the parameters that you run the program and resolves.

The program opens the/DEV/PTMX device file three times to create a 0,1,2 three virtual serial port that is prefixed with the parameters you have when you run the application.

About the baud rate of the acquisition, can be in the global variable that represents the baud rate of write dead, you can also run the program with parameters, but some people will be in the protocol code to get the baud rate that line of code commented out, you need to get rid of comments, because if not this may cause you to dial the unsuccessful.

Let's deal with the internal data processing that piece, I did not look at, but may be based on the protocol to make the data array frame, and finally through the Write_fram function write data frame, this function name may be wrong, English is not good, then you and GPRS through this Protocol to communicate.


Personal monastic is also very shallow, but his own superficial understanding.

This article from "Whylinux" blog, declined reprint!

0710 the function of the MUX protocol (how to interact with GPRS for at instruction when PPP dials)

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.