#thathquatch

1 messages ยท Page 1 of 1 (latest)

foggy fieldBOT
#

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.

toxic minnow
#

Basically i have a simulated reader being discovered properly, and now when i try to connect via connectBluetoothReader it tells me that my reader is incompatible.

#

here is my reader object

#

{"availableUpdate": null, "batteryLevel": null, "batteryStatus": "unknown", "deviceSoftwareVersion": "0.0.0.1", "deviceType": "unknown", "id": "SIMULATOR", "ipAddress": "0.0.0.0", "isCharging": null, "label": "Simulated Stripe S700", "location": null, "locationId": "st_simulated", "locationStatus": "unknown", "serialNumber": "S7-SIMULATOR-1", "simulated": true, "status": "online"}

azure root
#

Do you have a request id and exact error message for the error you're getting?

toxic minnow
#

not sure what the request id is ill keep looking, but the response im getting is {"code": "IncompatibleReader", "message": "An incompatible reader was detected."}

azure root
#

Oh hm weird. Let me ask a colleague. You're just using the exact code from the guide you linked?

toxic minnow
#

not quite, slightly different

azure root
#

Ok what'd you change

toxic minnow
#

well i dont discover in the useEffect, i have a button that discovers, then I have a button to connect to the discovered reader

#

ill paste code

#
  // const [localReader, setLocalReader] = useState()
  const { discoverReaders, connectBluetoothReader, discoveredReaders } =
    useStripeTerminal({
      onUpdateDiscoveredReaders: (readers) => {
        // After the SDK discovers a reader, your app can connect to it.
        // Here, we're automatically connecting to the first discovered reader.
          // if (readers && readers.length) {
          //   const reader = readers[0]
          //   // setLocalReader(reader)
          //   // handleConnectBluetoothReader(reader.id);
          // }
      },
    });

  // useEffect(() => {
  //   handleDiscoverReaders();
  // }, []);

  const handleDiscoverReaders = async () => {
    const { error } = await discoverReaders({
      simulated: true,
    });

    if (error) {
      console.log(error)
    }
  };

  const handleConnectBluetoothReader = async (id) => {
    const { reader, error } = await connectBluetoothReader({
      readerId: discoveredReaders[0].id,
      reader: discoveredReaders[0],
      locationId: discoveredReaders[0].locationId,
    });

    if (error) {
      console.log('connectBluetoothReader error', error);
      return;
    }

    console.log('Reader connected successfully', reader);
  };
  return (
    <View>
      { discoveredReaders && discoveredReaders.length ? (
        <View>
          <Text>Reader: {discoveredReaders[0].id} <Button onPress={handleConnectBluetoothReader} title="connect reader"/> </Text>
        </View>
      ) : (
        <Button onPress={handleDiscoverReaders} title='Connect to a reader'/>
      )}
    </View>
  );
};```
#

im pretty much back to the exact code from the guide. THe strange thing is there is no way to pick a simulated device?

#

maybe thats the issue

golden night
#

Hello again ๐Ÿ‘‹

#

S7-SIMULATOR-1 isn't a bluetooth reader

#

it is a smart internet reader

#

so you'd likely need to use connectInternetReader function instead

#

if you print out discoveredReaders before intiating connection, are you seeing any other readers in the list?

toxic minnow
#

o ok

#

one sec

#

ok there is 2 scanners it looks like, the second one is an ETNA

golden night
#

If you put discoveryMethod: 'bluetoothScan', in discoverReaders

toxic minnow
#

and na verifone

golden night
#

you might be able to just get bluetooth readers

toxic minnow
#

ahh yea i took that out, let me try

#

i found out earlier that the issue wasnt the RN version, it was I had to restart my srever every time

golden night
#

ah gotcha. yeah turning it off and on, fixes most issues lol

toxic minnow
#

ok so im getting more readers discovered

#

{"availableUpdate": null, "batteryLevel": null, "batteryStatus": "unknown", "deviceSoftwareVersion": null, "deviceType": "chipper2X", "id": null, "ipAddress": null, "isCharging": null, "label": null, "location": {"address": [Object], "displayName": "Stripe HQ", "id": "st_simulated", "livemode": false}, "locationId": "st_simulated", "locationStatus": "set", "serialNumber": "CHB20SIMULATOR2", "simulated": true, "status": "offline"}, {"availableUpdate": null, "batteryLevel": null, "batteryStatus": "unknown", "deviceSoftwareVersion": null, "deviceType": "wisePad3", "id": null, "ipAddress": null, "isCharging": null, "label": null, "location": {"address": [Object], "displayName": "Stripe HQ", "id": "st_simulated", "livemode": false}, "locationId": "st_simulated", "locationStatus": "set", "serialNumber": "WPC32SIMULATOR1", "simulated": true, "status": "offline"}, {"availableUpdate": null, "batteryLevel": null, "batteryStatus": "unknown", "deviceSoftwareVersion": null, "deviceType": "stripeM2", "id": null, "ipAddress": null, "isCharging": null, "label": null, "location": {"address": [Object], "displayName": "Stripe HQ", "id": "st_simulated", "livemode": false}, "locationId": "st_simulated", "locationStatus": "set", "serialNumber": "STRM2SIMULATOR1", "simulated": true, "status": "offline"}

golden night
#

Perfect, you can look at the deviceType but stripeM2 is the one you'd want since that's the one we currently sell in the US

toxic minnow
#

yep thats the one were planning on using

#

ok once again i think i can take it from here....i hope

golden night
#

Sounds good, Good luck ๐Ÿ‘