#ismailelric

1 messages · Page 1 of 1 (latest)

mortal warrenBOT
#

Hello! We'll be with you shortly. Below are links to other discussions we've had with you in the past week in case you want to review that information. If your question is related to one of these previous discussions, please provide a comprehensive summary of the current state and what you need help with now. We help many users simultaneously, so a summary allows us to resolve your issue as soon as possible.

kind tapir
#

It suffices to add the id alone?
{
id: myId
}
?

placid hound
#

You need to create a location

#

And then pass that location's ID to that method

kind tapir
#

I see, the location is already created. I passed the locationId I received, and still got that error

placid hound
#

Can you hard code in the location ID and then run the test again?

kind tapir
#

It was hard coded

Code snippet:

    const { reader, error } = await connectBluetoothReader({
      // Since the simulated reader is not associated with a real location, we recommend
      // specifying its existing mock location.
      reader: cardReader,
      locationId: "tml_Ik....",
      autoReconnectOnUnexpectedDisconnect: true,
    });

placid hound
#

Okay and what is the error exactly?

kind tapir
#

When conecting to a reader I get:
Invalid param: register_to_location, found tml_Ik...

placid hound
#

Well then the above isn't the relevant code for that error

kind tapir
#

I thought it may be since the code mentioned is used there.

placid hound
#

You aren't passing register_to_location at all in that code

#

Have you added logs to your code yet?

#

To see exactly where the error is triggered?

kind tapir
#

The error I get is from the bluetoothConnection Reader method

    const { reader, error } = await connectBluetoothReader({
      // Since the simulated reader is not associated with a real location, we recommend
      // specifying its existing mock location.
      reader: cardReader,
      locationId: DEFAULT_LOCATION_ID,
      autoReconnectOnUnexpectedDisconnect: true,
    });

    if (error) {
      setBluetoothConnectionStatus("error");
      Toast.show({
        type: "error",
        text1: `Failed Connecting to ${cardReader.label ?? cardReader.deviceType}`,
        text2: error.message,
      });
      // Error copied 
      throw new Error(error.message);
    }
placid hound
#

Can you show me the exact error that you get when you have the reader ID and Location ID hard coded?

kind tapir
#

I don't have the error Code.
But the error message is exactly the one shared

#
  1. Connect via bluetooth
  2. Error: Invalid param: register_to_location, found tml_Ik
placid hound
#

Okay well we are basically going around in circles then. The code that you have shared does not contain register_to_location anywhere so I can't really help you. Perhaps try clearing your cache and restarting your server?

kind tapir
#

I don't know where the register_to_location comes from since the method only requires 3 arguments, and honestly the error isn't helping

placid hound
#

You are using a M2, here?

kind tapir
#

Yes

placid hound
#

What version of the Terminal React Native SDK are you using?

kind tapir
#

0.0.1-beta.13

placid hound
#

Alright well I'd try clearing your cache as I mentioned, but the next step if that doesn't help would be for us to reproduce what you are seeing on our side to see if there is a bug in the SDK.