0% found this document useful (0 votes)
52 views18 pages

Android RIL Driver User Guide V1.6

The Android RIL Driver User Guide provides detailed instructions on integrating the RIL driver into Android OS for Quectel GSM, UMTS, and LTE modules. It outlines supported products, functions, and Android versions, and includes configuration steps for RIL integration, debugging methods, and FAQs. The document emphasizes that all information is proprietary and subject to change without notice.
Copyright
© All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
52 views18 pages

Android RIL Driver User Guide V1.6

The Android RIL Driver User Guide provides detailed instructions on integrating the RIL driver into Android OS for Quectel GSM, UMTS, and LTE modules. It outlines supported products, functions, and Android versions, and includes configuration steps for RIL integration, debugging methods, and FAQs. The document emphasizes that all information is proprietary and subject to change without notice.
Copyright
© All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd

Android RIL Driver

User Guide

GSM/GPRS/UMTS/HSPA/LTE Module Series

Rev. Android_RIL_Driver_User_Guide_V1.6

Date: 2017-11-10

[Link]
GSM/GPRS/UMTS/HSPA/LTE Module Series
Android RIL Driver User Guide

Our aim is to provide customers with timely and comprehensive service. For any
assistance, please contact our company headquarters:

Quectel Wireless Solutions Co., Ltd.


7th Floor, Hongye Building, No.1801 Hongmei Road, Xuhui District, Shanghai 200233, China
Tel: +86 21 5108 6236
Email: info@[Link]

Or our local office. For more information, please visit:

l
[Link]

e
For technical support, or to report documentation errors, please visit:

t
[Link]

c l
Or email to: support@[Link]

u e t ia
GENERAL NOTES

n
QUECTEL OFFERS THE INFORMATION AS A SERVICE TO ITS CUSTOMERS. THE INFORMATION
PROVIDED IS BASED UPON CUSTOMERS‟ REQUIREMENTS. QUECTEL MAKES EVERY EFFORT

Q ide
TO ENSURE THE QUALITY OF THE INFORMATION IT MAKES AVAILABLE. QUECTEL DOES NOT
MAKE ANY WARRANTY AS TO THE INFORMATION CONTAINED HEREIN, AND DOES NOT ACCEPT
ANY LIABILITY FOR ANY INJURY, LOSS OR DAMAGE OF ANY KIND INCURRED BY USE OF OR

f
RELIANCE UPON THE INFORMATION. ALL INFORMATION SUPPLIED HEREIN IS SUBJECT TO
CHANGE WITHOUT PRIOR NOTICE.

COPYRIGHT

o n
THE INFORMATION CONTAINED HERE IS PROPRIETARY TECHNICAL INFORMATION OF

C
QUECTEL WIRELESS SOLUTIONS CO., LTD. TRANSMITTING, REPRODUCTION, DISSEMINATION
AND EDITING OF THIS DOCUMENT AS WELL AS UTILIZATION OF THE CONTENT ARE
FORBIDDEN WITHOUT PERMISSION. OFFENDERS WILL BE HELD LIABLE FOR PAYMENT OF
DAMAGES. ALL RIGHTS ARE RESERVED IN THE EVENT OF A PATENT GRANT OR
REGISTRATION OF A UTILITY MODEL OR DESIGN.

Copyright © Quectel Wireless Solutions Co., Ltd. 2017. All rights reserved.

Android_RIL_Driver_User_Guide Confidential / Released 1 / 17


GSM/GPRS/UMTS/HSPA/LTE Module Series
Android RIL Driver User Guide

About the Document

History

Revision Date

t elAuthor Description

c l
1.0 2015-02-27 Carl YIN Initial

e ia
1.1 2015-03-25 Carl YIN Updated supported products

u t
1.2 2015-04-07 Kent XU Added Zero Packet feature in Section 3.3.3.

n
1. Added GSM modules in Supported Products

Q ide
1.3 2015-07-10 Kent XU
2. Added Android 5.x in Supported Android Versions
Carl YIN/ 1. Added EC21&EC25 in Supported Products
1.4 2016-06-21
Neo HOU 2. Added FAQ

f
1.5 2016-08-23 Kent XU Added EC20 R2.0 in Supported Products

n
1. Deleted Chapter 1.1 which was used to show the
Directory Structure of Quectel RIL Driver Package

o
2. Updated description of Supported Products, and
1.6 2017-11-10 Kent XU
added EG91, EG95, EG06, EM06, EP06, BG96,

C
and AG35 in Supported Products
3. Added Android 6.x/7.x in Supported Android Versions

Android_RIL_Driver_User_Guide Confidential / Released 2 / 17


GSM/GPRS/UMTS/HSPA/LTE Module Series
Android RIL Driver User Guide

Contents

About the Document ................................................................................................................................... 2


Contents ....................................................................................................................................................... 3
Table Index ................................................................................................................................................... 4
Figure Index ................................................................................................................................................. 5

1 Introduction .......................................................................................................................................... 6

2 Overview of Android RIL Driver ......................................................................................................... 7


2.1. Supported Products ..................................................................................................................... 7

l
2.2. Supported Functions .................................................................................................................... 7
2.3. Supported Android Versions ........................................................................................................ 8

t e
3 RIL Integration ...................................................................................................................................... 9

c l
3.1. RIL Driver Structure...................................................................................................................... 9

a
3.2. PPP Configuration in Linux Kernel ............................................................................................ 10

e i
3.3. USB Drivers Integration ............................................................................................................. 10

t
3.4. RIL Driver Integration ................................................................................................................. 10

u
3.5. System Configuration ................................................................................................................. 11

n
3.5.1. Configure [Link] ................................................................................................................ 11

Q ide
3.5.2. Modify the Right of RILD .................................................................................................. 12

4 Debugging Method ............................................................................................................................ 13


4.1. Method of Catching LOG ........................................................................................................... 13

f
4.2. Some Common Log Tags .......................................................................................................... 13

n
5 FAQs .................................................................................................................................................... 15
5.1. How to Set APN ......................................................................................................................... 15

o
5.2. Quectel RIL Does Not Work ....................................................................................................... 16
5.3. Cannot Send or Receive Short Message .................................................................................. 16

C
6 Appendix ............................................................................................................................................. 17

Android_RIL_Driver_User_Guide Confidential / Released 3 / 17


GSM/GPRS/UMTS/HSPA/LTE Module Series
Android RIL Driver User Guide

Table Index

TABLE 1: SUPPORTED PRODUCTS ................................................................................................................. 7


TABLE 2: SUPPORTED FUNCTIONS ................................................................................................................ 7
TABLE 3: SUPPORTED ANDROID VERSIONS ................................................................................................. 8
TABLE 4: SOME COMMON LOG TAGS ........................................................................................................... 13
TABLE 5: TERMS AND ABBREVIATIONS ........................................................................................................ 17

t el
e c ia l
u n t
Q ide
n f
Co

Android_RIL_Driver_User_Guide Confidential / Released 4 / 17


GSM/GPRS/UMTS/HSPA/LTE Module Series
Android RIL Driver User Guide

Figure Index

FIGURE 1: RIL DRIVER STRUCTURE ............................................................................................................... 9


FIGURE 2: RIL FILES ......................................................................................................................................... 11
FIGURE 3: EDIT ACCESS POINT .................................................................................................................... 15

t el
e c ia l
u n t
Q ide
n f
Co

Android_RIL_Driver_User_Guide Confidential / Released 5 / 17


GSM/GPRS/UMTS/HSPA/LTE Module Series
Android RIL Driver User Guide

1 Introduction
This document mainly introduces how to integrate RIL Driver into Android OS of your target machine and
how to modify the configuration files for starting RIL service and PPP dialling.

This document is applicable to Quectel GSM, UMTS and LTE modules. More details are provided in

l
Table 1.

c t e l
u e t ia
Q ide n
n f
Co

Android_RIL_Driver_User_Guide Confidential / Released 6 / 17


GSM/GPRS/UMTS/HSPA/LTE Module Series
Android RIL Driver User Guide

2 Overview of Android RIL Driver

2.1. Supported Products

l
Table 1: Supported Products

t e
Product Description

c l
GSM All Quectel GSM modules

e ia
UCxx UC15/UC20

u t
UMTS

n
UGxx UG95/UG96

Q ide
EC2x EC20/EC21/EC25

LTE EGxx EG91/EG95/EG06

f
Others EP06/EM06/BG96/AG35

o n
2.2. Supported Functions

C
Table 2: Supported Functions

Function Support or Not

SMS YES

Voice Call YES

Data Service YES

SIM Tool Kit NO

Phonebook YES

Android_RIL_Driver_User_Guide Confidential / Released 7 / 17


GSM/GPRS/UMTS/HSPA/LTE Module Series
Android RIL Driver User Guide

2.3. Supported Android Versions

Presently, Quectel RIL driver supports the following Android versions.

Table 3: Supported Android Versions

Versions Support or Not

Android 2.x YES

l
Android 3.x YES

e
Android 4.x YES

c t l
Android 5.x YES

e a
Android 6.x YES

u t i
Android 7.x YES

Q ide n
n f
Co

