#thathquatch
1 messages ยท Page 1 of 1 (latest)
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.
- thathquatch, 1 hour ago, 35 messages
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"}
Do you have a request id and exact error message for the error you're getting?
not sure what the request id is ill keep looking, but the response im getting is {"code": "IncompatibleReader", "message": "An incompatible reader was detected."}
Oh hm weird. Let me ask a colleague. You're just using the exact code from the guide you linked?
not quite, slightly different
Ok what'd you change
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
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?
If you put discoveryMethod: 'bluetoothScan', in discoverReaders
and na verifone
you might be able to just get bluetooth readers
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
ah gotcha. yeah turning it off and on, fixes most issues lol
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"}
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
yep thats the one were planning on using
ok once again i think i can take it from here....i hope
Sounds good, Good luck ๐