Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Error 20001: StarIO10IllegalDeviceStateError #115

Open
joarwilk opened this issue May 6, 2024 · 5 comments
Open

Error 20001: StarIO10IllegalDeviceStateError #115

joarwilk opened this issue May 6, 2024 · 5 comments
Assignees
Labels
Platform: android Status: work in progress Currently working on this issue Target: stario10 Issues related to the API and other StarIO10 library.

Comments

@joarwilk
Copy link

joarwilk commented May 6, 2024

Description

When discovering, it fails with error 2001: StarIO10IllegalDeviceStateError.

When shipping a batch of, say, 5 terminals, this can happen on 1-5 of those. It seems to be random.

How can we debug this invalid state?

Your device where the bug occurs

  • Device:
    Castle S1F2
  • OS:
    Verifone / Adyen, not sure about version

Your printer

  • Model Names:
    mC-Print3
  • Firmware Version:
    Unsure
  • Interface:
    LAN

To Reproduce

Start discovery. An error is caught with error code 2001 and description StarIO10IllegalDeviceStateError.
Sometimes its error 2000, with description "y"

Expected behavior

Printers are found

@can-miki
Copy link
Contributor

I would like to ask you a few questions to confirm the situation.

My understanding is that there are 5 terminals (Castle S1F2) connected to 1 printer (mC-Print3) via LAN. Is that so?
What API do you use for discovery?

Also, regarding StarIO10IllegalDeviceStateError I would like to check the following:

  • Is there a problem with your network equipment?
  • Is the printer turned on?

The flow when connecting the printer and device is "PortOpen → Status acquisition → PortClose".

  • Is the application configured to communicate between the device and the printer after "PortClose"?

@can-miki can-miki self-assigned this May 10, 2024
@can-miki can-miki added Status: question Further information is requested Platform: android Target: stario10 Issues related to the API and other StarIO10 library. labels May 10, 2024
@joarwilk
Copy link
Author

My understanding is that there are 5 terminals (Castle S1F2) connected to 1 printer (mC-Print3) via LAN. Is that so?
What API do you use for discovery?
Correct, but not connected at the same time. For any action they open, , and close.

We use this library to discover. Using starDeviceDiscoveryManagerFactory.create([InterfaceType.Lan]);

Is there a problem with your network equipment?
Is the printer turned on?

It works for some terminals and some not in the same network. This is consistent across different venues so it doesnt seem to be a local thing.

Is the application configured to communicate between the device and the printer after "PortClose"?

We dont even get to that state. It simply doesnt return any printers during discovery.

@can-miki can-miki added Status: work in progress Currently working on this issue and removed Status: question Further information is requested labels May 23, 2024
@nuzayets
Copy link

We're seeing this with 'Network Unavailable' even when the network is available (we observe traffic to our backend succeed, at the same time as this error). We see it across Android 12 and 13, on the latest version of star-io10. The devices are Lenovo YT-J706F and Lenovo TB125FU. The printer is TSP100iii on Bluetooth but this occurs during discovery. We also began seeing it in May '24, at the time on version 1.3.0.

The error is persistent. So far we have not found a solution.

@can-miki
Copy link
Contributor

can-miki commented Jul 22, 2024

@joarwilk @nuzayets
We apologize for the long wait.
Error 2001 is Network Unavailable.

This SDK ver.1.7.0 fixed an issue where StarIO10IllegalDeviceStateError(message: "Network Unavailable.") could occasionally be thrown even though the device is actually connected to the network.
Please update and see if the problem is resolved.

Thank you.

@can-miki can-miki added Status: question Further information is requested and removed Status: work in progress Currently working on this issue labels Jul 23, 2024
@nuzayets
Copy link

nuzayets commented Jul 24, 2024

The fix there said it's only for iOS. We're on Android 12 & 13, no effect there (we did try 1.7.0 before I commented). I did find a workaround: if we get Network Unavailable we scan without LAN and that works. Of course that will only work if people don't genuinely need LAN printers -- lucky for us that scenario hasn't happened since we don't officially support LAN printers (though some customers do use them).

My thinking was their network is blocking UDP multicast or something since that's usually how printer autodiscovery works (for normal desktop printers anyway), it does seem to be specific to a customer location and we can't repro it in-house. Since the workaround (not scanning LAN if we get Network Unavailable) works, we haven't put resources into reproducing it in the lab as of yet.

@bandit-ibayashi bandit-ibayashi added Status: work in progress Currently working on this issue and removed Status: question Further information is requested labels Aug 30, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Platform: android Status: work in progress Currently working on this issue Target: stario10 Issues related to the API and other StarIO10 library.
Projects
None yet
Development

No branches or pull requests

4 participants