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. :(
I am in the exact same situation as you. But as far as I can see the problem is a bit more complex than finding the right port name.
If I use the function: string ports = SerialPort.GetPortNames(); on PC it works fine and I can get all the COM-ports. But this won't run on android.
Please let me know find a solution.
Answer by Hogosha77
Feb 01, 2016 at 01:09 AM
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..
Answer by magonicolas
Aug 16, 2016 at 07:03 PM
I need to solve this same problem! Anyone?
Answer by fenomeno69
Nov 25, 2016 at 11:16 AM
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!!!
Answer by andor734
Jan 18 at 12:40 PM
Download a terminal app from Google Play then type the following command into it:
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.
Up to 2 attachments (including images) can be used with a maximum of 524.3 kB each and 1.0 MB total.
The best place to ask and answer questions about development with Unity.
To help users navigate the site we have posted a site navigation guide.
If you are a new user to Unity Answers, check out our FAQ for more information.
Make sure to check out our Knowledge Base for commonly asked Unity questions.
If you are a moderator, see our Moderator Guidelines page.
We are making improvements to UA, see the list of changes.
Answers and Comments
50 People are following this question.
HELP: Arduino Genuino 101 to Unity3D. Serial Communication
Android to single board computer over serial error
Convert an Int to a String
How Do I Activate The Switch Statement
using arduino input in mobile