Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Bluetooth printer not discoverable #151

Closed
omarst9 opened this issue May 17, 2024 · 16 comments
Closed

Bluetooth printer not discoverable #151

omarst9 opened this issue May 17, 2024 · 16 comments

Comments

@omarst9
Copy link

omarst9 commented May 17, 2024

I can't get bluetooth connectivity to work with 3.1.1 or 4.0.6 versions. The printer is not discoverable on android and on iOS.

Printer model is TM-m30III. I confirmed connection works over LAN/WIFI.
I'm using Expo SDK 50.

I have added all the permissions needed for android and followed the steps in the installation guide.

Has anyone had any luck with getting Bluetooth printers working with this library?

If I add the Bluetooth MAC Address manually to the code with the device name i can connect and print from the printer. Its just the discovery isnt working.

@omarst9
Copy link
Author

omarst9 commented May 17, 2024

Hi @tolypash, i noticed you had a similar issue with Blutooth printers here. Can I ask how you got discovery to work sometimes? And did you end up resolving the issue?

@tr3v3r
Copy link
Owner

tr3v3r commented May 18, 2024

Hello @omarst9,

I have this model and all works good at least with bare project. Have you paired your phone and printer before discovering?

With reproducible demon I can debug on my end

@omarst9
Copy link
Author

omarst9 commented May 19, 2024

Hi @tr3v3r,

Yes, I've paired the printer with the device first. I tried the example here and no bluetooth devices were discovered, only the LAN was found. (See attached image)

I tried the react-native-thermal-receipt-printer library and the printer was discovered so i'm not sure what could be wrong.

no-bte-device

@tr3v3r
Copy link
Owner

tr3v3r commented May 21, 2024

@omarst9 have you tried increasing timeout? It helped me for Android
discovery.start(10000)

@omarst9
Copy link
Author

omarst9 commented May 21, 2024

That worked! I just tried it for Android and it detected the BT device. But still no luck with the iPad though

@tr3v3r
Copy link
Owner

tr3v3r commented May 21, 2024

That worked! I just tried it for Android and it detected the BT device. But still no luck with the iPad though

Have you done all these steps? They're not present in the example folder I guess. You should do it on your end

image

@omarst9
Copy link
Author

omarst9 commented May 22, 2024

Yes, I already added those before building the iOS app and checked again to make sure they were there but still no BT device comes back from the discovery.

@tr3v3r
Copy link
Owner

tr3v3r commented May 22, 2024

@omarst9 and have you paired with the device, right?

@tolypash
Copy link
Contributor

tolypash commented May 22, 2024

@omarst9 you have to use pair Bluetooth function from the package (for iOS only)

@omarst9
Copy link
Author

omarst9 commented May 22, 2024

Yes, i’ve paired the device from the iOS bluetooth settings.

I saw that pair bluetooth function but wasn’t too sure when to use it. Could you show me a snippet of when its used? Because from memory it needed the deviceName which means the BT printer needs to be discovered first.

@tr3v3r
Copy link
Owner

tr3v3r commented May 22, 2024

@omarst9 it's not mandatory to use this function, to be honest.

Have you tried with the beta or the current version?

I've tested on beta Bluetooth connection and managed to discover on both platforms

@tolypash
Copy link
Contributor

@omarst9 Disconnect the printer from iOS Bluetooth settings. Then request all necessary permissions from your app (Bluetooth, location).

Then, call PrintersDiscovery.pairBluetoothDevice()

A native popup should appear and select your printer from there, it will connect, and now it will be paired properly.

@aargon007
Copy link

i have the same problem. stuck in two days but still not solve the problem

@aargon007
Copy link

@omarst9 Disconnect the printer from iOS Bluetooth settings. Then request all necessary permissions from your app (Bluetooth, location).

Then, call PrintersDiscovery.pairBluetoothDevice()

A native popup should appear and select your printer from there, it will connect, and now it will be paired properly.

hey , i have connect the printer from popup. but later i can't find the printer. how can i get it?

@omarst9
Copy link
Author

omarst9 commented Aug 2, 2024

@aargon007 it never worked for me. I couldn't find the Bluetooth printer even after pairing

@tr3v3r
Copy link
Owner

tr3v3r commented Aug 19, 2024

I checked on an example today - it works well on iOS and Android.
The close issue for now. If you have a reproducible example please feel free to reopen it

@tr3v3r tr3v3r closed this as completed Aug 19, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants