【正文】
IM 卡的 IMSI 號,進(jìn)行數(shù)據(jù)傳輸。 串口驅(qū)動(dòng) 由于數(shù)據(jù)終端是用單片機(jī)實(shí)現(xiàn)的,必須從底層的串口通信開始逐漸實(shí)現(xiàn) GPRS登錄,最終實(shí)現(xiàn)數(shù)據(jù)的傳輸,串口驅(qū)動(dòng)實(shí)現(xiàn)打開串口( OpenComm)、關(guān)閉串口( CloseComm)、讀串口數(shù)據(jù)( ReadComm)、向串口寫數(shù)據(jù)( WriteComm)、串口中斷( Interrupt UartRxISR)等。 登錄 GPRS 網(wǎng)絡(luò) 通過 GPRS Modem 支持的 AT命令集對其進(jìn)行初始化設(shè)置,初始化設(shè)置成功后即可進(jìn)行撥號連接, GPRS Modem 的初始化及撥號過程如下: AT+IPR=38400; //把波特率設(shè)置為 38400b/s,默認(rèn)值為 9600b/s。 AT+CGCLASS=“B” ; //設(shè)置移動(dòng)終端的類別為 B類,即具有 GPRS 上網(wǎng)和 GSM 語音功能,但二者不能同時(shí)使用, 可自動(dòng)切換。 AT+CGDCONT=1, “IP” , “CMNET” ; //設(shè)置 GPRS 接入網(wǎng)關(guān),如果 Modem 返回 “310D” 則表示初始化成功。 發(fā)送 “ATDT*99***1” 若 Modem 返回 “310D” 則表示成功接通 GPRS 網(wǎng)絡(luò)。 網(wǎng)絡(luò)協(xié)商 GGSN 和 Modem 通信時(shí)遵循 PPP 協(xié)議, Modem 撥號后首先要與 GGSN 進(jìn)行通信鏈路的協(xié)商,即進(jìn)行點(diǎn)到點(diǎn)的各種通信鏈路的參數(shù)配置,協(xié)商過程遵循 LCP、 PAP、 CHAP、IPCP 等協(xié)議,其中 LCP 用于建立、構(gòu)造、測試鏈路連接, PAP 或 CHAP 用于處理密碼 驗(yàn)證部分; IPCP 協(xié)議用于設(shè)置網(wǎng)絡(luò)協(xié)議環(huán)境,并 分配 IP 地址。 Modem 接收到 IP后將其存入數(shù)據(jù)終端的配置地址域,數(shù)據(jù)終端向數(shù)據(jù)中心發(fā)送配置后的數(shù)據(jù)幀,告知其動(dòng)態(tài) IP地址和 IMSI 號,數(shù)據(jù)中心存儲(chǔ)收到的信息,作為下傳數(shù)據(jù)的聯(lián)絡(luò)信息。 傳輸數(shù)據(jù) 網(wǎng)絡(luò)協(xié)商之后即可進(jìn)行數(shù)據(jù)傳送, GPRS 網(wǎng)絡(luò)支持 TCP/IP 協(xié)議,所以通過收發(fā)IP數(shù)據(jù)包來傳送數(shù)據(jù),此時(shí),終端系統(tǒng)向 GGSN 發(fā)送的所有包含 IP 報(bào)文的 PPP 報(bào)文都會(huì)被傳送給 Inter 網(wǎng)中相應(yīng)的 IP 地址,從而完成終端系統(tǒng)向遠(yuǎn)程監(jiān)控中心通過互聯(lián)網(wǎng)傳輸數(shù)據(jù)的過程 。 系統(tǒng)實(shí)現(xiàn)的一個(gè)難點(diǎn)是登錄 GGSN 的過程,即終端系統(tǒng)登錄 GPRS 網(wǎng)關(guān)( GGSN)并與網(wǎng)關(guān)通過 LCP, PAP, IPCP 協(xié)議進(jìn)行協(xié)商的過程。 網(wǎng)絡(luò)協(xié)商過程是一個(gè)復(fù)雜的過程,協(xié)商過程大致如下,在撥號成功連接后 GPRS網(wǎng)關(guān)首先會(huì)返回一個(gè) PAP REQ 幀,我們發(fā)送一個(gè)空 LCP REQ 幀,以強(qiáng)迫進(jìn)行協(xié)議協(xié)商階段,隨后, GPRS 網(wǎng)關(guān)發(fā)送 LCP 設(shè)置幀,我們拒絕所有的設(shè)置并請求驗(yàn)證模式,GPRR 網(wǎng)關(guān)選擇 CHAP 或 PAP 方式驗(yàn)證,我們只接受 PAP 方式,然后進(jìn)行 PAP 驗(yàn)證用戶名或密碼過程,如果成功, GPRS 網(wǎng)關(guān)會(huì)返回 IPCP 報(bào) 文分配動(dòng)態(tài) IP地址。此時(shí)就完成了 GPRS 網(wǎng)關(guān)的協(xié)商過程。 4 結(jié) 論 遠(yuǎn)程監(jiān)控技術(shù)在工業(yè)控制領(lǐng)域中的應(yīng)用非常廣泛,在電力系統(tǒng)、燃 氣管道 管網(wǎng)、石油勘測、水利、交通運(yùn)輸?shù)阮I(lǐng)域有著非常重要的作用,采用 GPRS 無線技術(shù)使得監(jiān)控系統(tǒng)的實(shí)時(shí)性、可靠性有了很大的提高,進(jìn)一步促進(jìn)了工業(yè)監(jiān)控系統(tǒng)的智能化和信息化。附件 2:外文原文 Longdistance supervisory system data terminal research Based on GPRS 1 introduction With the development of puter technology, Inter technology is particularly extensive and indepth various aspects of people39。s lives. make people39。s lives has undergone a profound industrial areas, because of the need to control areas, monitoring of a wide range of objects, hence the need to spend a lot of manpower, material and financial resources for equipment maintenance. Moreover, there are many adverse conditions, it is not easy to stay the occasional moment of arrival or not some field data collection. If the amount of wiring work it is not the economy, is unreasonable. This has helped wireless munications technology development in the field of remote monitoring. GPRS (General Packet Radio Service), as the existing GSM work evolution of the transition to the third generation mobile munication technology for (), with rapid access, always online, so by the flowmeter features Remote realtime data transmission in a sudden unmatched advantages. 2 GPRS technology GPRS (General Packet Radio Service) is based on the GSM mobile work systems, the use of pa