#santhosh-kumar-r_api
1 messages ¡ Page 1 of 1 (latest)
đ Welcome to your new thread!
â˛ď¸ We'll be here soon! Typically we respond in a few minutes, but sometimes we might take a bit longer if the server is busy or if you have a particularly tricky question.
âąď¸ We close idle threads, which makes them read-only. Once a thread is closed it won't be reopened, but you can always start a new thread if you have another question.
đ This thread will always be available, even after it's closed. You can find it again using Discord's search, or you can save this link: https://discord.com/channels/841573134531821608/1425822674050875426
đ Have more to share? Add more details, code, screenshots, videos, etc. below.
hey there! looking into your question now
disconnections like this are expected to happen sometimes, so your app should be set up to handle these using the steps documented here: https://docs.stripe.com/terminal/payments/connect-reader?terminal-sdk-platform=android&reader-type=usb#handle-disconnects
you should also ensure that you set autoReconnectOnUnexpectedDisconnect to true
https://docs.stripe.com/terminal/payments/connect-reader?terminal-sdk-platform=android&reader-type=usb#connect-reader
and since you're using a USB connection, you may need to unplug it and reconnect
we already added this
i think it is not suitable for our client business. It is a power bank sharing platform.
how can we unplug after 5-6 hrs or if there is a issue.
cannt we reconnect without unplug?
We are using react-native. can you help with that ?
hi there, taking over for my colleague, give me some time to catch up
for React Native, you should be able to automatically handle reader disconnects using the code here https://docs.stripe.com/terminal/payments/connect-reader?terminal-sdk-platform=react-native&reader-type=usb#handle-disconnects
this will also give you a DisconnectReason which will help you identify why the reader disconnected
we did this already.
but still it is not connecting.
how much time will it take ?
const params: any = {
reader,
autoReconnectOnUnexpectedDisconnect: true,
locationId,
};
const {error, reader: connected} = await connectReader(
params,
discoveryMethod,
);
We already contacted the support. They said that you can call connectReader again.
so we implemented periodic check to status of reader.
We got this error.
"USB unexpectedly disconnected during operation"
in What cases , this error will happen ?
are you logging out the DisconnectReason? that might help you debug this https://stripe.dev/stripe-terminal-react-native/api-reference/types/Reader.DisconnectReason.html
"USB unexpectedly disconnected during operation"
based on above error , it might be "usbDisconnected"
that's possible but I wanted to make sure. if that's the case, it could be a faulty USB cable. also make sure that you're using a USB 2.0 type cable
This is for one cabinet but we are also facing pos disconnect issue in all cabinets even though we added auto-reconnect: true.
do i need to add this in callbacks or retreivng the reader data and extract the disconnectrReason ?
it will be in onDidDisconnect callback
unfortunately i think it was not recorded in that.
but we are getting logs for
onDidChangeConnectionStatus "not connected"
onDidChangeConnectionStatus "connecting"
etc.
so if we add autoReconnect: true, we dont need to manually disconnect and reconnect.
just confirming
that should be the case, yes. if you still are having problems after that, I would recommend making sure you're following the recommendations at the top of this doc for SDK version and ensuring you're using the correct type of USB cable
can we reproduce this automatic disconnect behaviour in simulate reader ?
I don't believe so, no. let me see if I can find anything about that