Easiest ESP32 BLE (Bluetooth Low Energy) Tutorial | Arduino

  Переглядів 90,056

LiveSparks

LiveSparks

4 роки тому

Learn how to use BLE with the ESP32 using the Arduino Development Enviornment.
~~~~~~~~~~~Video Sponsor~~~~~~~~~~~~
Buy Electronic Components from lcsc.com
Get 8$ off using this link : bit.ly/2F0bVcz
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
~~~~~~~~~~~~~NOTES~~~~~~~~~~~~~~~
Use GPIO 15 to connect the temperature sensor instead of GPIO 36.
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
~~~~~~~~~~~~~LINKS~~~~~~~~~~~~~~~~
Download the example codes : bit.ly/2XH4Tk2
Download the nRF Connect App : bit.ly/2ICYtfK
Download the custom app : bit.ly/2X4LDA5
Use ESP32 with Arduino : bit.ly/31vHNz8
Pre-defined Services : bit.ly/2IaIeHw
Pre-define Characteristics : bit.ly/2X4EgIN
Use this website to view the GATT specifications (xml files) : bit.ly/2WKSPCh //Use the XML Tree View
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
~~~~~~~~~~~PRODUCT LINKS~~~~~~~~~~~
Buy the ESP32 FireBeetle Board : goo.gl/5he7bp
Buy the DS18B20 Temperature Sensor : goo.gl/DNTgMb
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Help translate this video in your language : ukposts.info_cs_p...
Music by Joakim Karud / joakimkarud

