key 41 software integration guide

38
KEY 41 Software Integration Guide For Customer Development Special notes This document is a confidential document only for internal.

Upload: others

Post on 09-May-2022

5 views

Category:

Documents


0 download

TRANSCRIPT

Page 1: KEY 41 Software Integration Guide

KEY 41 Software Integration Guide

For Customer Development

Special notes

This document is a confidential document only for internal.

Page 2: KEY 41 Software Integration Guide

Page 2/38

History

Version Modifications

1.0 1st official version

1.1 Add:

3 USB overview

Change:

5.1 Linux Kernel Driver Architecture

5.2 Modem Integration Scheme

1.2 Minor edits

1.3 Adding more USB information in 3.1 USB enumeration

1.4 Change:

Document structure optimization

1.5 Change:

Update flash scripts on Linux

Page 3: KEY 41 Software Integration Guide

Page 3/38

Contents

1 SCOPE 5

2 USB OVERVIEW 6

2.1 USB SPECIFICATIONS 6

2.2 USB VENDOR REQUESTS 7

2.3 USB ENUMERATION 7

3 LINUX INTEGRATION SCHEME 9

3.1 LINUX KERNEL DRIVER ARCHITECTURE 9

3.2 HOW TO INSTALL MODEM DRIVER ON LINUX 10

3.2.1 COMPILE NEW OPTION DRIVER FOR UBUNTU 10

3.2.2 COMPILE NEW OPTION DRIVER FOR EMBEDDED LINUX 11

3.2.3 CHECK IF INTEGRATION IS SUCCESSFUL 12

3.3 HOW TO ENABLE RNDIS HOST ON LINUX 13

3.3.1 MODIFY KERNEL CONFIG 13

3.3.2 MODIFY THE FILE TO SUPPORT FOR SOME KERNEL 16

3.4 HOW TO CREATE PPP DIAL-UP ON LINUX 18

3.5 HOW TO INSTALL ADB AND FASTBOOT ON LINUX 19

4 WINDOWS INTEGRATION SCHEME 22

4.1 HOW TO INSTALL USB DRIVER ON WINDOWS 10 22

4.2 HOW TO CREATE MODEM DIAL-UP ON WINDOWS10 26

4.3 HOW TO CREATE MBIM DIAL-UP ON WINDOWS 10 31

5 ANDROID INTEGRATION SCHEME 32

5.1 HOW TO INSTALL USB DRIVER ON ANDROID 32

5.2 HOW TO CREATE PPP DIAL-UP ON ANDROID 32

6 DEVICE FLASH 33

6.1 HOW TO FLASH ON WINDOWS 33

6.2 HOW TO FLASH ON LINUX 33

6.3 HOW TO FLASH OVER THE AIR 34

Page 4: KEY 41 Software Integration Guide

Page 4/38

7 TIMEOUT SETTINGS FOR AT COMMAND 35

7.1 DEVICE INITIALIZATION 35

7.2 AT COMMAND RESPONSE 35

8 LED SPECIFICATION 37

Page 5: KEY 41 Software Integration Guide

Page 5/38

1 Scope

This document is applicable to the following:

⚫ Key 41

⚫ Embedded Linux with kernel 2.6.20 and above

⚫ Windows 10

⚫ Android 4.4 and above

Page 6: KEY 41 Software Integration Guide

Page 6/38

2 USB overview

2.1 USB specifications

Key 41 supports 2 kinds of USB mode, which corresponds to different USB port combinations.

USB mode 0 is as default.

The basic USB port combinations and specifications are as following table.

Table USB port specifications

USB mode Port PID VID Class Subclass Protocol

AT+USBMODE=0

(default)

Modem 0x00B6 0x1BBB 0xFF 0x00 0x00

Diag 0xFF 0xFF 0xFF

AT 0xFF 0x00 0x00

MBIM 0x02 0x0E 0x00

AT+USBMODE=1 RNDIS 0x01AA 0x1BBB 0xE0 0x01 0x03

Modem 0xFF 0x00 0x00