Android_RIL_Driver_User_Guide Confidential / Released 8 / 17


GSM/GPRS/UMTS/HSPA/LTE Module Series
Android RIL Driver User Guide

3 RIL Integration
This chapter mainly introduces the RIL driver structure and how to set up Android system with the RIL
driver.

l
3.1. RIL Driver Structure

t e
Android RIL (Radio Interface Layer) provides the abstract layer between Telephony service and Radio

c l
hardware.

e ia
The following illustration describes the RIL‟s position in the Android architecture.

u
Applications

n t Phone Application

Q ide
Call Tracker SMS Dispatch Service Tracker Data Tracker

f
Application Phone
Framework Java/android/telephony

n
RIL

o
Java/android/telephony/gsm

Unix

Libraries

C
Radio Daemon (RILD)
(User Space) /commands/rild

Vendor RIL
System/libs/[Link]

Packet Service
Linux Kernel Linux IP Stack

Voice and
Control
Packet Driver
[Link] example

Baseband Baseband

Figure 1: RIL Driver Structure

Android_RIL_Driver_User_Guide Confidential / Released 9 / 17


GSM/GPRS/UMTS/HSPA/LTE Module Series
Android RIL Driver User Guide

The RIL in Android is located between Kernel and Application Framework. It is divided into two parts, one
is RILD and the other is Vendor RIL.

RILD is responsible for the communication between Socket and Application Framework.

Vendor RIL is responsible for communication with Radio via AT command channel and Packet data
channel (PDCH). AT command channel is used for communicating with Radio directly and PDCH is used
for data service.

The java framework of RIL is divided into two parts too. One is RIL module and the other is Phone module.
The RIL module is used to communicate with the lower RILD. The Phone module directly provides phone

l
function interfaces to application through which customers can call to realize the phone functions.

t e l
3.2. PPP Configuration in Linux Kernel

e c ia
The kernel needs to be configured to support PPP dial up.

u t
For detailed kernel configuration (to support PPP) steps, please refer to Chapter 3.6 of

n
Quectel_WCDMA&LTE_Linux_USB_Driver_User_Guide.

Q ide
3.3. USB Drivers Integration

n f
If Quectel GSM modules are used, please skip this chapter.

o
The kernel should be configured to support UCxx/UGxx/EC2x/EGxx/EP06/EM06/BG96/AG35 modules.
For detailed operation procedures, please refer to Chapter 3.2~3.5 in Quectel_WCDMA&LTE_

C
Linux_USB_Driver_User_Guide:

3.4. RIL Driver Integration

Presently, Quectel provides RIL driver in the form of source code. There is only a need to copy the RIL
driver source code files to the correct path on your project directory, and then recompile the Android
system.

The source path of the RIL driver files in RIL Driver package is: Driver package/reference-ril

The destination path in Android system is: ($Android_src)/hardware/ril/

Android_RIL_Driver_User_Guide Confidential / Released 10 / 17


GSM/GPRS/UMTS/HSPA/LTE Module Series
Android RIL Driver User Guide

Please use the following command to update these files‟ date stamp to make sure they will be compiled.

