BQ Aquaris E5 HD not detected as GSM modem

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

    My detect_usb script:

    cat < /etc/usb_modeswitch.d/mobile
    DefaultVendor= ${vendor}
    DefaultProduct= ${product}
    TargetVendor= ${vendor}
    TargetProduct= ${product}
    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 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)

    Also trying to send AT commands to the modem (detected as

    /dev/ttyUSB0), fails. The following demo script from python-gsmmodem is

    !/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:\n{2}\n'.format(sms.number, sms.time, sms.text))
        print('Replying to SMS...')
        sms.reply(u'SMS received: "{0}{1}"'.format(sms.text[:20], '...' if len(sms.text) > 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 
        print('Waiting for SMS message...')    
            modem.rxThread.join(230**31) # Specify a (huge) timeout so that it essentially blocks indefinitely, but still receives CTRL+C interrupt signal
    if __name__ == '__main__':

    It returns something as follows:

    # python 0
    Initializing modem...
    INFO: Connecting to modem on port /dev/ttyUSB0 at 9600bps
    DEBUG: write: ATZ
    Traceback (most recent call last):
      File "", line 41, in <module>
      File "", line 33, in main
      File "/usr/local/lib/python2.7/dist-packages/gsmmodem/", line 177, in connect
        self.write('ATZ') # reset configuration
      File "/usr/local/lib/python2.7/dist-packages/gsmmodem/", 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/", line 140, in write
        raise TimeoutException()
    gsmmodem.exceptions.TimeoutException: None

    Any idea what could be wrong?