I need to connect arduino and android device via USB and send data via serial port with Unity.

My Problem is to find the USB port name in android, in PC you can see the name of the USB port (COM5 for example) but in Android i don’t know how i can see these.

When I call these:
SerialPort serial = new SerialPort(“COM5”,9600);
the game works on PC but not in android because I dont know what is the name port.
I try everything
COM0, COM1, COM2
tty/USB
“/dev/bus/usb/001/005”

I need to find this. :frowning:

Has anyone a solution for this problem? Got exactly the same. With a Serial Monitor App, i can communicate with the serial device but not within unity…

I need to solve this same problem! Anyone?

I have the same problem… I made the game in Unity and I want to connect an Android Device with Arduino to play the game via USB connection!!!

Download a terminal app from Google Play then type the following command into it:

ls /dev

Repeat with the device plugged in, and look for a file that appears in your ‘/dev’ folder when you connect the device. That’s your device name: ‘/dev/’

BTW, There may be a problem with unity in this respect, as the dll’s necessary for SerialPort don’t get loaded with the android version for some reason. Trying to figure this out.