Serial OTG Android Mode on PC (Android-Arduino)

Hi, i want to know hot to use the Processing Android mode, serial(OTG) communication with arduino nano! I found an library but it didn’t work for me, just exits without error message! Thanks for the help!

Hi

1 Like

Hi

If you couldn’t do it after reading I can help you

1 Like

hi, thanks for the answer, found your thread earlyer! I’m strugglig for days now with no succes. Now i read that i need to try the speed 57600. I will try it tomorrow. In my example the app just exits with no error message. Thanks again for the fast response! :slight_smile:

jafal

May 24

This is OTG working example

1 Like

Hi!
I’ve tried your example code, changed the Manifest file, added the device_filter.xml in the root/res/xml.
Uploaded the sketch without any error. Now when i plug my arduino nano to the phone it suggest me the sketch to start, thats seems good, but after that it just exits without any reason or error message. Tried another android device, same issue. Did i miss something?

Hi

What is your Arduino USB chip?

2 Likes

Hi

Are you sure that your android support OTG ?

2 Likes

the chip is CH340G, my android support otg, tested with a wiresless keyboard with touchpad, and it works well.

Hi

I have tested it with Atmega16u2 only

Which serial library you used ??

1 Like

Wireless and at the same time has OTG right ?

1 Like

the keyboard i used has an USB receiver plugged to the android device through OTG cable. The arduino chip is ATMEL M328P. Release 0.1.0-alpha · inventit/processing-android-serial · GitHub thats the link to the library.

yes The arduino chip is ATMEL M328P. but i used the one with Atmega16u2 usb driver not the CH340G chip

1 Like

thanks unfortunatelly i can’t test that, i don’t have one.

Ok I have both I am going to test your and reply you tomorrow

1 Like

that would be great!

i’ve installed the app ‘serial USB terminal’ on the android device, and it sees the arduino board, so i think the physical connection is working well.

hi

i have not test yet but for now try to change device_filter.xml with this and inform what you got

<?xml version="1.0" encoding="utf-8"?>
<!--
https://github.com/mik3y/usb-serial-for-android/blob/master/usbSerialExamples/src/main/res/xml/device_filter.xml
-->
<resources>
    <!-- 0x0403 / 0x6001: FTDI FT232R UART -->
    <usb-device vendor-id="1027" product-id="24577" />

    <!-- 0x0403 / 0x6015: FTDI FT231X -->
    <usb-device vendor-id="1027" product-id="24597" />

    <!-- 0x2341 / Arduino -->
    <usb-device vendor-id="9025" />

    <!-- 0x16C0 / 0x0483: Teensyduino  -->
    <usb-device vendor-id="5824" product-id="1155" />

    <!-- 0x10C4 / 0xEA60: CP210x UART Bridge -->
    <usb-device vendor-id="4292" product-id="60000" />

    <!-- 0x067B / 0x2303: Prolific PL2303 -->
    <usb-device vendor-id="1659" product-id="8963" />

    <!-- 0x1a86 / 0x7523: Qinheng CH340 -->
    <usb-device vendor-id="6790" product-id="29987" />
</resources>
1 Like

unfortunatelly it does the same thing :S

Hi

With Arduino uno works fine but with nano keep crashing

1 Like