star-micronics / react-native-star-io10

react-native-star-io10 is a library for supporting application development for Star Micronics devices.
Other
89 stars 55 forks source link

Interface type USB is not working with example app #71

Closed vatsal-gadhiya-searce closed 2 years ago

vatsal-gadhiya-searce commented 2 years ago

Description

I tried building an example app and selected USB and entered my printers Star Micronics TSP654iiHIX cloud printer. But it is giving error. Find attached Error I have added as alert instead of console.log in the example code.

Your device where the bug occurs

Your printer

To Reproduce

Steps to reproduce the behavior:

  1. Build the example app in android for print.
  2. Select Usb as interface type from dropdown and type your mac address
  3. See error in catch block of print function

Expected behaviour

The print should work as I have connected my android device with my printer via USB.

Screenshots

d23ede34-d243-41ba-9d82-43786ca73851

Additional context

I just want to print via USB with my existing star micronics cloud printer TSP654 (STR_T-001). But it gives error I think on StarConnectionSettings as per the line number suggestions. Can anyone please help. We are already using cloud printer and now want to use it as USB.

bandit-ibayashi commented 2 years ago

@vatsal-gadhiya-searce The identifier 00:11:62:0D:E6:21 is the MAC address of the Ethernet port, which is used for LAN connections.

For the identifier when connecting to USB with Android, you can specify the USB Serial Number of your printer or set nothing. https://star-m.jp/products/s_print/sdk/react-native-star-io10/manual/en/api-reference/star-connection-settings/identifier.html#star-connection-settings-identifier

vatsal-gadhiya-searce commented 2 years ago

@bandit-ibayashi Anyway I am unable to discover the connected printer and getting the above error. Seems the same issue as https://github.com/star-micronics/react-native-star-io10/issues/28

Not sure how it is resolved?

gare-bear commented 2 years ago

@vatsal-gadhiya-searce,

First, verify that your device supports USB OTG. Most Android devices support this but its not guaranteed, especially on low-end Android devices. A quick google search reveals that many others with your device have had the same issues you're describing with OTG.

You can do this one of two ways:

  1. Download any generic USB device finder app. it should detect any connected USB devices.
  2. Download the StarPRNT SDK from the Google Play Store. Use the apps discovery feature to ensure the device is found.

If the printer isn't found, check the USB OTG adapter and USB connection to the printer is not loose, and is connected to the correct USB port.

Your device is USB-C 2.0 compliant. You should be connected to the Type-B port on the printer. Picture for reference. IMG_20220803_102257_3

I suggest using a USB-C to USB Type B cable to avoid any issues with an adapter.

I don't have an M30 to test with but I have verified the TSP654IIHIX (also called TSP654II CloudPRNT) works with this SDK over USB; with or without a USB Serial Number.

vatsal-gadhiya-searce commented 2 years ago

Thanks for the info @gare-bear It works I was using wrong port.