imx6 yocto 3g模塊移植

1.配置內核:

[*] Network device support  --->

       <*>   PPP (point-to-point protocol) support

       <*>     PPP BSD-Compress compression

        <*>     PPP Deflate compression

       [*]     PPP filtering

       <*>     PPP MPPE compression (encryption)

       [*]     PPP multilink support

       <*>     PPP over Ethernet

       <*>     PPP support for async serial ports

       <*>     PPP support for sync tty ports

 

[*] USB support  --->

       <*>     USB Modem (CDC ACM) support

 

[*] USB support  --->

    <*>   USB Serial Converter support  --->

              <*>   USB driver for GSM and CDMA modems

2.修改配置文件

vi <build-directory>/conf/local.conf

添加:

IMAGE_INSTALL_append += "ppp"


3.編譯,燒寫。


4.在/etc/新建文件ppp-on-dialer

寫入內容:

TIMEOUT 5 '' AT OK AT+CGDCONT=1,"IP","CMNET" OK AT OK ATE0V1 OK AT OK
ATS0=0 OK AT OK ATE0V1 OK AT OK ATDT*99***1# CONNECT ''


5.創建sh腳本 3g.sh#!/bin/sh
#Closed other network
ifconfig eth0 down
ifconfig wlan0 down
pppd /dev/ttyUSB2 connect "chat -v -f /etc/ppp-on-dialer"
time=0
echo "Connected to 3G network"
dev=`ifconfig |grep "ppp0" |busybox cut -d: -f0 |busybox cut -d" " -f1`
while [ "$dev" != "ppp0" ] && [ $time -lt 10 ]
do
sleep 1
time=`expr $time + 1`
dev=`ifconfig |grep "ppp0" |busybox cut -d: -f0 |busybox cut -d" " -f1`
done
 
if  [ "$dev" == "ppp0" ]
then echo "Connection successful"
route add default gw 10.64.64.64 dev ppp0
ifconfig ppp0
else
echo "Connection failed,Please try again"
fi


6.插入3g模塊


7.執行3g.sh腳本


8.修改dns,配置文件位置:/etc/resolv.conf,寫入內容

nameserver 202.106.0.20


9,測試網絡,ping www.baidu.com



發佈了34 篇原創文章 · 獲贊 6 · 訪問量 3萬+
發表評論
所有評論
還沒有人評論,想成為第一個評論的人麼? 請在上方評論欄輸入並且點擊發布.
相關文章