Diag 0xFF 0xFF 0xFF

Table USB additional information

Data Item Size Value Comment

bLength 1 18 size

bDescriptor 1 1 Description

bcdUSB 2 0x0200 USB2.0

bDeviceClass 1 0 Communication

bDeviceSubclass 1 0 Device Code

bDeviceProtocol 1 0 Protocol

bDeviceMaxPAcketSize 1 64 Max Packet size

idVendorID/idProduct 4 0x1bbb/0x00b6 Product id

bcdDevice 2 10 Device release

number

iManufacturer 1 1 Index

iProduct 1 2 Comodity index

iSerialNumber 1 3 Serial Number

bNumConfigurations 1 1 Number

configuration

Page 7: KEY 41 Software Integration Guide

Page 7/38

2.2 USB vendor requests

There’re 2 USB vendor requests during initianization, which used to automated driver

installation for plug & play.

Table USB vendor requests

bmRequestType bRequest wValue wIndex wLength

0xC0 0x20 0x0000 0x0004 0x0010

0xC0 0x20 0x0000 0x0004 0x0028

2.3 USB enumeration

This section introduces the definition of each USB modes and USB ports.

Table USB port definition

USB mode Port Description Available on Windows Available on Linux

AT+USBMODE=0

(default)

PID: 0x00B6

Modem Used for dial up with

PPPd.

Modem Interface ttyUSB0

Need to integrate modem

driver as chapter “How to

install modem driver on

Linux”

Diag Used for diagnostic. Application2 Interface ttyUSB1

AT Used as AT command

interface

Send AT+USBMODE here

to switch mode.

Application1 Interface ttyUSB2

MBIM cellular connection

interface

Windows 10 NO

AT+USBMODE=1

PID: 0x01AA

RNDIS Used for dial up with

DHCP

Ethernet adapter Ethernet adapter

Need to enable RNDIS

driver in Kernel as Chapter

„How to enable RNDIS

host on Linux”

Modem Used for AT

communication

Send AT+USBMODE here

to switch mode.

Modem Interface ttyUSB0

Need to integrate modem

driver as chapter “How to

install modem driver on

Linux”

Page 8: KEY 41 Software Integration Guide

Page 8/38

Diag Used for diagnostics. Diagnostic port ttyUSB1

Table Corresponding USB port for different scenarios

Use Recommended USB port Corresponding USB MODE

AT interface Application1 interface/ ttyUSB2 USBMODE 0

Low-speed data Modem interface / ttyUSB0 USBMODE 0

High-speed data Windows: MBIM USBMODE 0

Linux: RNDIS USBMODE 1

QXDM log capture with

Qualcomm tool

Application2 interface / ttyUSB1 USBMODE 0

QXDM log capture with TCL tool RNDIS USBMODE 1

Page 9: KEY 41 Software Integration Guide

Page 9/38

3 Linux Integration Scheme

Kernel 3.5 and above: Support plug and play.

Kernel 2.6.20 to 3.4.0: USB driver is required to integration.

3.1 Linux kernel driver architecture

Key 41 custom device communicates with Linux mainly through USB ports. The Linux kernel

needs to load USB drivers according to the information about the USB device ports reported

by the Key 41 custom device. The custom device can work properly only after the correct USB

drivers are loaded.

The following figure shows the Linux kernel driver architecture supporting Key 41 Custom

Series.

Table Linux kernel driver architecture

User application User space User space

Character

device layer

Block device

layer

Network device

layer

VFS

layer

TTY

layer

Others

Kernel

space

USB device driver layer

USB serial port driver Other device drivers

USB core

USB main controller

Module

As shown in the preceding diagram, in the USB driver architecture of Linux, the drivers related

to Key 41 are the USB serial port driver.

Supports port such as the modem port and AT command port. The code file of this driver has

been added into the source code of the Linux kernel.

Page 10: KEY 41 Software Integration Guide

Page 10/38

3.2 How to install modem driver on Linux

3.2.1 Compile New Option Driver for Ubuntu

The steps are as follows.

