Error overflow reading serial number of USB device - java

I'm trying to read the serial number of a device using javax usb library,
and I'm getting this error :
[javax.usb.UsbPlatformException: USB error 8: Unable to get string descriptor languages: Overflow]
The line is simply :
device.getUsbStringDescriptor(descript.iManufacturer());
Someone already had this error ?
Thanks,

I had this error because I hadn't the right driver on a CDC device.
With the Zadig application http://zadig.akeo.ie/
I could install the WINUSB driver on my device.
And this worked fine on a Microchip Demo Board.
Yet the exception remained on my own prototype board. The VUSB connection was not correct.This works fine correctly now in the power-off mode (i.e. the power is not provided by the USB)

Related

BlueCove cannot connect do Device "Permission Denied [13]"

I am trying to connect to a bluetooth device, which i can pair to when setting the target device in pair mode, but trying to reconnect with the following method causes errors.
The Code that causes it:
StreamConnection streamConnection = null;
try {
streamConnection = (StreamConnection)Connector.open("btspp://A0E6F8FECB26:1;authenticate=false;encrypt=false;master=false");
callback.onSocketCreated(streamConnection);
callback.onConnectionSucceed();
} catch (IOException e) {
// TODO Auto-generated catch block
e.printStackTrace();
}
The Exception That occurs
java.io.IOException: Failed to connect. [13] Permission denied
at com.intel.bluetooth.BluetoothStackBlueZ.connectionRfOpenClientConnectionImpl(Native Method)
at com.intel.bluetooth.BluetoothStackBlueZ.connectionRfOpenClientConnection(BluetoothStackBlueZ.java:574)
at com.intel.bluetooth.BluetoothRFCommClientConnection.<init>(BluetoothRFCommClientConnection.java:37)
at com.intel.bluetooth.MicroeditionConnector.openImpl(MicroeditionConnector.java:379)
at com.intel.bluetooth.MicroeditionConnector.open(MicroeditionConnector.java:162)
at javax.microedition.io.Connector.open(Connector.java:83)
at insight.utils.ConnectionEstablisher.run(ConnectionEstablisher.java:170)
I have to use Java and this is the only Library I found (That somewhat works) for this purpose:
BlueCove version 2.1.1-SNAPSHOT on bluez
I am on Arch Linux with the newest bluez Version and I have already tried This Fix to no avail.
Any help is appreciated
So essentially, the issue was the entire Bluetooth Stack / how it propagates "pairing requests" to the Bluetooth Stack.
As a sidenote I was using BlueZ (5.56) on Arch Linux and the bluecove library for Java.
I was looking into alternative Bluetooth Stacks and thought about trying the same code on Windows 10, which doesnt use the BlueZ Stack.
Windows then popped up a window where it asked if i wanted to pair to this device.
This was the main difference between Windows and Linux.
Windows / its bluetooth stack or whatever is responsible for it, actually registered the device as "paired".
This then allowed me to re-connect to the device without any "Permission Denied" issues.
Hope this helps anyone that has to deal with this library or has similar issues.

Android BLE scanning

O/S Android 11.
I have developed an application with BLE scanning. It does not do any connection to BLE devices. It just get list of near by devices. App works fine. I can see following error registered in the Logcat each time I stop and start the scan. Can any one please tell me what is wrong.
E/BtGatt.GattService: [GSIM LOG]: gsimLogHandler, msg: MESSAGE_SCAN_START, appName: com.ttt.ttt.vctap, scannerId: 11, reportDelayMillis=0
E/BtGatt.GattService: [GSIM LOG]: gsimLogHandler, msg: MESSAGE_SCAN_STOP, appName:com.ttt.ttt.vctap, scannerId: 11, reportDelayMillis=0
The two log lines in the question:
E/BtGatt.GattService: [GSIM LOG]: gsimLogHandler, msg: MESSAGE_SCAN_START, appName: com.ttt.ttt.vctap, scannerId: 11, reportDelayMillis=0
E/BtGatt.GattService: [GSIM LOG]: gsimLogHandler, msg: MESSAGE_SCAN_STOP, appName:com.ttt.ttt.vctap, scannerId: 11, reportDelayMillis=0
do not indicate any error. They indicate normal operation.
These log lines are specific to Samsung devices. They indicate that the Android app with applicationId com.ttt.ttt.vctap has started a BLE scan (first line). The second log line indicates that the scan has been stopped.
Try these, after doing this I managed it to work (not everytime but yes)
Steps:
Bluetooth data clear from system app
Reset Bluetooth data (network settings)
https://youtu.be/eGNKTeS_iDg

How to solve ERR_CONNECTION_REFUSED error

Error & Codes
My codes and error are in that link of picture "Error & Codes"
Hi everyone, you all doing well,
Im having a problem about WebView, i have tried many ways but I'm still getting this err_connection_refuse error and i cant solve it. Can anyone see what my problem is ?
I'm trying to use this way to show the world map in that web address on my phone but if there are any suggestion, I'm open to it.
(Android Studio 4.0 + Java + API 28 + Blacked URL address due to company policy )
Thank you :)
IMPORTANT NOTE :
That site can only be reached with VPN (i can reach it from web browser on computer) but i have installed cisco anyconnect VPN to emulator and secured connection too.

Android (Processing3) Java: "Lost connection while installing device"

I'm using processing 3, and I have been having trouble getting AndroidMode to work. I was asking questions, on their official forums, but they got to the point they just said "Google it".
I keep getting:
"Lost connection while installing device" and:
-post-build:
debug: Failure [INSTALL_FAILED_DEXOPT] Shutting down any existing adb
server...
Sometimes the error output is different, but it always loses connection.
(And I've tried it with the examples, and anything no matter what code you type it fails)

Error Win XP setting serial port state

I have the following code fragment to show a HELLO WORLD by a USB Device (Display Posiflex PD-2800 for POS).
I use the GiovynetDrive library to manage a virtual COM port.
The code runs perfectly (assuming the COM3 is available).
SerialPort = new SerialPort();
Parameters settings = new Parameters();
settings.setPort("COM3");
settings.setBaudRate(Baud._19200);
Port = new Com(settings); //<<--Seting crash when restart
Port.sendString("HELLO WORLD");
Port.close();
My problem is that when I turn off the computer, it doesn't turn off the device (USB power). This cause that the next startup, the code throws the Exception:
java.lang.Exception: Error setting serial port COM3 state.
at giovynet.nativelink.SerialPort.openPortC(Native Method)
at giovynet.serial.Com.<init>(Com.java:48)
.........
This forces me to unplug and plug the USB device and then it works well again.
I think this behavior of the S.O. is configurable, but I don't know as.
UPDATE:
When the USB device is in the restart pending state, I can make a print test without problems using a text only printer (generic driver of the S.O.). Then I can see the print test by my viewer but from my java code still not working until I unplug it.
The S.O. is Windows XP and the USB root HUB (of the device management) have unabled the option "Allow the computer turn off the device to save energy".

Categories

Resources