Hi there,
Im using UsbSerial lib 2.3 to connect to an arduino, it works perfect BUT only if the arduino is the ONLY device connected to the USB to my Android TV BOX
If I have an USB mouse connected, the program doesn't find the arduino.
I can connect the arduino, run the soft, connect, and then plug the mouse...
I run the code using the IR remote control, with the key 3 to run the 'ask for permission' on the first time and the real connection on the second time, it just works
Also, is there any easy option to dont have to ask for permission every time I power on the BOX ?
Thanks in advance!
Im using UsbSerial lib 2.3 to connect to an arduino, it works perfect BUT only if the arduino is the ONLY device connected to the USB to my Android TV BOX
If I have an USB mouse connected, the program doesn't find the arduino.
I can connect the arduino, run the soft, connect, and then plug the mouse...
I run the code using the IR remote control, with the key 3 to run the 'ask for permission' on the first time and the real connection on the second time, it just works
Also, is there any easy option to dont have to ask for permission every time I power on the BOX ?
Thanks in advance!
B4X:
If KeyCode = KeyCodes.KEYCODE_3 Then
If usb.UsbPresent = usb.USB_NONE Then
Msgbox("No USB device or accessory detected!", "Error")
Log("No USB device or accessory detected!" )
Return
End If
Log("Checking permission")
If (usb.HasPermission) Then
' Msgbox(usb.DeviceInfo, "Device Information")
Log(usb.DeviceInfo )
Dim dev As Int
dev = usb.Open(115200)
If dev <> usb.USB_NONE Then
Log("Connected successfully!")
astreams.Initialize(usb.GetInputStream, usb.GetOutputStream, "astreams")
Else
Log("Error opening USB port")
End If
Else
Log("Request permission !!")
usb.RequestPermission
End If
End If