How can I communicate an Android Accessory with a USB Serial Port?
Asked Answered
W

1

5

Hereby the situation: I'm working on a Android Tablet that must work in Accessory mode. Reason why is because the tablet can't provide enough power to perform the communication with a Serial USB microcontroller and remain charging it's battery.

enter image description here

In order to achieve a successful communication, I must be able to set a few serial conditions for Modbus/RTU

  • Serial Port Address (i.e. COM1, COM2...)
  • Baud Rate (19200 bps)
  • Data Bits (8)
  • Stop Bits (1)
  • Parity (None)

An excellent example in Delphi would be Modlink.

A good guidance would be UART https://github.com/ytai/ioio/wiki/UART

Meanwhile, I've found some useful projects but they were intended to work on Host mode.

https://github.com/mik3y/usb-serial-for-android https://github.com/ksksue/Android-USB-Serial-Monitor-Lite

I'm looking for any valuable information, guidance and references on how should I proceed to create an Android Application that can communicate with Serial USB.

How can I achieve this?

Note: I'm using Android Studio.

Woodchuck answered 3/2, 2015 at 13:7 Comment(0)
W
2

There's an excellent source code made by FTDI Chip, so if you ever need to perform USB/ftdi connections with Android try this application:

FTDI UART TERMINAL

Source code: http://www.ftdichip.com/Android.htm

Woodchuck answered 5/2, 2015 at 15:29 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.