Android tool-how to send at commands to mobile phones in Linux

Source: Internet
Author: User
Tags dmesg

If the driver is installed in win, you can send at through the Super Terminal or serial port tool. After a long time, you can send at to your mobile phone under mongotun. To sum up, you need to issue the AT command in Linux: the serial port debugging assistant cutecom and the Linux Command modprobe (this command very import needs to be supplemented ).

First, install cutecom. you can install it through apt. After installation, you can send at in the following order:

1. Start cutecom on the terminal: $ sudo cutecom &

2. boot the mobile phone and load the USB to the serial drive to the system: $ sudo modprobe usbserial vendor = 0x05c6 Product = 0x9018

Connect the USB cable to the mobile phone.

Note:

1) The value of vendorid and productid can be viewed in the Device Manager under Win to view the "Detailed driver information" of the corresponding port, my is the chip of msm7627.

2) run this command to verify whether the installation is successful:
Method 1: dmesg | grep USB, which is displayed as follows (I have five serial ports)
[2, 20960.704231] USB 1-5: configuration #1 chosen from 1 choice
[20960.705000] usbserial_generic 1-5. 0: Generic converter Detected
[2, 20960.705067] USB 1-5: Generic converter now attached to ttyusb0
[20960.705127] usbserial_generic 1-5. 1: Generic converter Detected
[2, 20960.705177] USB 1-5: Generic converter now attached to ttyusb1
[20960.705232] usbserial_generic 1-5. 2: Generic converter Detected
[2, 20960.705280] USB 1-5: Generic converter now attached to ttyusb2
[20960.705348] usbserial_generic 1-5. 3: Generic converter Detected
[2, 20960.705395] USB 1-5: Generic converter now attached to ttyusb3
[20960.705464] usbserial_generic 1-5. 4: Generic converter Detected
[2, 20960.705515] USB 1-5: Generic converter now attached to ttyusb4
Method 2 :~ $ Ls/dev/ttyu * corresponding to which the following devices are listed. If not, this will not work.

/Dev/ttyusb0/dev/ttyusb1/dev/ttyusb2/dev/ttyusb3/dev/ttyusb4

Method 3 :~ $ Lsmod | grep usbserial
Usbserial 43568 0
Method 4: If the Device Manager is installed, you can enter the graphical interface, similar to the Device Manager tree interface under win, you can see:

Usb ehci Controller --> Hub --> USB device --> four USB Interfaces
1 USB Mass Storage (SCSI) Interface

3. Enter/dev/ttyusb2 in the device option on the cutecom interface (the drop-down list may not be listed. You need to enter it manually. Try ttyusb * one by one. ~> _ <~), Other baudrate stopbits

Then click open device to send :)

Another note is that once the USB port is switched to the serial port (modprobe sbserial is executed), the log or ADB shell cannot be viewed in ddms unless the USB Serail is restarted or uninstalled, you can unmount the USB or click Close device in cutecom, and then run $ sudo modprobe-r usbserial.

How to Use minicom to output log (USB to serial port)

Reference

1. miniora17 USB to serial minicom settings

2. Use the LINUX serial port tool minicom

The log cannot be output because/dev/ttys0 is always set. The original USB-to-serial port must be set to/dev/ttyusb0. the actual serial port must be set to/dev/ttys0.

Check for connection:

1. $ lsusb

Bus 002 device 054: Id 067b: 2303 prolific technology, Inc. pl2303 serial port
Bus 002 device 036: Id 1782: 5d04 spreadtrum Communications Inc.
Bus 002 device 002: Id 8087: 0024 Intel Corp. Integrated Rate Matching Hub
Bus 002 device 001: Id 1d6b: 0002 Linux Foundation 2.0 root Hub

2. After the plug-in is completed, run $ dmesg | Tali-f or dmesg | grep ttyusb0.

273437.150877] USB 2-1.1: pl2303 converter now attached to ttyusb0

Must be run as root, $ sudo minicom

Minicom mainly configures port settings (CTRL + A and then press O)

And output log file path (CTRL + A and then press L)

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.