Search code examples
androidusbserialthermal-printer

Generic USB device on Android


I'm trying to send data to a generic thermal printer on Android. I can see via dmesg that it does detect a device there, however no nodes such as usblp0, lp0, ttyUSB0, etc. are created. dmesg states that it is a Generic Bulk Device. Enumerating Android's UsbManager.getDeviceList() always returns an empty set.

After reading up on how devices, drivers, nodes, etc. are created on Linux, my best guess as to what is happening is that the kernel is not creating the node, or associating the device with some sort of serial driver.

If it's too difficult to create nodes on Android, is there a way I can simply echo to the bulk endpoint of the device?

So far I've tried a Nexus 7 2012, Nexus 7 2013, and Acer A500. All of those are supposedly able to support real USB host mode. The furthest I've gotten was that the A500 actually said something about usblp0 and Unidirectional, but did not create a node in /dev.


Solution

  • For anyone attempting to do the same thing, UsbManager.getDeviceList() still returns an empty set. I was able to associate the driver "option1" by following this: http://www.ha19.no/usb/. After that, dmesg stated that /dev/ttyUSB0 was finally created! I then had to chmod it appropriately under root, which is unfortunate, but workable for now.