КОМЕНТАРІ: 111
@LiveSparks
@LiveSparks 4 роки тому
How many times did I say 'BLE'?
@crazytom
@crazytom 4 роки тому
What's the current consumption of this loaded board while running this "Low Energy" sketch?
@LiveSparks
@LiveSparks 4 роки тому
That's a good question. I haven't actually measured the current consumption on this board but on the M5Stack (a ESP32 board with an absolutely minuscule battery), the everything-to-string sketch runs for about a hour (while a client is connected) while a WiFi web server sketch dies within minutes.
@mewintle
@mewintle 4 роки тому
I’ve been struggling with an ESP-32 BLE project for a long time. It’s a project for reading devices for medical missions to 3rd world locations. I’ve read dozens of articles, PDFs, etc. All were too low-level or high-level. From this I understand all the theory, but putting it into practice has been too much. This is the first resource that gave me hardcore practical information. I’m excited that now I understand how I can make it work! Thank you so much for this help!
@BenjaminLovelady
@BenjaminLovelady Рік тому
Super helpful to have this info in a short video I've been able to rewatch whenever i need to write BLE code. Thanks!
@rakithadealwis8468
@rakithadealwis8468 3 роки тому
best BLE tutorial i have seen so far !!
@MRRAWRAW1
@MRRAWRAW1 4 роки тому
Amazing clear guide! Im looking into building my own vertical hydroponic garden and using audrinos in order to compile data on the garden and make sure its recieving proper amounts of water and nutrients. Please keep it up!!
@bolow
@bolow 2 роки тому
Thank you so much, for the through explanation of the BLE basics, even though I knew most of it, you clarified some of questions I had.
@miketony2069
@miketony2069 4 роки тому
Very good detail description of BLE on ESp 32
@trantuan4558
@trantuan4558 4 роки тому
Thanks for your clear instruction. How about making a BLE beacon. Do you have any project that touched on subject ?
@wei48221
@wei48221 3 роки тому
This is a very helpful tutorial for newbies. Thank you very much for your effort.
@Arthurgoujon
@Arthurgoujon 3 роки тому
best tutorial on this topic by far! many thanks!
@shaiseg
@shaiseg 3 роки тому
Thanks for a great tutorial! May I ask where do I find the XML that defines a pre-defined standard characteristic like the temperature (8:30 in the video) I do not find it anywhere in bluetooth site. The service XML does not have this info. Thanks!
@mattygsa
@mattygsa 4 роки тому
Great video thanks. Question. Am I able to send a bluetooth classic throttle signal over serialBT from a transmitter ESP32 to a receiver ESP32 whist also sending temperature readings back to the transmitter ESP32? If so! Would I use BLE for this? Can I even use BT and BLE at the same time?
@0miker0
@0miker0 8 місяців тому
Great video and everything was explained very well.
@davidkempton2894
@davidkempton2894 Місяць тому
Thanks very much for this! Your explanation was very useful. Thanks for telling us about chars too.
@jairoalbertoreyes
@jairoalbertoreyes 3 роки тому
Good video, how can I make a simple process a resend some data to the phone? For example, a humidity sensor and a light sensor send data to a device, and then the device sends these data to my phone via Bluetooth. Can a ESP32 be configured as Client and server at the same time? Thanks
@goranjosic
@goranjosic 3 роки тому
Really good explanation!! Thank you!
@sandeepsinghjagdev3485
@sandeepsinghjagdev3485 3 роки тому
Best tutorial also I want to know that is connection remain connected when esp32 wakes up from deep sleep (i use deep sleep for very low battery power consumption (1mA) )??
@poopypoop1212
@poopypoop1212 3 роки тому
Thank you so much for this tutorial!!!
@mahendrau4212
@mahendrau4212 3 роки тому
Superb explanation boss and thanks for this tutorial.
@biker2k3
@biker2k3 4 роки тому
Gracias!!! muy buena explicacion!
@umashankarumashankar6796
@umashankarumashankar6796 4 роки тому
nice vedio im trying to use float variable and i want to perform read and write value using BLE but im not able to do that can you exeplian me . thanks
@valentingomez4546
@valentingomez4546 Рік тому
im having an extremely hard time making this work on a psoc 6 board, the code is kinda similar but some of the concepts differ a little bit, if possible, could you do a tutorial with a board of the psoc 6 family using Eclipse IDE?
@shaiknadeemsameer8168
@shaiknadeemsameer8168 3 роки тому
sir, can we consider RSSI value without pairing one with another BLE and perform action based on RSSI value?
@vishalpanchal6332
@vishalpanchal6332 3 роки тому
Best BLE tutorial... 👌🙌
@toastrecon
@toastrecon 3 роки тому
Very helpful, thank you!
@rickmiles3701
@rickmiles3701 4 роки тому
Trying to get a 2nd ESP32 to act as a client for the BLE switch (server). Any suggestions on what code to load on the client side?
@adityapandya8098
@adityapandya8098 2 роки тому
Thank you so much This is helpful
@seekyou
@seekyou 2 роки тому
What should I put in the ESP32 disconnect function in order to let the ESP32 be advertised for a new connection? Its seems the code in the setup is executed one time and when I disconnect client device (a MIT appinventor custom app) I cannot reconnect again. The ESP32 server is stopped - maybe you have a link to correct configuration for a MIT app disconnect command?
@paytufo
@paytufo 4 роки тому
How could I do to read the Slope in Zwift (bike simulator) and the said a motor move to position 1 to 10?
@tanujsharma2647
@tanujsharma2647 Рік тому
how to configure wifi by using ble in esp32 using arduino? Do you have any video in this regard?
@FLBRGZ
@FLBRGZ 4 роки тому
Hello, great tutorial, can you help with idea? Can you connect to the zwift cycling program as a fitness machine ftms and receive or obtain the gradient or resistance level. I have been trying for months. Thanks for any help.
@bilgekaantekin9785
@bilgekaantekin9785 2 роки тому
Hi, did you finish your fitness machine or indoor bike project?
@zyroxiot9417
@zyroxiot9417 Рік тому
Good job, thanks a lot! ✌🏼🇧🇷
@ceptic7707
@ceptic7707 4 роки тому
Hi, I'm making an android app like mojipic with ble. Can you help me? I have to convent gifs to c array and then show it on a led panel with arduino
@dirtyv69
@dirtyv69 4 роки тому
I loaded your app into MIT App Inventor, compiled and put it on my Pixel 3A phone. I also loaded your switch code onto my ESP32 board. There seems to be something wrong with the App as it always comes back with "No Devices Found". Running a "BLE Scanner" app I can find the ESP32 and see that the switch program is working. Running an app I wrote on MIT App Inventor for a different BLE module, I was able to see the ESP32, but could not connect because it was looking for a different service ID. I even tried loading your APK, and it was unable to find any devices. Not sure what is wrong, but something seems broken as both my APP and the BLE scanner can see the ESP32, but your APP does not.
@rizqifw
@rizqifw 2 роки тому
Amazing content bro.
@cliffmathew
@cliffmathew 3 роки тому
Excellent! Thanks
@solosailorsv8065
@solosailorsv8065 3 роки тому
The BLE Viewer App does not see any devices at all, the nRF Connect works fine as sees all BLEs in the area
@Neuro010
@Neuro010 5 місяців тому
Hi, I want to send an int type array of lenght 34 over BLE and recieve it using matlab. can you please help me out here how to proceed!
@swaroopbu3564
@swaroopbu3564 4 роки тому
how to transfer data between two ble server and client plzhelpme in tht
@keepsafesystems2995
@keepsafesystems2995 2 роки тому
Hi there. I hope you are still active. I need to build a bluetooth scanner which fires a relay when a specific bluetooth device is in the proximity. I have a firebeetle and the arduino IDE. I am lost from that point on. I can't find the board in the list, I cannot seem to connect. Yes, I am a n00b
@axa.axa.
@axa.axa. 4 роки тому
You can send more than a single byte in a characteristics value. Using the setvalue byte array parameter is not a workaround, it's a feature
@LiveSparks
@LiveSparks 4 роки тому
You are right, of course. I should have worded that better.
@muhammadjafarshiddiq1408
@muhammadjafarshiddiq1408 4 роки тому
Hello, thanks for the tutorial! but i've got some problem that my potentiometer analog value is always 255 (shown in the serial monitor), or the value at the characteristic is always FF at the nRF Connect App. I use GPIO14 from ESP32 DOIT DEVKIT V1 Board. Can you help me please? thanks
@LiveSparks
@LiveSparks 4 роки тому
Not all pins of the ESP32 are suitable for analog readings. Try some other pins too.
@hondaman900f
@hondaman900f 4 роки тому
What was the dev tools you mentioned you created the Android app in?
@LiveSparks
@LiveSparks 4 роки тому
MIT App Inventor 2
@SA-oj3bo
@SA-oj3bo 11 місяців тому
Hi , I would like to replace HM10 by the ESP32 BLE so that the existing Android and IOS app's can be used without the need of the HM10. Can you or someone here give some advice please? I changed the UUID's already but that seems not enough. How to modify the code to replace the HM10? Thx.
@rahmanmahmud2566
@rahmanmahmud2566 4 роки тому
How to receive integer data from an iphone BLE app? I was able to receive just 1 digit in ASCII. No matter the length of my data is it only take the first digit in consideration. But if I send whole string like name then it is fine. This is the receiving code" if (rxValue.length() > 0) { Serial.println("*********"); Serial.print("Received Value: "); for (int i = 0; i < rxValue.length(); i++) x = (rxValue[i]); Serial.println(x); I want to assign any value I send from my iphone
@soundofsoul8700
@soundofsoul8700 2 роки тому
How to set multiple characteristics in one service?
@rohitkhot8976
@rohitkhot8976 4 роки тому
Hi, thanks for the wonderful tutorial, I am trying to connect my ESP32 board to Chrome using web Bluetooth, however, the chrome is not able to detect it, can you please help what might be the problem? It works well with nrfConnect
@LiveSparks
@LiveSparks 4 роки тому
Sadly I am not very familiar with web Bluetooth. You can take a look at the client app project inside the MIT App Inventor to see how the client flow works which you can then try and replicate with web Bluetooth.
@rohitkhot8976
@rohitkhot8976 4 роки тому
@@LiveSparks Thanks I will look into it :)
@shanmcarthur
@shanmcarthur 11 місяців тому
What app are you using on your Android phone to see the BLE device with characteristics and values being sent?
@oscargraveland
@oscargraveland 8 місяців тому
I am late to the party.. but the app he is using looks very much like "nRF Connect" (made by Nordic semiconductor)
@solosailorsv8065
@solosailorsv8065 3 роки тому
Please clarify: This sets up the ESP32 as a BLE Server in Broadcast mode? THANKS
@LiveSparks
@LiveSparks 3 роки тому
Yes
@MeisterQ
@MeisterQ 4 роки тому
Hey, nice Video. Im trying atm to communicate with a bluetooth radiator-valve atm. If i scan for ble devices with the examplecode given by the IDE, i can find it. But i was hopeing i could use your video to find out which data i can request or just get from the device. There is an existing project on github already, but i want to build my own. I need abit of help. Do you have any idea?
@LiveSparks
@LiveSparks 4 роки тому
github.com/espressif/arduino-esp32/blob/master/libraries/BLE/examples/BLE_client/BLE_client.ino
@MeisterQ
@MeisterQ 4 роки тому
@@LiveSparks Thank you very much. with that, i could connect to the service uuid and get a data. But only one. the valves consisting of alot of data. weird
@LiveSparks
@LiveSparks 4 роки тому
You need to code for each service that you want to read. Use nrf connect app to see what services are being advertised.
@froh_do4431
@froh_do4431 3 роки тому
Will this code also work if I use other hardware? I am using the dht22 as a sensor and I have the bluefruit spi friend as a bluetooth device both connected to the arduino
@LiveSparks
@LiveSparks 3 роки тому
The Bluetooth code is hardware specific to the esp32
@mytechnotalent
@mytechnotalent 3 роки тому
Thank you for your BLE videos. I have an ESP32 and I have tried your BLE examples and they all work on my phone. I am struggling to get the BLE Client to work as I want to be able to have another ESP32 read these values. Here is what happens when I run your BLE_everything_to_string program on another client BLE which I am using the built in BLE_client app: Starting Arduino BLE Client application... BLE Advertised Device found: Name: , Address: 4b:41:58:c8:94:f2, manufacturer data: 4c0010050818237b8e BLE Advertised Device found: Name: , Address: 1e:44:1e:8d:54:08, manufacturer data: 0600010920021f0f72b658f8fa6a56054b76f656467d07548b169b875d BLE Advertised Device found: Name: , Address: 4a:f7:2c:59:b5:ec, manufacturer data: 4c001005421c6e4d8a BLE Advertised Device found: Name: , Address: 7f:79:4e:7f:82:4e, manufacturer data: 4c0010050818237b8e BLE Advertised Device found: Name: , Address: 57:b1:e4:c9:d2:82, manufacturer data: 4c001005401c7dd543 BLE Advertised Device found: Name: , Address: 7b:d8:62:bc:e9:84, manufacturer data: 4c001005241c548cdc, txPower: 8 As you can see I do not see the Device Name or any of the messages like this is a string as I am seeing them on my phone app but not on the BLE_client. Any help would be appreciated!
@unpredictable14686
@unpredictable14686 3 роки тому
Thanks for great tutorial but BLE_Viewer2.apk is not able to detect my esp32 ble device
@rghrg
@rghrg 3 роки тому
Hi! Do you know any method to limit on the server the number of incomming connections (clients) to one? Thank you.
@LiveSparks
@LiveSparks 3 роки тому
You can use pAdvertising->start() after the first client has connected.
@rghrg
@rghrg 3 роки тому
@@LiveSparks Thank you. I'm not sure I get it, if I start it even if the first client has connected, it will still advertise for the second and subsequent clients, right?
@LiveSparks
@LiveSparks 3 роки тому
Sorry, I meant pAdvertising->stop().
@rghrg
@rghrg 3 роки тому
@@LiveSparks Thank you, it worked! I stop on connect and start on disconnect.
@LiveSparks
@LiveSparks 3 роки тому
Glad to hear it.
@mikelemon5109
@mikelemon5109 4 роки тому
8:26 how do I access this page to view how data for different pre defined characteristics needs to be formatted for a guide for an incoming project.
@LiveSparks
@LiveSparks 4 роки тому
There are links in the video description for services and characteristics. Download the xml for the appropriate thing and view it in the XML viewer.(Link also in the description).
@mikelemon5109
@mikelemon5109 4 роки тому
@@LiveSparks OK, But how to I find the relevant URL for say the temp characteristic?
@mikelemon5109
@mikelemon5109 4 роки тому
@@LiveSparks OK I understand now you have to literally copy the hyper link of the service\characteristic and throw it to the online converter to view that.
@spiderion1
@spiderion1 2 роки тому
How can I send json data via bluetooth?
@s.husain6125
@s.husain6125 4 роки тому
I'm am to able to convert incoming Lora data packet to char at initialization sir how I can send seprate sensor value to custom app I have tried all the stuff. I want to send my Lora reciver data packet which is coming from node to reciver to my custom app sir how I can achieve that
@LiveSparks
@LiveSparks 4 роки тому
I have shown how to do so in the video. You can also look at the examples that I have linked in the description
@rudycandu1633
@rudycandu1633 4 роки тому
I appreciate your video. But it would help if the sound was better. It is hard to understand you because of the room reverberations. Move the mic closer to you. Or use some soft items to absorb the sound of the room.
@LiveSparks
@LiveSparks 4 роки тому
I don't have a mic currently, I just use my phone but I'll try to get better sound.
@davoodnasehi
@davoodnasehi Рік тому
Nice one
@MegaCoolshot
@MegaCoolshot 4 роки тому
Not working, I'm using a huzzah32 board with ds18b20 and I am not able to get any temp readings using this code. i can connect via ble but will not give me any temp values on the app or on the serial monitor ive tried many different pins. Any help please?
@LiveSparks
@LiveSparks 4 роки тому
If you are not getting anything even on the serial monitor then you might wanna try a different pin for the sensor.
@MegaCoolshot
@MegaCoolshot 4 роки тому
@@LiveSparks Thanks for the response, I am getting this on the serial monitor rec = 0 85.00 repeating
@MegaCoolshot
@MegaCoolshot 4 роки тому
Disregard my last message, my resistor was not connected properly. I am getting readings now on the serial monitor but not on the nRF app. It is connected but for value it shows 0x280A instead of a temp reading
@MegaCoolshot
@MegaCoolshot 4 роки тому
So i believe im getting a hexadecimal value
@LiveSparks
@LiveSparks 4 роки тому
I am sorry but I am stumped as to why this might be. Is the environment sensing service showing up correctly in the nRF Connect app?
@davoodnasehi
@davoodnasehi Рік тому
Do you do freelance works?
@ravikharb
@ravikharb Рік тому
Yes. Contract me on livesparking@gmail.com
@Esteapen
@Esteapen 2 роки тому
Is it possible to extend its range?
@LiveSparks
@LiveSparks 2 роки тому
There are some ESP32 modules that have external antennas. Those would have better range.
@3015gaurav
@3015gaurav 3 роки тому
Can you guide me
@tamer79
@tamer79 3 роки тому
Didn't work at all.... Couldnt connect to iOS (iphone XS) or Windows 10. 2 months looking for a solution and nothing... I guess I'll go back to Arduino....
@mukund22kar
@mukund22kar 4 роки тому
hello the app is not connecting to ESP32 always responds no device found
@LiveSparks
@LiveSparks 4 роки тому
Make sure your Bluetooth is on. The custom app doesn't give a warning if Bluetooth is off.
@mukund22kar
@mukund22kar 4 роки тому
@@LiveSparks Yes its on
@LiveSparks
@LiveSparks 4 роки тому
Can you see the device in the nRF Connect app? If not, then the issue might be with the code running on the ESP
@mukund22kar
@mukund22kar 4 роки тому
Yes i am able to see the device in nrf connect app
@mukund22kar
@mukund22kar 4 роки тому
I am trying to add button on mit app intventer but not able to make one can help on how to do that
@Nabilphysics
@Nabilphysics Рік тому
Oh boy... Finally, an Indian boy comes to rescue the BLE developer. Thanks.
@nfaza80
@nfaza80 Рік тому
bruh too much object
@3015gaurav
@3015gaurav 3 роки тому
Can you guide me
#173 ESP32 Bluetooth BLE with  Arduino IDE (Tutorial) and Polar H7
15:55
Andreas Spiess
Переглядів 169 тис.
MINHA IRMÃ MALVADA CONTRA O GADGET DE TREM DE DOMINÓ 😡 #ferramenta
00:40
Анна Трінчер - Бар за баром (Official Music Video)
02:38
Анна Трінчер
Переглядів 1,4 млн
12 Useful & Interesting ESP32 Projects for Beginners!
9:41
ToP Projects Compilation
Переглядів 561 тис.
Master BLE Basics in Just 10 Minutes: The Ultimate Guide!
9:15
Novel Bits
Переглядів 85 тис.
CAN Gateway: Monitoring Cars Wirelessly!
8:02
MrDIY
Переглядів 116 тис.
BLE Fundamentals - GAP, GATT and ATT protocol ( Part 2)
12:56
Bina Bhatt
Переглядів 51 тис.
Using Web BLE to detect and get GATT information
19:41
Sayanee Basu
Переглядів 26 тис.
Ошибка в калькуляторе iPhone
0:22
Romancev768
Переглядів 1 млн
GOOGLE СДЕЛАЛИ НЕВОЗМОЖНОЕ! Это круче любого Samsung, Apple и Xiaomi…
13:16
Thebox - о технике и гаджетах
Переглядів 64 тис.
Why spend $10.000 on a flashlight when these are $200🗿
0:12
NIGHTOPERATOR
Переглядів 15 млн
ИГРОВОЙ ПК c WILDBERRIES за 40 тысяч рублей
30:17
Ремонтяш
Переглядів 455 тис.
DNS
0:27
Pirate Software
Переглядів 2,3 млн