Skip to content

Unable to get the scanner to scan after pairing #23

@slepmog

Description

@slepmog

We are trying to use our bluetooth Zebra scanners with our Motorola G53 phones.

At first we studied https://techdocs.zebra.com/dcs/scanners/sdk-android/dev-guide/ extensively and attempted to do as it says. We were not very successful because in many places the code shown and the accompanying text were not on the same page with one another, and attempting to use the code as shown resulted in many weird behaviours.

This made us suspect that the aforementioned tutorial article was written by many different people at different times with different versions of the SDK, and was not kept up to date when the state of affairs would change. We compared the contents of the article to the contents of the https://github.com/zebra-technologies/Scanner-SDK-for-Android-Code-Snippets/ repository, and concluded that we were correct in thinking so.

After a week of struggles, we are finally able to pair the scanner with the phone using the pairing barcode that we finally managed to get to show on the screen. That doesn't get us very far though, because the paired scanner does not scan. Its physical SCAN button does nothing.

We are at a complete loss as to what we did wrong and how to fix it. The aforementioned documentation does not seem to provide answers, or hides them very well behind the inconsistencies. Everything we were able to achieve we achieved through trying endless of combinations of parameters when calling the SDK's functions in the hope that one will work. And we have no idea whether it actually worked, or just seemed to.

We hope answers to these questions will help us move forward.

  1. Is it possible at all to operate the scanner using its physical SCAN button after pairing?
    We have noticed that when using the Sample App provided, the SCAN button ends up disabled after pairing, just like when we do it. If the only way to trigger a scan after pairing is to programmatically send the corresponding command to the scanner, then the entire thing is completely useless for us, as the very idea is that the scans are triggered with the button, and the results are available in the phone app. At least we would know then to not spend any more time on this.

  2. Is our understanding correct that only one required Operation Mode should be selected?
    In the aforementioned tutorial article, in the code sample, all three operation modes are enabled with sdkHandler.dcssdkSetOperationalMode(). Is this correct? Does that actually enable all three and allow you to subsequently pick the one you want to use this time when calling to sdkHandler.dcssdkGetPairingBarcode()? Or is this wrong, and you must delete the other two lines and only leave the one you are using?

    Somewhat orthogonal to that, is there, or is there not, strict correspondence between the selected OperationalModes and the connection mode passed to dcssdkGetPairingBarcode? Is our understanding correct that if we select DCSSDK_OPMODE_BT_NORMAL, we must use DCSSDK_BT_PROTOCOL.SSI_BT_CRADLE_HOST, and if we select DCSSDK_OPMODE_BT_LE, it has to be DCSSDK_BT_PROTOCOL.SSI_BT_LE?

  3. Is our understanding correct that BT_LE mode is the new shiny default, despite what the tutorial article says?
    The tutorial article says the bluetooth classic mode should be selected, but then in the samples it would seem the BT_LE is the actual default? What are the considerations when using the one or the other?

  4. Is it correct that the bluetooth address must be provided by the user manually when the connection mode is not BT_LE?
    The tutorial article says request the bluetooth address from the user unless the connection mode is BT_LE, but it would seem from our experiments that providing an address manually is not required in either mode?

  5. Exactly what does DCSSDK_BT_SCANNER_CONFIG.SET_FACTORY_DEFAULTS do, and is it required to use it?
    What settings does this reset on the scanner? Literally all of them, or just the ones pertaining to the bluetooth pairing? We have scanners that we also use for other purposes where we would like them to act like bluetooth keyboards. If we connect such scanner with SET_FACTORY_DEFAULTS, will that wipe out the HID settings previously programmed to it?

    Is it possible to pair and use scanners with KEEP_CURRENT instead?

  6. What is the correct pairing experience with the Classic and the LE mode?
    When trying to only enable the operational mode DCSSDK_OPMODE_BT_LE, we get a system-style notification from Android itself (?) about pairing a device, and then it doesn't seem to be paired. When using DCSSDK_OPMODE_BT_NORMAL, we get a popup seemingly from the SDK (?) that asks if we want to pair. Which is the correct one? Why don't we get the same confirmation popup when using the sample app?

  7. After pairing the scanner, it glows green and does nothing. How to fix that?
    It seems that after pairing, the scanner becomes frozen. It constantly glows green with its LED, and its SCAN button does nothing.
    Is there anything else that needs to be done after a successful (?) pairing to make the scanner operational? The tutorial article mentions sending a DCSSDK_DEVICE_SCAN_ENABLE command to enable scans, does that refer to this situation, or is it about something else entirely? Does it need to be done from inside of e.g. dcssdkEventCommunicationSessionEstablished() (we tried that and it had no effect), or only later, or not at all? The samples repository does not seem to use it at all.

  8. Is there a simple, short chart that shows the correct minimal sequence of SDK calls with correct parameters, decoupled from the Android interface boilerplate code?
    Something like

    1. dcssdkSetOperationalMode(DCSSDK_OPMODE_BT_NORMAL)
    2. dcssdkSubsribeForEvents(DCSSDK_EVENT.DCSSDK_EVENT_BARCODE.value)
    3. dcssdkGetPairingBarcode(DCSSDK_BT_PROTOCOL.SSI_BT_CRADLE_HOST, DCSSDK_BT_SCANNER_CONFIG.SetFactoryDefaults)
    4. <SCAN button enabling magic>
    5. You're done. The dcssdkEventBarcode event will now work.

Thank you.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions