kenjdavidson / react-native-bluetooth-classic

⚛ Bluetooth classic Android(Bluetooth)/IOS(ExternalAccessory) module for serial communication
https://kenjdavidson.github.io/react-native-bluetooth-classic
MIT License
250 stars 93 forks source link

I can't describe this bug, but don't works #131

Closed IgorDePaula closed 3 years ago

IgorDePaula commented 3 years ago

Mobile Device Environment Provide a list of operating systems on which this issue is relevant.

Application Environment Provide information about your development environment:

To Reproduce Steps to reproduce the behavior:

  1. Init a new RN project
  2. copy and past the code from docs about scanDevices
  3. see the error Happens only this.

Expected behavior I expected show a list decices available

Screenshots If applicable, add screenshots to help explain your problem.

kenjdavidson commented 3 years ago

Going to need substantially more information than you've provided:

Based on your environment, the issue could be anything:

That error message looks like more of a React Native issue, and not a Blueooth Classic library issue - it specifically says you're rendering a child component incorrectly.

IgorDePaula commented 3 years ago

This is the mistery, I only put script to scan bluetooth and log him, not write components on screen. But I resolved with another library. Sorry, and Thank you very much for your attention.

kenjdavidson commented 3 years ago

Glad you got it working man, sorry I couldn't help.

IgorDePaula commented 3 years ago

No problem. Thank you very much for your attention.

IgorDePaula commented 3 years ago

I decide try again this lib, but I not got success.

Now is another error: Captura de Tela 2021-09-10 às 11 50 11

The code:

Captura de Tela 2021-09-10 às 11 48 06 Is only this of code. I try connect on ESP32, and sometimes I got error of wrong pin/password, but Android I try pair or connect and I receive this same error, and not appear prompt to I write some pin.

kenjdavidson commented 3 years ago

I'll be completely honest, I don't really test or use the pairDevice in my app, I trust that the device is already paired through the Android Bluetooth settings. Have skipping the pairing to see if that's the issue? If it is, I'd need to play around with it a little to see what's up - although not really a top priority for me at this time.

If you find that the pairing has issues and you fix them, feel free to submit a PR for it.

Anyhow, following the log and the code:

You're connecting with the default configuration:

Looking at the documentation for this chip https://www.espressif.com/sites/default/files/documentation/esp32_bluetooth_architecture_en.pdf

it doesn't look like it supports RFCOMM protocol (even thought it's mentioned): Below are the Classic BT profiles and protocols currently supported in the Host Stack. • Profiles: GAP, A2DP(SNK), AVRCP(CT) • Protocols: L2CAP, SDP, AVDTP, AVCTP

If this is actually the case, there are two options:

Or something else entirely is going on.

I would suggest you take a look at the documentation and either:

anyhow, look forward to more of your troubleshooting.

IgorDePaula commented 3 years ago

I comprehend, and I would like share a feedback. I tried using the serial bluetooth code on ESP32, and the same code on RN, and I got this error:

Captura de Tela 2021-09-11 às 20 54 54

But, any form, I got success using the react-native-ble-manager lib. Thank you for your complete attention.

kenjdavidson commented 3 years ago

Well ble and classic are two completely different things. That error leads me to believe your Bluetooth adapter was off completely, and you weren't catching the exception.

Glad it's working though.

Get Outlook for Androidhttps://aka.ms/ghei36


