Design and Application of GPRS and GPS in Automobile Information Service System
[Copy link]
Abstract : This paper analyzes the automobile information service system based on embedded processor (Intel SitSang). The system consists of ARM9 embedded processor module, GPRS module, GPS module, automobile security information collection and internal fault detection module, LCD display module and central station. The paper focuses on the embedded development of GPRS module and GPS module, and how to use these two modules to realize the system functions such as short message sending and receiving, location information collection and electronic map display, location information and automobile status fault information transmission, real-time interaction between users and control center, real-time access and communication of Internet, etc., realizing a feasible solution for intelligent transportation system. Keywords : GPRS; GPS; embedded; AT command; automobile information service system 1. Introduction According to authoritative statistics, by the end of 2003, the number of cars in China was 24,211,615. With the rapid development of China's economy and the continuous improvement of people's living standards, the number of cars in China will inevitably maintain an upward trend for a long time in the future; with the rapid development of information technology, more and more people are beginning to enjoy the convenience brought by information technology; with the further opening of the market and the involvement of international automobile dealers, domestic manufacturers will inevitably consider further improving the cost-effectiveness of domestic cars in the face of competitive pressure, and attract some consumers with good automobile value-added services; at the same time, the number of domestic third-party logistics companies is increasing, but how to improve the quality and transparency of their services is undoubtedly the key to the survival of these companies. It is precisely because of the existence of these factors that value-added information services based on the automotive industry will have broad market prospects. The automotive information service system based on Intel's embedded processor (Sitsang) introduced in this article combines Sony Ericsson's GPRS module and Longxi Electronics' GPS module to complete the collection of GPS positioning data and electronic map display, long-distance large-capacity wireless transmission of GPS positioning data, collection and long-distance wireless transmission of automobile status and fault information, real-time access and communication between the system and the Internet, and real-time contact and control between the system and the car owner. Since a large amount of data needs to be transmitted to the Internet in real time during the implementation of the system, the system fully utilizes the advantages of GPRS general wireless packet: high frequency utilization; high data transmission rate; dynamic link adaptation; users are always online; fast access speed; support for IP protocol, interconnection and intercommunication with data networks; billing based on the flow of transmitted data. And using simple AT commands, you can control the connection between the GPRS module and the fixed IP and the transmission of large amounts of data. 2. Overall system design The whole system mainly consists of four parts: GPRS-GPS unit, vehicle information collection and detection unit VICD (Vehicular Information Collection and Detection), ARM9 embedded processor unit (Intel SitSang) and its peripheral circuits, control center unit CC (Control Center). The overall design block diagram of the system is shown in Figure (I). The GPS module in the GPRS-GPS unit receives satellite positioning data, and can realize real-time positioning navigation of electronic maps on the LCD screen of the vehicle unit and the display screen of the center station at the same time; the GPRS module realizes data exchange between the vehicle unit and the Internet. In addition to positioning data, the exchanged data also includes vehicle security information, vehicle fault information, SMS contact between users and the center station, and various information provided by the center station. The vehicle information collection and fault detection unit VICD realizes the collection of vehicle security information, the user's control of the vehicle through the mobile phone, and the OBDII vehicle fault detection; the ARM9 processor (Intel SitSang) is the control center of the vehicle-mounted unit, and uses the WinCE operating system to realize the vehicle's GPS global positioning and GIS electronic map navigation on the LCD screen and control the coordinated work of various parts; the control center Control Center realizes the tracking and scheduling of networked vehicles and the timely collection, update, feedback, and control of various information.
3. Combined application of GPRS and GPS in vehicle-mounted units 1. GPRS/GPS module The GPRS module uses the GR47 of Sony Ericsson. This module is a new generation of GSM communication module launched by Sony Ericsson, which supports end-to-end and end-to-user communication methods, and supports data transmission and voice calls such as SMS and GPRS. The module provides a very complete use interface, including three-way serial data communication interface, SIM card interface, embedded TCP/IP protocol stack, serial port supports GSM07.10 protocol, baud rate is adjustable, and the default baud rate of AT command is 9.6kbps. UART A of the GPRS module is a full-duplex RS232 port that supports all online and offline communication methods, and all data that need to be sent wirelessly must enter the module's sending unit through this serial port. At the same time, there are control signal lines such as RTS, CTS, DTR, DCD, RI, DSR, etc. on the serial port. The DTR pin is used to control the switching of the data state and command state of the GPRS module from the hardware; UART B can be used to receive some special serial data, such as receiving GPS data or downloading software, and UART B can output the received GPS and other data directly from UART A under the control of AT instructions; UART C is used for embedded development of the module and is generally not used; The GPS module uses DJR10 from Longxi Electronics. The module supports NMEA0183 communication protocol, adopts the latest GPS core technology, and SnapLock technology improves the re-capture performance of the receiving board. Through the pre-stored satellite PRN code, it can quickly capture the satellite and quickly solve the satellite C/A code, which only takes 0.1s. It uses dual RS-232 compatible serial ports, 1200-38.4kbps, and the data format is NEMA V2.0 ASCII/binary, which can be set. The position accuracy is 25m and the speed accuracy is 0.1m/s. 2. The working principle and method of GPRS/GPS in the system The UART A of the ARM9 processor (Intel SitSang) is connected to the UART 1 of the GR47, and the UART B is connected to the vehicle information collection and detection module (VICD). These two connections must be added with a level conversion circuit during actual communication, that is, there is a conversion process between the TTL level and the RS232 level. The connection between GR47 and DJR10 is also connected through the serial port. When GR47 uses the GPRS function to communicate wirelessly with users or central stations, it is divided into active communication and passive communication. In active communication mode, GR47 performs the following tasks under the control of SitSang board: (1) According to the program settings, at a certain interval S, under the control of AT commands, the GPS positioning data is sent to the Internet. The central station directly obtains these positioning data from the Internet and displays electronic maps and navigation on a specific display device; (2) In special circumstances such as theft or damage of the car, GR47 can immediately send these theft and damage information to the central station and the user's mobile phone, so that the central station and the user can make judgments and take necessary protection. In passive communication mode, GR47 will provide the commands received from the central station or the user to the SitSang board. According to these commands, the processor can communicate with the VICD module in time and send the obtained car security status data to the central station or the user's mobile phone; at the same time, after receiving the detection command from the central station or the user, the system directly sends the car's OBDII detection information to the central station through GR47 in a timely manner, guiding the timely maintenance of the car and the maintenance personnel to inspect the car in the event of a fault; in addition, the system will also send request information to the central station according to the user's needs to obtain practical information such as weather conditions and road congestion. The DJR10 module supports the NMEA0183 communication protocol and can receive GPS satellite positioning data in real time with the GPS receiving antenna. After the necessary hardware configuration of DJR10 is performed, as soon as the system is powered on, the module will automatically receive GPS satellite positioning data, and then output it from the data port of the GPS module to the UART 2 of the GR47, so that the GR47 can extract the positioning data at any time. A set of GPS satellite positioning experimental data received during the test: $GPGSV,3,3,12,13,19,268,,28,17,091,,01,08,200,,26,06,310,*73 $GPRMC,133554.999,V,3116.7486,N,12127.1579,E,,,040804,,*15 $GPGGA,133555.999,3116.7486,N,12127.1579,E,0,04,12.6,0.2,M,,,,0000*35 $GPGSA,A,1,03,08,15,19,,,,,,,,,14.9,12.6,7.9*30In the above data, the effective information includes geographic information, satellite information, speed information, time information, system status, etc. In order to extract the effective longitude, latitude, UTC time and other auxiliary information from the received GPS data, the required information can be extracted by identifying a $GPRMC record. According to the format specification of the $GPRMC record in the NMEA0183 communication protocol, it can be known from the above experimental data that the latitude of the test point is 31.167486 degrees north latitude, the longitude is 121.271579 degrees east longitude, the speed is 0 miles per hour (stationary object), and the UTC time is 133555.999. 3. AT control command GPRS module GR47 works in two states: command state and data state. There are two main functions of the command state: (1) sending AT commands; (2) receiving GPS data and related feedback information. The SitSang board sends relevant AT commands to the GR47 module through UART A, which can receive GPS satellite positioning data and connect GR47 to the Internet. System control in command state: (1) Receive GPS data: Send: AT*EENMEA=2; GPRS module activates NMEA service, GPS data is sent from GR47 to the internal buffer of SitSang board through the serial port Feedback: OK; GPRS module return value Send: AT*E2NMPR=3; GPRS module sets the baud rate of GPS data to 4800bps Feedback: OK; GPRS module return value (2) Establish a connection between GR47 and the Internet: Send: AT+CGDCONT=1,"IP","CMNET"; GPRS module activates TCP/IP service Feedback: OK; GPRS module return value Send: AT*E2IPA=1,1; GPRS module obtains a fixed virtual IP address Feedback: OK; GPRS module return value Send: AT*E2IPO=1,"2020"; Connect to the server, the IP address must be an external network address Feedback: CONNECT ;GPRS module return value, which means it has entered the data state. In the process of inputting AT commands in the command state, GR47's feedback is "OK" except "CONNECT" in normal operation. If the feedback is "ERROR", you must resend the relevant command. Data state means that after GR47 feedbacks "CONNECT" information, the GPRS module has established a fixed end-to-end connection path with the server terminal, and both parties can exchange data. At this time, the ARM processor only needs to send the data to be sent to UART A, and the server terminal can receive the data. Of course, the server can also send the corresponding data to the vehicle-mounted unit. However, it must be noted that at this time in the data state, all AT commands are invalid. Even if it is still receiving GPS data, the data cannot be updated because the GPRS module is only connected to the server through UART 1 at this time, and it does not respond to other ports and data. The switch from command state to data state is realized by the above AT commands; the switch from data state to command state is realized by hardware. The ARM processor sends relevant commands to the VICD module through UART B, and the PIC microcontroller sends a high-level pulse to the DTR pin of GR47, so that GR47 automatically switches from data state to command state. At this time, UART A will receive the module's feedback value "OK". In addition, the control of AT commands also realizes the communication and contact between GR47 and the user's mobile phone through short messages. The control instructions are as follows: Send: AT+CMGF=1; Set the SMS mode to TEXT, if the value is 0, it is PDU mode Feedback: OK; GPRS module return value send: AT+CNMI=3,2,0,0,0; Set to receive SMS through SIM card Feedback: OK; GPRS module return value send: AT+CMGS="13********"; Send SMS to the mobile phone with the number 13******** Feedback: >; GPRS module return value AT+CMGS="13********" The effective return value is ">", after receiving this return value, you can enter the content you want to send. After the content is entered, enter "Ctrl+Z" on the keyboard as a sign of completion of sending. At this time, there are two possible return values: +CMGS: 199 indicates successful sending (199 is the return parameter for successful sending); +CMS ERROR: <err> indicates failure to send (<err> is a parameter indicating the reason for failure to send). 4. ARM9 and GPRS real-time communication to achieve the master control function During the real-time communication between ARM9 and GPRS, the following issues should be noted: (1) In addition to OK or ERROR, the feedback information of GPRS to AT commands will also have other characters. When detecting feedback information, the program must be able to strictly distinguish. (2) To implement a certain GPRS function, it is necessary to send multiple AT commands. In order to detect the feedback information of a specific command without error, the buffer must be frequently cleared to ensure that the buffer only contains the feedback information of the most recently sent command during the detection. (3) The system is set to send GPS data every S seconds, but due to network uncertainty, it may not be possible to complete the transmission of GPS data within S seconds, resulting in the system being unable to update the positioning information in time. Therefore, it is necessary to judge the received information in order to make mandatory data requirements. In addition, during the transmission and reception of GPS positioning information and other data, the receiving and sending buffers must be cleared in time to ensure that the data is updated in time. 4. System Testing In the system prototype test, each part works normally and has completed all the technical indicators of the system design. This system adopts the technical idea of combining GPS satellite positioning and GPRS general wireless packet service, which makes good use of the advantages of both: timely and accurate positioning, efficient and fast transmission of a large amount of data, simple hardware circuit design, reasonable serial port transceiver control, etc.; a car anti-theft and fault monitoring system based on the GSM network has been established, which greatly improves the cost performance of the whole vehicle and simplifies the car protection process and car maintenance time; at the same time, ARM9 is used as the processing center of the system, which has fast speed, multiple interfaces, low power consumption, and is intuitive and simple for car users to control on the operating system. The whole system has established an all-round, real-time, accurate and efficient intelligent car information service system between car users, car terminals and remote center stations. At the same time, based on the existing prototype, the development of the upgraded system has added image acquisition, storage, transmission and other technologies, and has truly become an advanced ITS (intelligent transportation system), which undoubtedly has more important practical significance and commercial prospects in today's rapid development of the automobile industry.
|