1. Get the Ubuntu kernel version.

~$ uname –r

2. Download the same kernel version with Ubuntu from the follow link.

https://mirrors.edge.kernel.org/pub/linux/kernel/

3. To support new PIDs, make the following modifications:

3.1. Modify the drivers/usb/serial/option.c file.

Add the following definitions before "static const struct usb_device_id”

#ifndef ALCATEL_VENDOR_ID

#define ALCATEL_VENDOR_ID 0x1bbb

#endif

#define ALCATEL_USB_DEVICE_AND_INTERFACE_INFO(vend, cl, sc, pr) \

.match_flags = USB_DEVICE_ID_MATCH_INT_INFO \

| USB_DEVICE_ID_MATCH_VENDOR, \

.idVendor = (vend), \

.bInterfaceClass = (cl), \

.bInterfaceSubClass = (sc), \

.bInterfaceProtocol = (pr)

3.2. Add the following statements to the “static const struct usb_device_id

option_ids[ ] idlist”

{ ALCATEL_USB_DEVICE_AND_INTERFACE_INFO (ALCATEL_VENDOR_ID, 0xff, 0,

0)},

{ ALCATEL_USB_DEVICE_AND_INTERFACE_INFO (ALCATEL_VENDOR_ID, 0xff, 0xff,

0xff)},

3.3. Create a new directory and copy the option.c to new directory.

E.g. mkdir ~/ik41_usb

Copy the Makefile to the new directory ~/ik41_usb.

Enter the directory ~/ik41_usb and execute command make

~$ cd ~/ik41_usb

~$ make

Page 11: KEY 41 Software Integration Guide

Page 11/38

3.4. Copy the option.ko to /lib/modules/`uname -r`/kernel/drivers/usb/serial

~$ sudo cp option.ko /lib/modules/`uname -r`/kernel/drivers/usb/serial

~$ cd /lib/modules/`uname -r`/kernel/drivers/usb/serial

~$ sudo modprobe option

Note:

If you are executing MAKE, the following error occurs(eg:Ubuntu 14.04 will occur the error),

please copy the file usb-wwan.h from kernel source code(drivers/usb/serial/usb-wwan.h) to

the current dir(ik41_usb) and retry.

3.2.2 Compile New Option Driver for Embedded Linux

This integration scheme involves the following Linux kernel source code file:

drivers/usb/serial/option.c

The steps are as follows.

1. Modify the option.c file.

Add the following definitions before "static const struct usb_device_id”

#ifndef ALCATEL_VENDOR_ID

#define ALCATEL_VENDOR_ID 0x1bbb

#endif

#define ALCATEL_USB_DEVICE_AND_INTERFACE_INFO(vend, cl, sc, pr) \

.match_flags = USB_DEVICE_ID_MATCH_INT_INFO \

| USB_DEVICE_ID_MATCH_VENDOR, \

.idVendor = (vend), \

.bInterfaceClass = (cl), \

.bInterfaceSubClass = (sc), \

.bInterfaceProtocol = (pr)

Page 12: KEY 41 Software Integration Guide

Page 12/38

2. Add the following statements to the “static const struct usb_device_id option_ids[ ]

idlist”

{ ALCATEL_USB_DEVICE_AND_INTERFACE_INFO (ALCATEL_VENDOR_ID, 0xff,

0, 0)},

{ ALCATEL_USB_DEVICE_AND_INTERFACE_INFO (ALCATEL_VENDOR_ID, 0xff,

0xff, 0xff)},

3. Run the make command to compile the revised kernel version.

3.2.3 Check if integration is successful

The steps are as follows.

1. Run the dmesg command to check whether the integration is successful. If the log

contains information same as or similar to what is shown in the following figure, the

integration is successful.

2. Run the ls /dev/ttyUSB* command to check whether port mapping is successful.

3. Run the Terminal (T1) tool. On T1, run the cat /dev/ttyUSB2 command and press

Enter.

4. Restart the terminal (T2). On T2, enter AT command for delivery and press Enter. The

