5

It looks like the UsbManager is gone in the build. How do we communicate with usb peripherals now?

Things like usb->serial etc using https://github.com/mik3y/usb-serial-for-android

annymsMthd
  • 94
  • 4

3 Answers3

2

Currently the Peripheral HAL doesn't recognize usbserial based UART peripherals.

But if your usbserial device (ex: Arduino) exposes individual UART TX RX pins, you can communicate with it using the UART Peripheral API.

Caveat:

Community
  • 1
  • 1
proppy
  • 10,495
  • 5
  • 37
  • 66
  • 1
    This is a good explanation of using a uart but what I'm really trying to find out is if there will be full usb support. I would like to eventually build an expansion board with cell, gps, and possible other peripherals. Being limited by the number of uarts could be a setback. – annymsMthd Dec 15 '16 at 00:03
  • Ideally the HAL would add new `UartDevice` to the [Peripheral API](https://android-dot-devsite.googleplex.com/things/sdk/pio/uart.html) as they get plugged in. Maybe you can file a [feature request](https://code.google.com/p/android/issues/entry?template=Android%20Things%20feature%20request)? – proppy Dec 15 '16 at 02:25
2

It is stated on the known issues part of the release notes that USB support is disabled on the developer preview 1.

However I did a quick test on the Pi3 and high level peripherals such a keyboard work and send the correct events to the app. It is just the low level access what is disabled.

shalafi
  • 3,926
  • 2
  • 23
  • 27
1

As @devunwired commented in the Google's IoT Developers Community: USB accessory support is not currently enabled is the RC1 preview.

Community
  • 1
  • 1
proppy
  • 10,495
  • 5
  • 37
  • 66