react-native-serialport icon indicating copy to clipboard operation
react-native-serialport copied to clipboard

Questions

Open ovidius72 opened this issue 5 years ago • 17 comments

Thank you for this library, I'm new on react-native, so I have a few questions, that hopefully you can help me to clarify:

I need a way to send data from and android device to a PC. I'm using this library and I can see usb devices only when i enable OTG in the system settings, otherwise nothing is detected.

Doing so tough, the PC is not able to detected the attached android device.

I've set up screen that uses the same code as in the documentation and did some test wit OTG enabled, trying to send data with RNSerialport.writeString('test') but i get a Device Not Supported error.

Can you please help me to understand how to set it up so that I can get usb devices without enabling OTG ? And regarding the "device not supported" error, does it means that perhaps the library is not compatible with the usb chip integrated with the tablet ? Thanks.

ovidius72 avatar Apr 03 '19 14:04 ovidius72

Hi, I've never tried this. I'm not sure if the COM ports on the computer behave like a serial port by default. If you have received a device not supported error, the device you are trying to connect to is not supported. I can't test for today because I don't have the proper equipment. I'il try to find information tomorrow.

melihyarikkaya avatar Apr 03 '19 16:04 melihyarikkaya

@melihyarikkaya That would be very helpful. Thank you

ovidius72 avatar Apr 03 '19 16:04 ovidius72

Hi, This library connects with the serialport (serial device) module. Computer and android device USB input is USB host by default and is not USB device. See link I hope I understand the problem.

melihyarikkaya avatar Apr 04 '19 07:04 melihyarikkaya

Hi @melihyarikkaya You are right, I've also seen that page and that is indeed a problem for my use case. However the tests I've done were with devices like a printer and a USB stick. As I said I can detect these devices only when in OTG mode. When detected I try to connect with RNSerialport.connect(deviceName, 9600) but i always get unsupported device. Do you know what the problem could be ? Maybe because the device drivers are required ? Thanks.

ovidius72 avatar Apr 04 '19 07:04 ovidius72

This indicates that the device driver is not supported by the library. I didn't update felHR85/UsbSerial. I plan to make the uptade soon. Maybe the new version can support the device. Which device are you using?

melihyarikkaya avatar Apr 04 '19 08:04 melihyarikkaya

This indicates that the device driver is not supported by the library. I didn't update felHR85/UsbSerial. I plan to make the uptade soon. Maybe the new version can support the device. Which device are you using?

This could be great to update felHR85/UsbSerial but beware it will require some new dependencies (Java 1.8 need and others) and this will be reflected on calling projects.

allan-cornet-eove avatar Apr 04 '19 08:04 allan-cornet-eove

@melihyarikkaya I've tested connecting an HP Deskjet Printer 3520, a SanDisk Pen Drive, an Android Phone. All of them are detected, meaning that when i call getDevices they are listened. But when i try to connect it give me the Not Supported Error.

ovidius72 avatar Apr 05 '19 08:04 ovidius72

To debug, you can try to use droidterm app on android store based on USbSerial, if you can see some frames (communication between your android device and others device) you have a trouble with your code.

allan-cornet-eove avatar Apr 05 '19 08:04 allan-cornet-eove

Thanks @allan-cornet-eove From droidterm UsbVirtualSerial Port i see: Usb device not supported: unknown device Vendor HP Inc. From USB Viewer I can see 1 interface with 3 endpoints when no device is connected. The tablet has 2 usb port and 1 serial port. When I connect the printer it shows 5 interfaces, each of them has 2/3 endpoints.

Maybe I'm using the wrong interface ? If i have my printer listed at the inteface 5, endpoint 1, how should i set RNSerialport.setInterface ? Thanks

ovidius72 avatar Apr 05 '19 09:04 ovidius72

"From droidterm UsbVirtualSerial Port i see: Usb device not supported: unknown device Vendor HP Inc." so, react-native-serialport can not support this device. @melihyarikkaya, your opinion ?

allan-cornet-eove avatar Apr 05 '19 09:04 allan-cornet-eove

An error message occurs when the interface is incorrect. If you see the message device not supported, there is no driver for this device.

melihyarikkaya avatar Apr 05 '19 10:04 melihyarikkaya

That happens event with a USB stick, is a driver required for it ? I'm start thinking something with the Tablet ports might be wrong.

ovidius72 avatar Apr 05 '19 11:04 ovidius72

I can't find information on the internet for your printer serial port support.

melihyarikkaya avatar Apr 05 '19 11:04 melihyarikkaya

How can i read the payload as ASCII or string?

ItaloSa avatar Apr 22 '19 13:04 ItaloSa

Moved here

melihyarikkaya avatar Apr 22 '19 13:04 melihyarikkaya

I have a PAX s90 pos system i am trying to establish communication with, but it keeps display device not supported. Any suggestions?

codegenuis avatar Nov 15 '19 12:11 codegenuis

Can I set the buffer size when I read the connected device?

chrispop avatar Jul 12 '20 07:07 chrispop