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

HC-05/06 compatibility #32

Closed
marknn3 opened this issue Sep 12, 2022 · 5 comments
Closed

HC-05/06 compatibility #32

marknn3 opened this issue Sep 12, 2022 · 5 comments

Comments

@marknn3
Copy link

marknn3 commented Sep 12, 2022

The HC-05 and HC-06 Bluetooth V2.0 modules (FW VERSION:2.0-20100601) will fail when writing to Characteristic 0xFFE1 with this error:
"NotSupportedError: GATT operation failed for unknown reason"

Instead these modules require Characteristic 0xFFE2 for writing/transmitting.

When I get my hands on a HM-10 or AT-09 I will try to make the BluetoothTerminal class compatible with both module families.

@loginov-rocks
Copy link
Owner

Hi @marknn3 , Bluetooth 2.0 is not supported by the Web API – that's the only reason for this library to exist, it is to mimic 2.0 over the BLE, so you need BLE modules if you want to communicate with them from the browser :)

@marknn3
Copy link
Author

marknn3 commented Sep 15, 2022

@loginov-rocks Perhaps I don't understand what you mean, but I am 100% able to connect and communicate with a Bluetooth 2.0 module (HC-05) using your BluetoothTerminal (with a patch for which I can provide a PR. Somewhat similar to the ESP32 patch by @Jip-Hop).
The Web API is agnostic to whether it is 2.0 or BLE, as long as the proper services and characteristics are exposed by the module.

@loginov-rocks
Copy link
Owner

The Web API is agnostic to whether it is 2.0 or BLE, as long as the proper services and characteristics are exposed by the module.

Not really :) Services and characteristics are part of the GATT that is interface for BLE devices. There can be no services nor characteristics without BLE support. And from the other side Web Bluetooth API works only through services and characteristics. This is just how it works, part of the protocols.

So if you able to communicate through Web Bluetooth API from the browser then you have module with BLE support. Could be your modules are not actual HC-05/06 but smarter ones.

@marknn3
Copy link
Author

marknn3 commented Sep 15, 2022

So if you able to communicate through Web Bluetooth API from the browser then you have module with BLE support. Could be your modules are not actual HC-05/06 but smarter ones.

You are right! The 'new version HC-05' which I have is indeed v4.2 BLE! I did not know. The 'older/original' HC-05 Bluetooth v2.0 version indeed does NOT show up in the Web Bluetooth API.

But this still makes a valid use-case for enhancing your BluetoothTerminal to allow different characteristics for RX and TX.

@loginov-rocks
Copy link
Owner

@marknn3 great news! This use case is supported by the library with the help of constructor or a separate method: https://github.com/loginov-rocks/bluetooth-terminal#new-bluetoothterminalserviceuuid-characteristicuuid-receiveseparator-sendseparator-onconnected-ondisconnected

This repository is just an example of application using the library :)

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

2 participants