returned information will be displayed on T1.

E.g. echo –e “ati\r\n” > /dev/ttyUSB2

Page 13: KEY 41 Software Integration Guide

Page 13/38

Use ls /dev/ttyUSB* command to query the mapped serial port name ttyUSBn (n=0~N, n is

dynamically assigned by the host and not limited to 0, 1 and 2).

3.3 How to enable RNDIS host on Linux

3.3.1 Modify kernel config

Configure kernel.Ubuntu support RNDIS host as default.

The steps are as follows.

1. Enter kernel source.

2. Make menuconfig

3. Select Device Drivers->Network device support->USB Network Adapters-> Host for

RNDIS and ActiveSync devices

4. Save the change.

5. Rebuild kernel.

Note: The example below bases on kernel 4.4.0

Page 14: KEY 41 Software Integration Guide

Page 14/38

Page 15: KEY 41 Software Integration Guide

Page 15/38

Page 16: KEY 41 Software Integration Guide

Page 16/38

3.3.2 Modify the file to support for some kernel

Ubuntu 8.04 ,7.04,7.10 cannot support our RNDIS device. Except you need to enable the

kernel option, it needs modify the kernel file cdc_ether.c and rndis_host.c.

Let's take 2.6.24 as an example.

The steps are as follows.

1. Modify drivers/net/usb/cdc_ether.c, follow the patch below.

--- ik41_rndis_support/cdc_ether.c 2019-12-06 15:31:00.000000000 +0800

+++ alvin/kernel/linux-2.6.24/drivers/net/usb/cdc_ether.c 2008-01-25

06:58:37.000000000 +0800

@@ -51,12 +51,6 @@

&& desc->bInterfaceProtocol == 1;

}

-static int is_wireless_rndis(struct usb_interface_descriptor *desc)

-{

- return desc->bInterfaceClass == USB_CLASS_WIRELESS_CONTROLLER

- && desc->bInterfaceSubClass == 1

- && desc->bInterfaceProtocol == 3;

-}

#else

#define is_rndis(desc) 0

@@ -117,8 +111,7 @@

* of cdc-acm, it'll fail RNDIS requests cleanly.

*/

rndis = is_rndis(&intf->cur_altsetting->desc)

- || is_activesync(&intf->cur_altsetting->desc)

- || is_wireless_rndis(&intf->cur_altsetting->desc);

+ || is_activesync(&intf->cur_altsetting->desc);

memset(info, 0, sizeof *info);

info->control = intf;

2. Modify drivers/net/usb/rndis_host.c, follow the patch below.

--- ik41_rndis_support/rndis_host.c 2019-12-06 15:13:18.000000000 +0800

Page 17: KEY 41 Software Integration Guide

Page 17/38

+++ alvin/kernel/linux-2.6.24/drivers/net/usb/rndis_host.c 2008-01-25

06:58:37.000000000 +0800

@@ -705,10 +705,6 @@

/* "ActiveSync" is an undocumented variant of RNDIS, used in WM5 */

USB_INTERFACE_INFO(USB_CLASS_MISC, 1, 1),

.driver_info = (unsigned long) &rndis_info,

-},{

- /* RNDIS for tethering */

- USB_INTERFACE_INFO(USB_CLASS_WIRELESS_CONTROLLER, 1, 3),

- .driver_info = (unsigned long) &rndis_info,

},

{ }, // END

};

3. Rebuild kernel

4. Support on Ubuntu

Get the Ubuntu kernel version.

~$ uname –r

Download the same kernel version with Ubuntu from the follow link.

https://mirrors.edge.kernel.org/pub/linux/kernel/

Modify cdc_ether.c and rndis_host.c follow the 1&2 method.

Create a new directory and copy the option.c to new directory.

e.g. mkdir ~/ik41_usb_support_rndis

Copy the Makefile to the new directory ~/ ik41_usb_support_rndis.

Copy the kernel source file drivers/net/usb/usbnet.h to the directory ~/

ik41_usb_support_rndis.