From: Igor C. de Paula @.> Sent: Tuesday, September 14, 2021 7:07:53 PM To: kenjdavidson/react-native-bluetooth-classic @.> Cc: Ken Davidson @.>; State change @.> Subject: Re: [kenjdavidson/react-native-bluetooth-classic] I can't describe this bug, but don't works (#131)

I comprehend, and I would like share a feedback. I tried using the serial bluetooth code on ESP32, and the same code on RN, and I got this error:

[Captura de Tela 2021-09-11 às 20 54 54]https://na01.safelinks.protection.outlook.com/?url=https%3A%2F%2Fuser-images.githubusercontent.com%2F2833993%2F133345262-bb2e44c8-c5d0-4852-b364-1c4609b2f38d.png&data=04%7C01%7C%7Cc21c456a87e245e4270f08d977d47b8a%7C84df9e7fe9f640afb435aaaaaaaaaaaa%7C1%7C0%7C637672576752297139%7CUnknown%7CTWFpbGZsb3d8eyJWIjoiMC4wLjAwMDAiLCJQIjoiV2luMzIiLCJBTiI6Ik1haWwiLCJXVCI6Mn0%3D%7C1000&sdata=YzABwEZLEvTBFLL6y34J5Z4bFEhw3d7Z%2FpmRHpac%2FYk%3D&reserved=0

But, any form, I got success using the react-native-ble-manager lib. Thank you for your complete attention.

— You are receiving this because you modified the open/close state. Reply to this email directly, view it on GitHubhttps://na01.safelinks.protection.outlook.com/?url=https%3A%2F%2Fgithub.com%2Fkenjdavidson%2Freact-native-bluetooth-classic%2Fissues%2F131%23issuecomment-919572908&data=04%7C01%7C%7Cc21c456a87e245e4270f08d977d47b8a%7C84df9e7fe9f640afb435aaaaaaaaaaaa%7C1%7C0%7C637672576752307136%7CUnknown%7CTWFpbGZsb3d8eyJWIjoiMC4wLjAwMDAiLCJQIjoiV2luMzIiLCJBTiI6Ik1haWwiLCJXVCI6Mn0%3D%7C1000&sdata=6tP%2B7vRupb6ndynBMsfY77TOEAMD4W7KPj2F%2BJVYv3I%3D&reserved=0, or unsubscribehttps://na01.safelinks.protection.outlook.com/?url=https%3A%2F%2Fgithub.com%2Fnotifications%2Funsubscribe-auth%2FABPMJL3QELESOXDYZBP3S2DUB7IUTANCNFSM5DQU3XUQ&data=04%7C01%7C%7Cc21c456a87e245e4270f08d977d47b8a%7C84df9e7fe9f640afb435aaaaaaaaaaaa%7C1%7C0%7C637672576752317133%7CUnknown%7CTWFpbGZsb3d8eyJWIjoiMC4wLjAwMDAiLCJQIjoiV2luMzIiLCJBTiI6Ik1haWwiLCJXVCI6Mn0%3D%7C1000&sdata=PPvghltZ80L%2FHPOe1xQdPbpbmIcIDzmUH4Ry%2BPV1bCo%3D&reserved=0. Triage notifications on the go with GitHub Mobile for iOShttps://na01.safelinks.protection.outlook.com/?url=https%3A%2F%2Fapps.apple.com%2Fapp%2Fapple-store%2Fid1477376905%3Fct%3Dnotification-email%26mt%3D8%26pt%3D524675&data=04%7C01%7C%7Cc21c456a87e245e4270f08d977d47b8a%7C84df9e7fe9f640afb435aaaaaaaaaaaa%7C1%7C0%7C637672576752317133%7CUnknown%7CTWFpbGZsb3d8eyJWIjoiMC4wLjAwMDAiLCJQIjoiV2luMzIiLCJBTiI6Ik1haWwiLCJXVCI6Mn0%3D%7C1000&sdata=WxmptSQ95saKMHEmVGZaZ8WYlGrQQr4OzHZppGoCxM4%3D&reserved=0 or Androidhttps://na01.safelinks.protection.outlook.com/?url=https%3A%2F%2Fplay.google.com%2Fstore%2Fapps%2Fdetails%3Fid%3Dcom.github.android%26referrer%3Dutm_campaign%253Dnotification-email%2526utm_medium%253Demail%2526utm_source%253Dgithub&data=04%7C01%7C%7Cc21c456a87e245e4270f08d977d47b8a%7C84df9e7fe9f640afb435aaaaaaaaaaaa%7C1%7C0%7C637672576752327120%7CUnknown%7CTWFpbGZsb3d8eyJWIjoiMC4wLjAwMDAiLCJQIjoiV2luMzIiLCJBTiI6Ik1haWwiLCJXVCI6Mn0%3D%7C1000&sdata=d0cnl6xRW3I6DCf5nIgWrhXRMbYpMXnD%2F%2FvxoReL80c%3D&reserved=0.