0

I want to connect my Android phone to another USB host (PC) and exchange some data the most simple way. Reading/writing files seems a bit strange. Bluetooth or WLAN seems some overhead as well. Emulating a serial device sounds easier to me. Simple microcontrollers can expose themselves as USB Serial devices or emulate an USB keyboard to tell something, which seems a lot easier than playing the Host role (besides the need to supply power to the USB wires and external device)

If I understand it correctly, all those terminal utilities use USB-OTG and play USB Host, looking for USB Devices. (?)

I'm pretty new to Android programming (First tutorials in Android Studio)

and want to find some usage for an old Phone (Samsung Fame GT-S6810P with Android 4.1.2) obviously not supporting OTG.

What am I missing obviously, what's the way to go? Or which of my ideas are completely wrong? Hints, where to start learning, are appreciated.

datafiddler
  • 1,755
  • 3
  • 17
  • 30

1 Answers1

3

OTG means that the ARM processor on which the phone is running has to be able to be USB host (USB host mode) (the keyboards, pen drives and other accessories that can be attached are USB devices (USB device mode)) In USB protocol there is only 1 device in host mode in the bus all other devices are in device mode.

so it is not necessary to have OTG /host mode capability for USB serial (CDC ACM class / Virtual COM port) the phone theoretically can also be in device mode. In practice the functionality of a USB CDC ACM device (USB device mode) / virtual COM port is simply not implemented in android and so a USB serial connection from PC to android is not possible because android has not implemented the functionality to be CDC ACM device / virtual COM port (in device mode)

This is the reason why it appears that for USB serial / Virtual COM port it is necessary to have OTG / host mode capability. Actually this is not necessary and the reason why USB serial is not possible is simply that android does not implement the functionality to be a CDC ACM device / virtual COM port in device mode

if a phone is able to be a USB host (OTG capability) it has to have all kernel modules for attached devices like usb-storage for mass storage devices cdc_acm for CDC ACM devices (virtual COM port),...

ralf htp
  • 9,149
  • 4
  • 22
  • 34
  • > not possible because android has not implemented the functionality to be CDC ACM device / virtual COM port (in device mode): That sounds like the show stopper. No easy way to add this device mode functionality to Android? I guess I will learn about bluetooth ... – datafiddler Apr 11 '17 at 22:05