1 Overview
Platform: Freescale I. mx 6 quad 4-core development board sabrelite
Operating System: Android 4.0.4
Kernel: 3.0.15
3G module: ZTE mg3732 and UbloxLISA-U130
2 ZTE mg3732 module port 2.1 preparation
Prepare an available China Unicom 3G card, place it in the SIM card slot, and connect the ZTE mg3732 development board to the motherboard through USB.
2.2 migration steps
1) copy the libztewcdma-ril.so file to the/system/lib directory
2) Add a PID to/driver/USB/serial/option. C. The VID is as follows:
{USB_DEVICE(0x19d2, 0xffff) }, {USB_DEVICE(0x19d2, 0xfffe) }, {USB_DEVICE(0x19d2, 0xfffd) }, {USB_DEVICE(0x19d2, 0xfffc) }, {USB_DEVICE(0x19d2, 0xfffb) }, {USB_DEVICE(0x19d2, 0xfff1) }, {USB_DEVICE(0x19d2, 0xfff6) }, {USB_DEVICE(0x19d2, 0xfff7) }, {USB_DEVICE(0x19d2, 0xfff8) }, {USB_DEVICE(0x19d2, 0xfff9) }, {USB_DEVICE(0x19d2, 0xffee) }, {USB_DEVICE(0x19d2, 0xffed) }, {USB_DEVICE(0x19d2, 0xffeb) }, {USB_DEVICE(0x19d2, 0xffec) },
3) copy the chat and pppd to the/system/bin directory. Make sure that the/system/bin directory contains two programs: pppd and chat, which can be run.
4) add IP-up to the/system/PPP/directory.
5) add it to the init. RC file.
chmod 0755 /system/lib/libztewcdma-ril.sochown root /system/bin/pppdchmod 4755 /system/bin/pppd service ril-daemon /system/bin/rild -l/system/lib/libztewcdma-ril.so -- -d /dev/ttyUSB0socket rild stream 660 root radiosocket rild-debug stream 660 radio systemuser root group radio cache inet misc
6) Configure menuconfig as follows:
[*] Network device support ---> <*> PPP (point-to-point protocol) support [*] PPP multilink support (EXPERIMENTAL) [*] PPP filtering <*> PPP support for async serial ports <*> PPP support for sync tty ports <*> PPP Deflate compression <*> PPP BSD-Compress compression <*> PPP MPPE compression (encryption)(EXPERIMENTAL) <*> PPP over Ethernet (EXPERIMENTAL) <*> PPP over L2TP (EXPERIMENTAL)
2.3 debugging process
1. After Entering the Android system, first check whether the module port is identified. If it can be identified correctly, you can see the following four ports:
/dev/ttyUSB0/dev/ttyUSB1/dev/ttyUSB2/dev/ttyUSB3
2. Set the RIL-daemon port to/dev/ttyusb0. Otherwise, the rild process cannot be started.
The following error is displayed in logcat-B Radio:
I/RILJ ( 2392): Couldn't find 'rild' socket; retrying after timeoutI/RILJ ( 2392): Couldn't find'rild' socket; retrying after timeoutI/RILJ ( 2392): Couldn't find'rild' socket; retrying after timeoutI/RILJ ( 2392): Couldn't find'rild' socket; retrying after timeoutI/RILJ ( 2392): Couldn't find'rild' socket; retrying after timeout
3. During the debugging process, the module can call but cannot access the Internet. No pppd process is found using the ps command. The log is as follows:
D/RILJ ( 2369): 0: [77] SETUP_DATA_CALL E/RILD ( 2135): get exit sig 17 E/RILD ( 2135): checkPPPConnection: pid_exit == 1 E/RILD ( 2135): checkPPPConnection: interface[ppp0]information is not found E/RILD ( 2135): start_pppd: failed to check PPP interfaceUP E/RILD ( 2135): EVENT_PPPD_MANAGER_PPPD_EXIT E/RILD ( 2135): pppd exit. status = 1024 E/RILD ( 2135): pppd exit . no restart pppd . E/RILD ( 2135): SetupDefaultPDP failed.
This indicates that the pppd process failed to start.
The problem is caused by pppd permission. The solution is as follows:
After the system is started, run the following command in ADB to modify the pppd permission:
chown root /system/bin/pppdchmod 4755 /system/bin/pppd
If the system is read-only, you need to use the remount command to re-mount the file system:
mount –o remount,rw/dev/block/mmcblk0p5 /system/
3 ubox LISA-U130 module porting 3.1 Preparation
Prepare an available China Unicom 3G card, place it in the SIM card slot, and then connect the ubox u130 development board to the motherboard through USB.
3.2 migration steps
1) decompress the compressed file provided by ubox as follows:
RIL_sc_<version>.zipril_sc_<version> Source overlay for Android Platform build/target/product Device configuration folder files external/ppp/ Data connection files hardware/gsm0710muxd Channelmultiplexer hardware/ril/ublox_ril/ RIL core directory system/core/rootdir/Android.mk Compilation script system/core/init/property_service.c Set RIL services property system/core/liblog/logd_write.c Log configuration files
2) copy the relevant files to the android source code.
cp –pvRf ril_sc_<version>/external/ppp/ <android_root>/external/pppcp –pvRf ril_sc_<version>/hardware/ril/ublox_ril <android_root>/hardware/ril/cp –pvRf ril_sc_<version>/system/* <android_root>/systemcp –pvRfril_sc_<version>/build/* <android_root>/build
3) Add the following content to device/FSL/imx6/androidproducts. mk:
Ril_com_interface: = USB
4) Add the following statement to the init. RC file:
# Changepermissions for modem chmod 0660 /dev/ttyACM0 chown radio radio /dev/ttyACM0 chmod 0660 /dev/ttyACM1 chown radio radio /dev/ttyACM1 chmod 0660 /dev/ttyACM2 chown radio radio /dev/ttyACM2 # Set permissions for u-blox RILRepository chown radio radio /system/etc/rril chmod 0770 /system/etc/rril chown radio radio/system/etc/rril/repository.txt chmod 0660/system/etc/rril/repository.txt # Set u-blox RIL repository state setprop net.rril.repository notready #Prepare u-blox RIL repository service rril-repo/system/bin/rril-repo.sh user root group radio oneshot # Load u-blox RIL service ril-daemon /system/bin/rild -l/system/lib/librapid-ril-core.so -- -a /dev/ttyACM0 -n /dev/ttyACM1 class main socket rild stream 660 root radio socket rild-debug stream 660 radiosystem user root group radio cache inet misc audio service pppd_data0/system/bin/init.gprs-pppd user root radio group radio cache inet misc disabled oneshot service pppd_data1/system/bin/init.gprs-pppd user root radio group radio cache inet misc disabled oneshot service pppd_term /system/bin/stop_pppd15 class main disabled oneshot service pppd_kill /system/bin/stop_pppd 9 class main disabled oneshot
5) Configure menuconfig as follows:
DeviceDrivers USB Support <*>USB Modem (CDC ACM)support DeviceDrivers Network device support <*>PPP (point-to-pointprotocol) support <*>PPP support for asyncserial ports <*>PPP support for sync ttyports <*>PPP Deflate compression
6) recompile the system to ensure that the following files are generated
/system/lib/librapid-ril-core.so/system/lib/librapid-ril-util.so/system/lib/librapid-ril-oem.so /system/bin/pppd/system/bin/chat /system/bin/init.gprs-pppd/system/bin/ip-down/system/bin/ip-up/system/bin/stop_pppd/system/bin/rril-repo.sh /system/etc/rril/repository.txt /system/etc/ppp/ chap-secrets/system/etc/ppp/ chat-isp1/system/etc/ppp/ chat-isp2/system/etc/ppp/ ip-down-ppp0/system/etc/ppp/ ip-up-ppp0/system/etc/ppp/ ip-up-vpn/system/etc/ppp/pap-secrets /system/etc/ppp/peers/gprs1/system/etc/ppp/peers/gprs2
3.3 debugging process
1. After the system is started, ensure that the 3G module port can be recognized by the system:
/dev/ttyACM0/dev/ttyACM1/dev/ttyACM2/dev/ttyACM3/dev/ttyACM4/dev/ttyACM5
2. Run the ps command to check whether the rild process has been started. If it has been started, it is normal to make a call.
3. During the debugging process, if you find that you cannot access the Internet, run the ps command to check whether the pppd process is not started. In ADB, you can view logs using logcat-B radio and find two errors:
First error:
E/RILR ( 2109):CRepository::OpenRepositoryFile() - ERROR: Could not open file"/data/rril/repository.txt" - No such file or directory
Second error:
I/pppd.gprs( 3262): Configure pppd securityoptions I/pppd.start( 3271): Starting pppd E/pppd ( 3272): unrecognizedoption 'gprs1'I/pppd.start( 3279): pppd exited with2
The first error cocould not find/data/rril/repository.txt is because the/system/bin/rril-repo.sh script is not executed and the solution is to modify the/system/bin/rril-repo.sh permissions, and in init. add the class attribute of servicerril-repo to RC:
# Prepare u-blox RIL repositoryservice rril-repo /system/bin/rril-repo.shclass mainuser rootgroup radiooneshot
The second error occurs because the/system/bin/init. GPRS-pppd script fails. When $ ppp_usr is an empty string, the script runs the following statement:
/system/bin/pppd user $ppp_usr call gprs$(( $ppp_if + 1 ))=》/system/bin/pppd user call gprs1
This statement fails to be executed, so the pppd process cannot be started.
The correct script after modification is:
case $ppp_auth in 0) /system/bin/log -t pppd.start "/system/bin/pppd call gprs$(( $ppp_if+ 1 ))"/system/bin/pppd call gprs$(( $ppp_if + 1 )) ;; *) if [ "$ppp_usr" = "" ];then/system/bin/log -t pppd.start "/system/bin/pppd call gprs$(( $ppp_if+ 1 ))"/system/bin/pppd call gprs$(( $ppp_if + 1 )) else/system/bin/log -t pppd.start "/system/bin/pppd user $ppp_usr callgprs$(( $ppp_if + 1 ))"/system/bin/pppd user $ppp_usr call gprs$(( $ppp_if + 1 )) fi