Hi Gurux team,
I am testing an optical probe/cable with Gurux.Serial.Android 3.0.6, which is the latest version I am currently using.
The same USB serial cable works correctly with Gurux.Serial.Java on my computer, but I am unable to get communication working with Gurux.Serial.Android.
Gurux version
Gurux.Serial.Android: 3.0.6
USB-Serial adapter details
Android detects the USB device successfully with the following information:
Manufacturer: QinHeng Electronics
Vendor ID: 0x1A86
Product: HL-340 USB-Serial adapter
Product ID: 0x7523
Version: 81.34
Chipset: CH34X
USB descriptor:
12 01 10 01 FF 00 00 08 86 1A 23 75 34 81 00 02
00 01 09 02 27 00 01 01 00 80 34 09 04 00 00 03
FF 01 02 00 07 05 82 02 20 00 00 07 05 02 02 20
00 00 07 05 81 03 08 00 01
The same HL-340 cable and optical probe work correctly with Gurux.Serial.Java on the desktop.
Therefore, I believe the cable/probe itself is functional, and the issue may be related to CH34X/HL-340 support or USB serial handling in Gurux.Serial.Android.
Question
Could you please confirm whether Gurux.Serial.Android 3.0.6 supports the CH340/CH34X device with VID 1A86 and PID 7523 (HL-340)?
If it is supported, could you advise what additional configuration or Android USB handling is required?
If there is a known limitation with the CH34X/HL-340 implementation in version 3.0.6, is there a recommended driver/library or code change that I should use?
I can provide the complete Android project, Android version/device model, Gurux configuration, and additional logs if required.
I have tried with your sample app which in project repo, but issue is that we are not receiving anything from device.
can share me some configuration what to changes required at device configuration etc.
Thank you.
Hi, We don't have USB…
Hi,
We don't have USB converter from QinHeng Electronics, but the latest version was tested with the CH34X chipset, and it worked without problems.
Are you using the same baud rate and other settings with GXDLMSDirector and your Android application?
Regards,
Mikko
Hi Mikko, thanks for your…
Hi Mikko, thanks for your quick response.
I am using the same GXSerial configuration as in GXDLMSDirector.
My code works fine with CP21X and FDI optical cables, but with the CH34X optical cable the port is detected and opened successfully, yet no communication occurs between the meter and the app.
Verification steps:
The CH34X cable works with Gurux Serial Java sample on Windows.
The same cable also works with the Serial USB Terminal app on Android.
Given this, are there additional configuration settings (e.g., flow control, DTR/RTS, baud rate adjustments) required for CH34X on Android with GXSerial?
Or can you share any other details that might help resolve this communication issue?
--------------------------------------------------------------------------
val media = GXSerial(context)
val ports = media.getPorts()
Log.d("USB_DEBUG", "Ports count=${ports.size}")
if (ports.isEmpty()) {
Log.e("USB_DEBUG", "No USB serial ports found")
return false
}
for ((index, port) in ports.withIndex()) {
Log.d("USB_DEBUG", "Port[$index]=$port chipset=${port.chipset}")
}
val port = ports[0]
media.port = port
media.baudRate = BaudRate.BAUD_RATE_9600
media.dataBits = 8
media.parity = Parity.NONE
media.stopBits = StopBits.ONE
Log.d("USB_DEBUG", "Opening ${port} chipset=${port.chipset}")
// Store it before opening.
mDevice.media = media
media.open()
Log.d("USB_DEBUG", "GXSerial opened: isOpen=${media.isOpen}")
------------------------------------------------------------------------------------
If you want to anything from me, reply me
Hi, Can you try to add this…
Hi,
Can you try to add this after open?
media.setDtrEnable(true);
media.setRtsEnable(true);
BR,
Mikko
Hi, thank you, Kurumi for…
Hi Kurumi,
Thank you for your quick response.
As you suggested, I had already tried enabling DTR and RTS using the following:
media.setDtrEnable(true);
media.setRtsEnable(true);
However, I am still facing the same issue.
Could you please suggest what else I can check or try?
Hi, I received information…
Hi,
I received information from the manufacturer that there are two versions of the chipset. The chipset version is now read, and version 3.0.7 fixes your problem.
BR,
Mikko
Thank you kurumi for great…
Thank you kurumi for great support, now it is working