Enter the directory ~/ ik41_usb_support_rndis and execute command make

~$ cd ~/ ik41_usb_support_rndis

~$ make

Example for ubuntu8.04

Please copy the follow file into your Ubuntu 8.04, enter the directory. Then execute the follow

cmd.

Page 18: KEY 41 Software Integration Guide

Page 18/38

sudo –s

make

mv rndis_host.ko cdc_ether.ko /lib/modules/2.6.24-26-

generic/kernel/drivers/net/usb

ik41_rndis_support.zip

3.4 How to create PPP dial-up on Linux

The steps are as follows.

1. Copy the two scripts into PC, any disk or on the Desk

2. Turn on root authority: Access peers, open Terminal, Input “su”

3. Copy the <tcl_chat> into the catalog: /etc/ppp/

Copy the <tcl_main> into the catalog: /etc/ppp/peers

The following screenshot for reference.

4. Access peers, open Terminal, input “pppd call tcl”, PC begins dial up for the

connection. If you need to disconnect the connection, input “killall pppd”. If it prompts

Occupied, input “killall -9 pppd”.

If pppd is not installed yet, connect PC to other available network, and input “apt-get

install pppd” to download pppd, and then follow the above step: input “pppd call tcl”.

Page 19: KEY 41 Software Integration Guide

Page 19/38

5. Execute AT Command:

sudo minicom–D /dev/ttyUSB2, then Enter Key

3.5 How to install ADB and Fastboot on Linux

REFERENCE:

https://www.droidviews.com/install-adb-and-fastboot-on-linux/

https://blog.csdn.net/hpu11/article/details/80308278

The best way to install ADB and Fastboot on Linux or any other OS would be to install the

Android SDK Tools. It comes with ADB and Fastboot bundled and is also regularly updated

by Google. You can download the zip from the download link below.

Download ADB zip for Linux

The steps are as follows.

1. Extract the downloaded zip file to an easy to access location such as the desktop. This

downloaded folder contains all the files necessary to run ADB & Fastboot and requires

no further installation. To use ADB & Fastboot though you will need to access this

folder from a Terminal.

Page 20: KEY 41 Software Integration Guide

Page 20/38

2. Open the Terminal by pressing Ctrl+Alt+T or via whichever app launcher or method

you prefer.

3. In the Terminal, access the extracted folder by using this command:

cd /path/to/extracted/folder/

Replace /path/ to /extracted/folder/ with the actual path to the folder. For instance,

cd /home/username/Desktop/platform-tools_r27.0.1-linux/platform-tools

Alternatively, you can open the folder using Nautilus, which is the default file manager

on most Linux distros, right-click on an empty area and select Open in Terminal.

4. Connect device to your Linux PC now.

5. In the Terminal, enter the following command.

adb devices

Page 22: KEY 41 Software Integration Guide

Page 22/38

4 Windows Integration Scheme

4.1 How to install USB driver on Windows 10

1. Go to Manager->Device Manager, right-click to update driver:

2. Browser my computer for driver software:

Page 23: KEY 41 Software Integration Guide

Page 23/38

3. Browser to find the USB driver path, driver for Windows XP is compatible to Windows

10, 32bit or 64bit:

4. After the driver installs successfully, pop up this window:

Page 24: KEY 41 Software Integration Guide

Page 24/38

5. Application1 Interface and Application2 Interface have the same steps to install USB

driver.

6. If it is still NOK, right click to update driver:

Page 25: KEY 41 Software Integration Guide

Page 25/38

7. Browser my computer for driver software:

8. Select “Let me pick from a list of available drivers on my computer”

Page 26: KEY 41 Software Integration Guide

Page 26/38

9. Unselect “Show compatible hardware”, then can see the listed interfaces, select

“Application1 interface”, and then tap “Next”

4.2 How to create Modem dial-up on Windows10

1. Create dial-up connection:

Go to “Network & Internet settings”-“Dial-up”, select “Set up a new connection”-

“Connect to the Internet”-“Set up a new connection anyway”-“Dial-up”:

Page 27: KEY 41 Software Integration Guide

Page 27/38

Page 28: KEY 41 Software Integration Guide

Page 28/38

Page 29: KEY 41 Software Integration Guide

Page 29/38

Set up the information, “Dial-up phone number” needs to set as “*99#”, others are optional.

Click “Create”:

2. Go to “Network & Internet settings”->”Dial-up”, find the created Dial-up

connection, “Connection1”for example, click “Connect”:

Page 30: KEY 41 Software Integration Guide

Page 30/38

Click “Dial”

3. Check the connection state in network list, also the LED of Key 41 is constant:

Page 31: KEY 41 Software Integration Guide

Page 31/38

4.3 How to create MBIM dial-up on Windows 10

When connecting to Window10, MBIM interface is available as default. And it can dial up in

Windows10 connection manager.

Page 32: KEY 41 Software Integration Guide

Page 32/38

5 Android Integration Scheme

5.1 How to install USB driver on Android

Key 41 supports Android 4.4 and above as plug and play.

Table Android version vs Linux kernel version

Android Version Kernel Version in AOSP

4.4 Kit Kat 3.10

5.x Lollipop 3.16.1

6.0 Marshmallow 3.18.10

7.0 Nougat 3.18.48, 4.4.0

8.0 Oreo 3.18.72, 4.4.83, 4.9.44

8.1 Oreo 3.18.70, 4.4.88, 4.9.56

9.0 Pie 4.4.146, 4.9.118, 4.14.61

10.0 Q 4.9.191, 4.14.142, 4.19.71

5.2 How to create PPP dial-up on Android

It recommends to support Android 4.4 and above.

The PPP dial-up process is similar to that on Linux. Some modifications based on tcl_chat

script:

1. Remove connect options in script:

#connect "/usr/sbin/chat -v -f /etc/ppp/tcl_chat"

#defaultroute replacedefaultroute

2. Execute ATDT*99#

echo –e “ATDT*99#\r\n” > /dev/ttyUSB0

3. Execute pppd

pppd call tcl

Page 33: KEY 41 Software Integration Guide

Page 33/38

6 Device Flash

6.1 How to flash on Windows

TPST is the flash tool for Windows.

6.2 How to flash on Linux

The steps are as follows.

1. Install fastboot tool on Linux, referring to the chapter <How to install ADB and Fastboot

on Linux>.

2. Enable ADB port and access to fastboot mode.

Send AT^FASTBOOT

3. Put the scripts “fastboot_flash_all_linux.sh” and “fastboot_flash_all_with_efs_linux.sh”

into the store path of Software/ModemImage.

4. Run the script “fastboot_flash_all_linux.sh” as root.

If it needs to flash EFS, run the script “fastboot_flash_all_with_efs_linux.sh” instead.

Another way is directly run the commands below to flash each partition one by one. Once

executing “fastboot reboot”, device reboots automatically and works as new SW.

fastboot flash boot % sw_store_path %\mdm9607-boot.img

fastboot flash system % sw_store_path %\mdm9607-sysfs.ubi

fastboot flash modem % sw_store_path %\NON-HLOS.ubi

fastboot flash jrdresource % sw_store_path %\jrdresource.ubi

fastboot flash aboot % sw_store_path %\appsboot.mbn

fastboot flash cdrom % sw_store_path %\b.vhd

fastboot flash sbl % sw_store_path %\sbl1.mbn

fastboot flash tz % sw_store_path %\tz.mbn

fastboot flash rpm % sw_store_path %\rpm.mbn

fastboot flash efs2 % sw_store_path %\efs.mbn //optional

Page 34: KEY 41 Software Integration Guide

Page 34/38

fastboot reboot

6.3 How to flash over the air

For online upgrade, it supports AT+FOTA to flash device over the air. Please refer to Key 41

AT Command User Guide.doc for details of AT+FOTA.

There’re 2 automatically reboots during FOTA process,

⚫ The first reboot happens when executing AT+FOTA=2 to start upgrade, reboot to

access recovery mode and flash into new software