touch hardware/ril/*

After recompiling the Android system successfully, please make sure the following files exists in folder
out/target/product/($your_board_name)/system.

Figure 2: RIL Files

NOTE

t el
c l
Quectel would not give the PPP script, because we have integrated the PPP script in the source code of

a
the RIL driver. And the chat, ip-up and ip-down would be generated when the RIL driver has been

e i
compiled.

u n t
Q ide
3.5. System Configuration

In order to use the RIL driver normally, some Android system configuration files have to be modified.

n f
3.5.1. Configure [Link]

o
Add service ril-daemon in [Link]:

C
If UCxx/UGxx/EC2x/EGxx/EP06/EM06/BG96/AG35 modules are used and they are accessed by USB
interface, please add the following service in [Link]:

service ril-daemon /system/bin/rild -l /system/lib/[Link]


class main
socket rild stream 660 root radio
socket rild-debug stream 666 radio system
user root
group radio cache inet misc audio sdcard_rw log

If GSM modules are used and they are accessed by UART interface, please add the following service in
[Link]:

service ril-daemon /system/bin/rild -l /system/lib/[Link] -- -d <UART port name> –B <baud


rate> –C <hardware flow control>
class main

Android_RIL_Driver_User_Guide Confidential / Released 11 / 17


GSM/GPRS/UMTS/HSPA/LTE Module Series
Android RIL Driver User Guide

socket rild stream 660 root radio


socket rild-debug stream 666 radio system
user root
group radio cache inet misc audio sdcard_rw log

The following parameter needs to be configured:

 -d <UART port name>

The name of UART port being used. For example: /dev/ttyS1

It is optional to configure the following two parameters:

el
 -B <baud rate>

t
The speed of UART port. For example: 115200, 230400, 460800bps. The default baud rate is 115200bps.

c a l
 -C <hardware flow control>

e t i
1: open hardware flow control

u
0: close hardware flow control

Q ide n
Hardware flow control is closed by default.

The [Link] file may be located in different paths according to different projects, for example:

f
 system/core/rootdir/[Link]

n
 device/fsl/imx6/[Link]
 device/ti/am335xevm_sk/[Link]

o
 device/generic/x86/[Link]
 device/samsung/smdkv210/init.smdkv210_sdmmc.rc

C
3.5.2. Modify the Right of RILD

RILD (ril-daemon) requires root privilege. So there is a need to comment out the function switchUser() in
the file ($Android_src)/hardware/ril/rild/rild.c:

OpenLib:
#endif
//switchUser();

dlHandle = dlopen(rilLibPath, RTLD_NOW)

Android_RIL_Driver_User_Guide Confidential / Released 12 / 17


GSM/GPRS/UMTS/HSPA/LTE Module Series
Android RIL Driver User Guide

4 Debugging Method

4.1. Method of Catching LOG

l
1) Catch the log of RIL module by typing the following command in window‟s CMD tool:

adb logcat –b radio –v time

t e l
2) Catch the log of Android system by typing the following command in window‟s CMD tool:

c
adb logcat –v time

e t ia
3) Sometimes, customers may want to make tests on lots of devices or for a long time, and it is not

u
convenient to connect all devices with PC via USB cables. In this case, they can log file by the

n
following command:

Q ide
adb shell
logcat –b radio –v time –f <filename> &

f
The character „&‟ makes the „logcat‟ process running in background, so the devices can be disconnected.

n
4) When tests are finished, the following command can be used to fetch log files from devices to local

o
directory:

adb pull <filename> <local directory>

C
4.2. Some Common Log Tags

Table 4: Some Common Log Tags

RIL /hardware/ril/reference-ril/refereince-ril.c

AT /hardware/ril/reference-ril/atchannel.c

RILD /hardware/ril/rild/rild.c

RILC /hardware/ril/libril/[Link]

Android_RIL_Driver_User_Guide Confidential / Released 13 / 17


GSM/GPRS/UMTS/HSPA/LTE Module Series
Android RIL Driver User Guide

RILB /frameworks/base/telephony/java/com/android/internal/telephony/[Link]

RILJ /frameworks/base/telephony/java/com/android/internal/telephony/gsm/[Link]

GSM /frameworks/base/telephony/java/com/android/internal/telephony/gsm/[Link]

t el
e c ia l
u n t
Q ide
n f
Co

Android_RIL_Driver_User_Guide Confidential / Released 14 / 17


GSM/GPRS/UMTS/HSPA/LTE Module Series
Android RIL Driver User Guide

5 FAQs

5.1. How to Set APN

l
If the dialling process cannot go on, it is quite possible that the APN has not been set yet. The APN can be
set in Android UI:

t e
Settings  WIRELESS & NETWORKS  More…  Mobile Networks  Access Point Names

c a l
If nothing is seen in Access Point Names, it indicates that the APN has not been set. In such case, a

e i
new APN should be added to the system. The following is an example which shows the access point

t
editing interface. Please note that the Access Point Name varies with the operator and (U)SIM card.

u
Q ide n
n f
Co
Figure 3: Edit Access Point

Android_RIL_Driver_User_Guide Confidential / Released 15 / 17


GSM/GPRS/UMTS/HSPA/LTE Module Series
Android RIL Driver User Guide

5.2. Quectel RIL Does Not Work

There are many reasons that may cause Quectel RIL not working. The following are some common
causes.

1. RIL daemon is not running

Use the command below to check RIL daemon status. If non-value, “Stopped” or “Restarting” is returned,
it indicates that RIL daemon is not running. The expected return value should be “Running”.

getprop [Link]-daemon

l
2. RIL library is not loaded correctly

t e
Check the RIL-daemon service definition in [Link] through the command below. The expected result

l
should be “service ril-daemon /system/bin/rild -l /system/lib/[Link]”. Check the arguments,

c
word spelling, blank space, etc. to make sure the RIL library is loaded correctly.

e ia
cat /[Link] | grep ril-daemon

u n t
3. Cannot access USB serial port device file

Q ide
 Use command “ls –l /dev/ttyUSB*” to check the access right of the device file.
 Use command “getenforce” to check whether the SELinux has been enabled.
 Command “setenforce 0” can disable the SELinux.

f
4. The RIL library is not provided by Quectel

n
Use the command below to check Quectel RIL version, and the return value should start with

o
Quectel_Android_RIL_SR. If not, the RIL library is not provided by Quectel.

getprop [Link]-impl

C
5.3. Cannot Send or Receive Short Message

Use the following command to check whether the system has disabled SMS receive/send function.

getprop [Link]
Or
[Link]

 If the return value is false, it indicates that the SMS receive/send function has been disabled.
If non-value is returned, please check frameworks\base\core\res\res\values\[Link] (first check the
manufacturer override configuration file) to see config_sms_capable. If the config_sms_capable
configuration file in [Link] is false just like <bool name="config_sms_capable">false</bool>, then
change it to true.

Android_RIL_Driver_User_Guide Confidential / Released 16 / 17


GSM/GPRS/UMTS/HSPA/LTE Module Series
Android RIL Driver User Guide

6 Appendix

Table 5: Terms and Abbreviations

Abbreviation Description

l
GSM Global System for Mobile Communications

t e
MS Mobile Station

c l
PID Product ID

e ia
RIL Radio Interface Layer

u t
TA Terminal Adapter

n
VID Vendor ID

Q ide
WCDMA Wideband Code Division Multiple Access

LTE Long Term Evolution

n f
Co

Android_RIL_Driver_User_Guide Confidential / Released 17 / 17

Common questions

Powered by AI

The Quectel RIL driver supports modules such as GSM modules, UMTS (UC15/UC20, UG95/UG96), LTE (EC20/EC21/EC25, EG91/EG95/EG06), and others (EP06, EM06, BG96, AG35). These modules support functionalities such as SMS, voice calls, data services, and phonebook access, but do not support the SIM Tool Kit .

Modifying system configuration files is essential when integrating the RIL driver to ensure that the RIL daemon has the required permissions and services are correctly configured. Specific files that are affected include init.rc, where services and socket definitions are specified, and rild.c, where root privileges are configured for RILD by commenting out switchUser().

The Android RIL is located between the Kernel and Application Framework and is divided into two main parts: the RILD and the Vendor RIL. RILD handles communication between the Socket and Application Framework, while Vendor RIL communicates with the Radio via AT command channel and Packet data channel (PDCH). The RIL module communicates directly with RILD, and the Phone module provides phone function interfaces accessible to applications .

To integrate Quectel's RIL driver into an Android system, the RIL driver source code files need to be copied to the correct path in the project directory and then recompiled. The RIL driver files must be updated using the touch command to ensure they are compiled. Once compiled, the relevant files should exist in the out/target/product/($your_board_name)/system directory. The source path of the RIL driver files is located at Driver package/reference-ril .

To integrate PPP configuration into the Android system, the Linux kernel must be configured to support PPP dial up. Detailed steps for configuring the kernel are referenced in the Quectel WCDMA&LTE Linux USB Driver User Guide .

To ensure proper functionality of the RIL daemon in init.rc, the service ril-daemon must be added. For USB interface modules, a service line like 'service ril-daemon /system/bin/rild -l /system/lib/libreference-ril.so class main socket rild stream 660 root radio' is added. For UART interface modules, additional parameters -d for UART port, -B for baud rate, and -C for hardware flow control are required .

Potential issues with Quectel RIL not working can be diagnosed by checking the RIL daemon's status using 'getprop init.svc.ril-daemon', ensuring the RIL library is loaded correctly, verifying access to the USB serial port, and confirming that Quectel's RIL library is being used . Issues can be resolved by ensuring correct command line entries in init.rc and checking file permissions.

RILD plays a crucial role in the RIL driver architecture by managing communication between the Socket and Application Framework. It acts as a mediator between the high-level telephony functions and the lower-level Vendor RIL which interfaces directly with the radio hardware. RILD uses libraries such as libril-vendor.so and interacts with other components like the Phone and RIL modules to handle telephony functions .

RIL debugging methods include capturing logs using the command 'adb logcat –b radio –v time' for the RIL module and 'adb logcat –v time' for the Android system. Logs can also be redirected to a file when testing multiple devices with 'adb shell logcat –b radio –v time –f <filename> &' and retrieved using 'adb pull <filename> <local directory>' .

The Android RIL facilitates communication between system libraries and radio hardware by using two key components: RILD and Vendor RIL. RILD manages communication between the Socket and the Application Framework, while Vendor RIL handles communication with the Radio via AT command and Packet data channels. The communication involves components such as the Phone module, RIL module, and Vendor RIL, collectively providing phone functions and interfacing with lower-level radio operations .

You might also like