← Back to team overview

ubuntu-phone team mailing list archive

[Hardware] BQ Aquaris E5 HD (Ubuntu Edition) not detected as a GSM Modem

 

Hi,

I have a BQ Aqueris E5 HD (Ubuntu Edition). I want to detect that phone as a GSM modem (to send AT commands) in my ubuntu 15.10 desktop. I have tried the following:

My detect_usb script:

vendor=$1
product=$2
cat <<EOF > /etc/usb_modeswitch.d/mobile
DefaultVendor= $vendor
DefaultProduct= $product
TargetVendor= $vendor
TargetProduct= $product
MessageContent="5553424312345678c00000008000069f030000000000000000000000000000"
#MessageContent="55534243f4fa00000000000000000600000000000000000000000000000000"
#MessageContent="5553424356fb00000000000000000600000000000000000000000000000000"
EOF
service modemmanager restart
service udev restart
rmmod option
rmmod usb_wwan
rmmod usbserial
usb_modeswitch -I -W -c /etc/usb_modeswitch.d/mobile
sleep 2
modprobe usbserial vendor=$vendor product=$product
sleep 2
modprobe usb_wwan
sleep 2
modprobe option
sleep 2
vndr=`printf "%x" $vendor`
prdt=`printf "%x" $product`
echo "$vndr $prdt" > /sys/bus/usb-serial/drivers/option1/new_id



Executing lsusb command on the device shows as follows:

Bus 004 Device 004: ID 2a47:0c02 <------- This apparently is the device (no name)
Bus 004 Device 003: ID 0781:5590 SanDisk Corp.
......
Bus 001 Device 001: ID 1d6b:0002 Linux Foundation 2.0 root hub
Bus 003 Device 004: ID 2188:0ae1

Executed the above detect_usb script as follows:

detect_usb 0x2a47 0x0c02

After this, the following message was displayed in /var/log/syslog:

Nov 9 08:14:32 family-desktop kernel: [ 1038.246463] usbcore: registered new interface driver usbserial Nov 9 08:14:32 family-desktop kernel: [ 1038.246487] usbcore: registered new interface driver usbserial_generic Nov 9 08:14:32 family-desktop kernel: [ 1038.246504] usbserial: USB Serial support registered for generic Nov 9 08:14:32 family-desktop kernel: [ 1038.246525] usbserial_generic 4-1.8:1.1: The "generic" usb-serial driver is only for testing and one-off prototypes. Nov 9 08:14:32 family-desktop kernel: [ 1038.246528] usbserial_generic 4-1.8:1.1: Tell linux-usb@xxxxxxxxxxxxxxx to add your device to a proper driver. Nov 9 08:14:32 family-desktop kernel: [ 1038.246530] usbserial_generic 4-1.8:1.1: generic converter detected Nov 9 08:14:32 family-desktop kernel: [ 1038.246648] usb 4-1.8: generic converter now attached to ttyUSB0 Nov 9 08:14:36 family-desktop kernel: [ 1042.266838] usbcore: registered new interface driver option Nov 9 08:14:36 family-desktop kernel: [ 1042.266865] usbserial: USB Serial support registered for GSM modem (1-port)<br><br>

Also trying to send AT commands to the modem (detected as /dev/ttyUSB0), fails. The following demo script from python-gsmmodem is used:

!/usr/bin/env python

"""\
Demo: handle incoming SMS messages by replying to them

Simple demo app that listens for incoming SMS messages, displays the sender's number
and the messages, then replies to the SMS by saying "thank you"
"""

from __future__ import print_function

import logging
import sys

PORT = "/dev/ttyUSB%s" % (sys.argv[1])
BAUDRATE = 9600
PIN = '<My PIN>' # SIM card PIN (if any)

from gsmmodem.modem import GsmModem

def handleSms(sms):
print(u'== SMS message received ==\nFrom: 0\nTime: 1\nMessage:\n2\n'.format(sms.number, sms.time, sms.text))
print('Replying to SMS...')
sms.reply(u'SMS received: "01"'.format(sms.text[:20], '...' if len(sms.text) &gt; 20 else ''))
print('SMS sent.\n')

def main():
print('Initializing modem...')
# Uncomment the following line to see what the modem is doing:
logging.basicConfig(format='%(levelname)s: %(message)s', level=logging.DEBUG)
modem = GsmModem(PORT, BAUDRATE, smsReceivedCallbackFunc=handleSms)
modem.smsTextMode = False
modem.connect(PIN)
print('Waiting for SMS message...')
try:
modem.rxThread.join(230**31) # Specify a (huge) timeout so that it essentially blocks indefinitely, but still receives CTRL+C interrupt signal
finally:
modem.close();

if __name__ == '__main__':
main()

It returns something as follows:

# python sms_handler_demo.py 0
Initializing modem...
INFO: Connecting to modem on port /dev/ttyUSB0 at 9600bps
DEBUG: write: ATZ
Traceback (most recent call last):
File "sms_handler_demo.py", line 41, in &lt;module&gt;
main()
File "sms_handler_demo.py", line 33, in main
modem.connect(PIN)
File "/usr/local/lib/python2.7/dist-packages/gsmmodem/modem.py", line 177, in connect
self.write('ATZ') # reset configuration
File "/usr/local/lib/python2.7/dist-packages/gsmmodem/modem.py", line 413, in write responseLines = super(GsmModem, self).write(data + writeTerm, waitForResponse=waitForResponse, timeout=timeout, expectedResponseTermSeq=expectedResponseTermSeq) File "/usr/local/lib/python2.7/dist-packages/gsmmodem/serial_comms.py", line 140, in write
raise TimeoutException()
gsmmodem.exceptions.TimeoutException: None

Any idea what could be wrong?

Thanks and Regards,
Suchindra Chandrahas



Follow ups