⚫ The second one happens after flash finishing, device automatically reboots and goes

back to normal mode.

Once update fails, LED will light on as Lilac even plug in/out. In this case, it has to upgrade

locally by tool, referring to the chapter <Flash on Windows> and <Flash on Linux>.

For example:

AT+FOTA=1//check new version and start download

OK

+FOTA:1,0,IK41_00_02.00_99// Check succeeds, new version is IK41_00_02.00_99

+FOTA:1,1,IK41_00_02.00_99// Start to download

+FOTA:1,2,IK41_00_02.00_99// Download finishes

AT+FOTA=2// Start upgrade

OK

+FOTA:2,3,IK41_00_02.00_99// will reboot to recovery mode and start to upgrade

automatically

Page 35: KEY 41 Software Integration Guide

Page 35/38

7 Timeout settings for AT command

7.1 Device initialization

Since KEY 41 takes about 17s for initialization when powering on, please. wait for more than

17s once plug in KEY 41 before sending any AT command. The recommended value is 20s.

7.2 AT command response

For all AT commands, it would take different time to complete the operation.

For example, it responses immediately for ATI, but would take minutes to search network via

AT+COPS=?

Since AT port is signal channel and only support serial AT operations, it cannot execute any

other AT commands until receiving the previous one’s response from USB dongle.

In order to making sure every AT command is received and handled properly by USB

dongle, one way is setting up timer on host machine when sending each AT command.

Host machine should wait until AT response received or timer expires. Once timer expires

but no response got, host machine should treat current AT operation as ERROR.

In this case, host machine could re-send the failure AT command for certain times, or even

reboot USB dongle for recover USB communication.

Here’re recommended timeout values for different AT commands in the table below.

The default timeout is recommended as 2s.

AT commands Recommended timeout

Unit: second

AT+COPS=? Get all operators 120

AT+COPS=<mode>[,<format

>[,<oper>>[,< AcT>]]]

Set a specific operator 120

AT+COPS =3,2 Set operator format 2

AT+COPS? Get current registered operator

+COPS: <mode>[,<format>,<oper>,<

AcT>]

2

AT+CFUN Set operation mode 15

AT^RESET Reboot No less than 30

AT&F Factory reset No less than 30

AT+CGATT PS attach or detach 100

AT+CGACT PDP context activate or deactivate 100

Page 36: KEY 41 Software Integration Guide

Page 36/38

AT+CPOL Preferred PLMN list 5

AT+COPN Read operator names 5

ATE0 Enable the prompt 2

ATI Request Identification Information 2

AT+GMI Manufacturing 2

AT+GMR Version of FW 2

AT+GMM Get model ID 2

AT+CGSN Get IMEI 2

AT+CIMI Get IMSI 2

AT+CREG Get/set registration status/format GSM 2/2

AT+CGREG Get/set registration status/format GPRS 2/2

AT+CGDCONT Get/set APN command 2/2

AT+CSQ Signal strength for 2G/3G 2

AT^LTERSRP Signal strength for 4G 2

AT^HCSQ Signal strength for 2G/3G/4G

AT^GETBAND? Get frequency band 2

AT^SYSINFOEX Get system info combined with band get

the text version of the band

2

AT^SYSCFGEX Set network access order and band prefer 2

Page 37: KEY 41 Software Integration Guide

Page 37/38

8 LED Specification

The 3-color LED indicates the network status of device.

LED Indicator Description (State)

Lilac Light constant for seconds Power supply finished

Red light Fast Flashing (5Hz) Network Searching

Constant Red light Out of order (including network

unavailable, no/invalid SIM card)

Blue Light Slow Flashing (1Hz) Registered on LTE Network

Constant Blue Light Connected to LTE Network

Orange Light Slow Flashing (1Hz) Registered on 3G Network

Constant Orange Light Connected to 3G Network

Green Light Slow Flashing (1Hz) Registered on 2G Network

Constant Green Light Connected to 2G Network

Page 38: KEY 41 Software Integration Guide

Page 38/38

9