Using Web BLE to detect and get GATT information

  Рет қаралды 28,378

Sayanee Basu

Sayanee Basu

Күн бұрын

Пікірлер: 65
@drodrii
@drodrii 3 жыл бұрын
This tutorial is insanely good! I really appreciate you keeping in the footage of those common little API and syntax errors that pop up while testing your code because we all encounter the same types of issues too! The fact that you then go on to promptly resolve them while also explaining your insights on the various causes for each presented error really makes this 1000 times more helpful than other tutorials that just demonstrate a prescreened and oversimplified example code. I’m sure it’s easy for this particular aspect to be overshadowed and go unnoticed since these interactions occur so briefly, but I just wanted to give you some additional credit and express some gratitude by saying thanks ✌🏼
@sayanee
@sayanee 3 жыл бұрын
Thank you :) I'll take note of sharing these errors and resolving them as I code in future tutorials as well! Errors, bugs, debugging, and resolving them are programming after all.
@FranRoscelli
@FranRoscelli 4 жыл бұрын
Probably the best tutorial for both ESP32 programming and BLE for browsers. Thanks, super clear information.
@enkidu9298
@enkidu9298 3 жыл бұрын
You're a lifesaver! Thanks!
@dunzek943
@dunzek943 3 жыл бұрын
This is very helpful! Love from a high school senior
@abelmatser
@abelmatser 4 жыл бұрын
I really enjoy your explanations of different topics, especially because you really show all the things you do - also looking up libraries when coding for example. So thanks for this, and keep up the good work :)
@adafruit
@adafruit 5 жыл бұрын
great work!
@_olives
@_olives 4 ай бұрын
This video was super useful!!
@muema3051
@muema3051 4 жыл бұрын
Thank you for the tutorial. Would you kindly do another tutorial showing how to write data to a bluetooth printer?
@gerardocardenas8805
@gerardocardenas8805 2 жыл бұрын
good video, now I can access my bluetooth device locally, without using webbluethoo's GAT servers?
@bobbobbington1132
@bobbobbington1132 3 жыл бұрын
Thanks very much for this video. I'm trying to work out how to talk to a bluetooth thermal printer via a webapp, and I think you just gave me the key!
@sayanee
@sayanee 3 жыл бұрын
Interesting! I would be curious to know if you were able to talk to the printer and if possible, what is the printer model? Does the printer have information about the BLE GATT values?
@bobbobbington1132
@bobbobbington1132 3 жыл бұрын
@@sayanee I’ve got two printers being shipped to me that I’ll be trying to make work, a zebra imz320 and a zebra rw420. I don’t know about the gatt values yet, and to be completely honest this is my first foray into any web related programming, so I’m just beginning to run through javascript tutorials. The main thing I’ve been trying to figure out for the last week or so was whether talking to the printers was even possible via a web app. I think for printers connected via WiFi I may be able to use WebSocket, and webBT for Bluetooth connected ones. The code ultimately needs to run inside Shopify’s POS app on iOS as a web app.
@sayanee
@sayanee 3 жыл бұрын
@@bobbobbington1132 Thanks for explaining the context of using the Web BLE. If you are planning to use it as a consumer app for the public, then I would suggest no. Also, I do not think Apple will approve an iOS app with Web BLE that they are not supporting due to current privacy concerns. It is still an experimental technology that is not supported by major browsers like Safari and Firefox (see caniuse.com/mdn-api_bluetooth). But if you are planning to use it to play with JavaScript, just as a prototype for yourself, then by all means go ahead. If you are planning to learn about web development, knowing about web standards and browser compatibility will be an important part of knowing the ecosystem. E.g. webbluetoothcg.github.io/web-bluetooth/ About using hardware APIs on the web in general, I would strongly suggest a recent article which talks about privacy issues and the viewpoint from Apple, Google, and Mozilla - all major browser makers. In summary, discussions are on-going on how to balance privacy versus innovation and while it is going on, I suggest using Web BLE just for fun and experimentation. www.smashingmagazine.com/2021/01/web-expose-hardware-capabilities/ I hope I gave you some context on using Web BLE today. I hope you have fun learning web development and playing with these APIs as much as I did!
@kishika966
@kishika966 2 жыл бұрын
Thanks for the tutorial! help me a lot. I have also a question regarding BLE, have you tried creating a BLE server that can connect multiple clients? is it possible for Web BLE? I'm using ESP32 and I'm having a hard time doing it. hope you can answer me, it is for my thesis project. Thank you!
@sayanee
@sayanee 2 жыл бұрын
So sorry! Never did that!
@sandipkumarnandi
@sandipkumarnandi 9 ай бұрын
Do you mean to create a server in browser? If so then that would not be appropriate still not sure if that would be supported technically. I am looking for having a full fledged ble client on the browser and inturn want to add them as we view.
@ayushmishra1975
@ayushmishra1975 2 жыл бұрын
Hello, ma'am nice video, I have a problem I am connecting a Bluetooth adapter (desktop) to Chromebook but it was not connecting. How I can connect the Bluetooth adapter to Chromebook?
@sandipkumarnandi
@sandipkumarnandi 9 ай бұрын
Wonderful video, I was looking for this, very helpful. Next step what I would like to extend this is send signal from browser to ble device to perform some action. Not sure if these functions would be available on webview as well? In case you have any info, could you pls share the same.
@OurSouthAfrica
@OurSouthAfrica 2 жыл бұрын
Hello can you view ble devices that are not with you but someone els phone picks up that ble device to see location? Or is there a network that can be used for this function for vehicle tracking in case of theft?
@cogno-slayer
@cogno-slayer 3 жыл бұрын
Awesome demo, thanks for sharing!!
@SumitBhowmick-b5v
@SumitBhowmick-b5v 8 ай бұрын
Hello, I'm developing an BLE socket based windows client utility package using winsock & winsock2 library layer, but during build process, socket is getting connected with server socket fd. But then no data being receiving and thereafter code will getting terminating. can you suggest any root cause ??
@kishorfarad6468
@kishorfarad6468 2 жыл бұрын
nice tutorial. I have a problem with Gatt.Connect() method. an error occurred Connection failed for unknown reason .can you tell me why this error came?.
@sandipkumarnandi
@sandipkumarnandi 10 ай бұрын
Very nicely explained
@weilieschok2001
@weilieschok2001 3 жыл бұрын
i have a simple use case, where workers has to be nearby to a bluetooth device (and the device is in office), so they could register their attendance (in floor 88th), instead of when letting them to register attendance on ground floor. Hence, is it possible not to prompt the blutooth paring screen, but the JS will smart enough to check IF "device" in list of devices found? It should be transparent to workers
@upasnagandhi6508
@upasnagandhi6508 2 жыл бұрын
That's was wonderful explanation with appropriate pauses. I have a question, by means, can you tell me how can we unpair an already paired device like Forget Device/remove device. Will appreciate your help.
@Xerox7788
@Xerox7788 4 жыл бұрын
How do you read multiple characteristics?
@LaminaFerro
@LaminaFerro 4 жыл бұрын
So informative, i did not we can detect bluetooth by browser. Nice ideas get on
@eddyv524
@eddyv524 4 жыл бұрын
Great video!!! I have two questions: Based on my research i think a simple serial protocol is not yet part of the Web BLE spec. Is there still a way to transfers chunks of data (configuration info) between an STM32 processor (with an BLE module attached to it) and a web browser. Are there GATT services and characteristics that can be used for this? 2nd question: Can the cheap HC-05, HC-42 BLE serial modules be used for this?
@sayanee
@sayanee 4 жыл бұрын
I apologise in advance in case I am totally off-tangent to what you require. I have neither tried STM32 nor the HC-05/42 modules, but have you tried WebUSB? I have used WebUSB with SAMD21G to transfer config info as well. Video: kzbin.info/www/bejne/fWmkhpqtj6iYlbM Here's a related article on STM32 and WebUSB: medium.com/coinmonks/stm32-blue-pill-dissecting-the-webusb-bootloader-for-makecode-b7f1a1508e89
@SY_ViralShorts360M
@SY_ViralShorts360M 2 жыл бұрын
Nice explained
@binleyhouse
@binleyhouse 3 жыл бұрын
thanks for sharing, I just started to tinker with IoT and WebBluetooth. While I got the example to work, was wondering if you want to create a custom BLE service/characteristics (eg accelerometer x,y,z reading) how do you get the WebBluetooth to read it? I am getting error, TypeError: Failed to execute 'getCharacteristic' on 'BluetoothRemoteGATTService': Invalid Characteristic name. I am using a random UUID for both Service and Characteristic on Arduino side and trying to call the same UUIDsunsuccessfully
@sayanee
@sayanee 3 жыл бұрын
To be honest, I have never tried a custom BLE service / characteristics. I tried to look into the Web BLE specifications and could not find something on custom fields. Maybe I missed it, or maybe that's something you can look through the specifications again. I also found a GitHub issue on custom fields: github.com/WebBluetoothCG/web-bluetooth/issues/444 I also see some mentions of "custom" on this tutorial: web.dev/bluetooth/ Hope this gives you some clue on the next steps.
@blackrobot138
@blackrobot138 2 жыл бұрын
wao ... thank you. can you also please explain how to use custom UUID and characteristics? Also how to stream data at 1000Hz?
@ashwin372
@ashwin372 3 жыл бұрын
Is there a way to connect multiple clients to single GATT server
@kannvino
@kannvino 3 жыл бұрын
Will this code pick up android mobiles with bluetooth on?
@lukepiette879
@lukepiette879 4 жыл бұрын
Awesome video thanks for the help!
@clivesgt1
@clivesgt1 4 жыл бұрын
great tutorial. very informative. thanks!
@ashwin372
@ashwin372 3 жыл бұрын
Thanks really informative
@carlobramini4826
@carlobramini4826 4 жыл бұрын
amazing no need to create an android or ios app just for ble
@sayanee
@sayanee 4 жыл бұрын
Agree about no mobile apps :) Great for quick prototyping! Just be aware of its browser compatibility because it is still an experimental technology. developer.mozilla.org/en-US/docs/Web/API/Web_Bluetooth_API
@robstechdesign7392
@robstechdesign7392 3 жыл бұрын
I paired my ESP32 ... but can't find a way to unpair it.
@sayanee
@sayanee 3 жыл бұрын
*2021 update:* As of today, *Chrome* and *Edge* browsers are supporting Web Bluetooth, whereas *Safari* and *Firefox* are not. Please check the current browser compatibility: caniuse.com/web-bluetooth Web Bluetooth is not a W3C standard: webbluetoothcg.github.io/web-bluetooth/ Safari, based on the WebKit browser is not considering Web Bluetooth, for now, due to browser fingerprinting concerns. Please check webkit.org/tracking-prevention/#anti-fingerprinting As another optional reading, I suggest the article "Should The Web Expose Hardware Capabilities?" www.smashingmagazine.com/2021/01/web-expose-hardware-capabilities/ Hence, in my opinion, we can use Web Bluetooth in developer tools or in small-scale beta testing apps, but of course, you will be best aware of the context in which you plan to use this feature. Check out other exciting hardware API features such as Web NFC, Web Serial here web.dev/devices/ I detailed more on using hardware APIs on the web and using experimental technologies in another video of mine here kzbin.info/www/bejne/f5_ah2yghN1lapo. I hope the above links will provide you with some guidance 🙏🏻
@adron115
@adron115 4 жыл бұрын
Up to the point to connect the devices, everything works perfect, but I want to use it for communication (like keyword and data) between two browser with one code for both. If you know how to do that, can you pls give an example (like an easy chat) for that and show it in a web editor or sth like that?
@MrRossss1
@MrRossss1 4 жыл бұрын
Hi. Can this be used offline please? Great vid thanks
@brendanfitzgerald483
@brendanfitzgerald483 4 жыл бұрын
Great Post , very clear
@SY_ViralShorts360M
@SY_ViralShorts360M 2 жыл бұрын
Can any one please help by solving the problem that how can avoid overlap when multiple slave connect to a single master
@rj-bn4lb
@rj-bn4lb 4 жыл бұрын
Please share a video to get esp32 ble data to android studio app
@randallyoung9411
@randallyoung9411 4 жыл бұрын
Thanks for posting!!!
@mohdatique9429
@mohdatique9429 3 жыл бұрын
Thats awesome. But I am getting this error web-ble-detect:29 Argh! NotFoundError: Bluetooth adapter not available. My desktop not having bluetooth adapter but I attached the external bluetooth device but its unable to find bluetooth adapter. Will appreciate your response.
@sayanee
@sayanee 3 жыл бұрын
Are you using Chrome or Edge browser? Web BLE is not available on FireFox or Safari. Reference for browser compatibility: caniuse.com/web-bluetooth Also, maybe check the hardware Bluetooth adapter by another means without using the browser just to ensure the hardware works by itself.
@mohdatique9429
@mohdatique9429 3 жыл бұрын
Hey ​ @Sayanee Basu Thanks for the reply. I tested it out its working without browser as well but unable to detect via chrome browser api.
@sayanee
@sayanee 3 жыл бұрын
@@mohdatique9429 If the BLE hardware is working and you are using the right browser, then start with the simplest possible JavaScript code with the least possible number of lines (E.g. hutscape.com/tutorials/web-ble-detect). Also, what BLE device are you trying to connect to with your desktop?
@debrain1647
@debrain1647 4 жыл бұрын
You are cool...Thanks alot
@prateeksahni5618
@prateeksahni5618 3 жыл бұрын
thank you for coding but I am facing unexplected while checking console
@carlobramini4826
@carlobramini4826 4 жыл бұрын
amazing 🙌
@RathourShubham
@RathourShubham 4 жыл бұрын
How can I detect nearby mobile phone?
@debrain1647
@debrain1647 4 жыл бұрын
i have a Question ma'am... When i convert this into an application ,Can it Run on Android device??
@sayanee
@sayanee 4 жыл бұрын
It depends on the type of browser and the version. Check the Android browser compatibility for Web BLE here: caniuse.com/web-bluetooth
@cemyuceer179
@cemyuceer179 4 жыл бұрын
How can I add bluefruit.h library to the arduino ıde?
@sayanee
@sayanee 4 жыл бұрын
Try the installation instructions here: github.com/adafruit/Adafruit_nRF52_Arduino#recommended-adafruit-nrf52-bsp-via-the-arduino-board-manager
@jeanpierrecassou5003
@jeanpierrecassou5003 2 жыл бұрын
Does not work
@niv9375
@niv9375 4 жыл бұрын
How can I detect nearby mobile phone?
@niv9375
@niv9375 4 жыл бұрын
I using this code in Windows 10 ( Goole Crome)
Data exchange from browser to a microcontroller with WebUSB
20:06
Bluetooth: With Low Energy Comes Low Security
27:34
Mike Ryan
Рет қаралды 22 М.
ЛУЧШИЙ ФОКУС + секрет! #shorts
00:12
Роман Magic
Рет қаралды 20 МЛН
龟兔赛跑:好可爱的小乌龟#short #angel #clown
01:00
Super Beauty team
Рет қаралды 111 МЛН
小丑揭穿坏人的阴谋 #小丑 #天使 #shorts
00:35
好人小丑
Рет қаралды 34 МЛН
Master BLE Basics in Just 10 Minutes: The Ultimate Guide!
9:15
Novel Bits
Рет қаралды 107 М.
BLE with ESP32 tutorial part 1: the Server
25:23
MoThunderz
Рет қаралды 94 М.
#173 ESP32 Bluetooth BLE with  Arduino IDE (Tutorial) and Polar H7
15:55
Quick C# application to connect with a Bluetooth LE device
35:50
Cornel Human
Рет қаралды 32 М.
Connecting hardware devices to the web
9:55
Chrome for Developers
Рет қаралды 38 М.
Bluetooth Low Energy - Protocol Stack (Part 1)
8:39
Bina Bhatt
Рет қаралды 59 М.
Doing Bluetooth Low Energy on Linux
43:32
The Linux Foundation
Рет қаралды 18 М.
ЛУЧШИЙ ФОКУС + секрет! #shorts
00:12
Роман Magic
Рет қаралды 20 МЛН