3

I am trying to setup a Nexus One phone to communicate with an application running on a Linux tablet.

On the phone side of things, the Nexus One is Android 2.3.4 so it has the USB accessory library on it. And I have created an application Android following the instructions on http://developer.android.com/guide/topics/usb/accessory.html. I have verified that the Android application works by plugging it into the Microchip Accessory Development Starter kit and connecting to it.

On the Linux side of things, I have configured it to register the Nexus device with the usbserial module and create a ttyUSB0 device when the phone is plugged in. I have verified my application reads and writes to ttyUSB0 correctly. I did this by connecting it to a serial port on another computer and watching data come in through minicom.

Unfortunately The Android developer website does not cover any configuration that host devices (in my case, my Linux tablet) need to perform. In other words, what protocol does the Linux heed to follow to communicate with the phone?

linsek
  • 3,334
  • 9
  • 42
  • 55
  • On the Linux tablet side, does Linux recognise the Nexus One at all? Does it appear in `lsusb` output? If it does, what USB descriptors does Linux see (look under `/sys/bus/usb/devices/...`)? – Adrian Cox Sep 23 '11 at 07:03
  • @AdrianCox Yes, Linux recognizes the device and I am able to register it with the usbserial module to create a ttyUSB node. I am also able to read/write to that successfully. I have determined the problem is the protocol the Linux application is following for tx/rx data with the phone. Unfortunately at this point I am not sure how to figure out what that needs to be. I am trying to browse through the Microchip application running on the PIC that is working, but even following the protocol they are using it doesn't seem to be working. I have to be missing something, just not sure what... – linsek Sep 23 '11 at 18:52
  • I've developed USB drivers, but I'm not familiar with Android. Is the Linux host talking to the modem part of the Nexus One (tethering) rather than to your application code? You can check this by opening a terminal to the ttyUSB node under Linux, then typing modem commands such as ati. – Adrian Cox Sep 23 '11 at 21:19

1 Answers1

2

This is not possible. After further research it is not possible to communicate with the Android device using serial USB communication. To communicate with Android applications through Linux use the libusb-1.x library.

linsek
  • 3,334
  • 9
  • 42
  • 55