#174

  Переглядів 95,174

Andreas Spiess

Andreas Spiess

6 років тому

Good news! My fake Polar H7 Bluetooth heart Rate sensor works on my ESP32 using the Arduino IDE. I will show you what I had to do. And much more!
Today I can show you
- How you can build a sensor which sends data via BLE to a client
- A client which can receive these values and display them in Serial Monitor
- The mysterious BLE2902 client characteristic configuration and how it works
- The details of the protocol used by the heart rate measurement characteristics. This will help you to build other sensors based on different standardized services and characteristics
Links:
First tutorial video about BLE: • #173 ESP32 Bluetooth B...
Sketches: github.com/SensorsIot/Bluetoo...
Neil Kolban's Github: github.com/nkolban
ESP32 board used: bit.ly/2sOMR3E
Supporting Material and Blog Page: www.sensorsiot.org
Github: www.github.com/sensorsiot
My Patreon Page: / andreasspiess
If you want to support the channel and buy from Banggood use this link to start your shopping: bit.ly/2jAQEf4 (no additional charges for you)
profile.php?...
/ spiessa
www.instructables.com/member/...
Please do not try to Email me or invite me on LinkedIn. These communication channels are reserved for my main job

КОМЕНТАРІ: 250
@deangreenhough3479
@deangreenhough3479 6 років тому
Andreas you have done it again👍 I believe many peoples Christmas has come early. Outstanding work by you and your contributors, thank you all.
@AndreasSpiess
@AndreasSpiess 6 років тому
You are welcome. I am happy to have such a wonderful community!
@gianlucacembrani9923
@gianlucacembrani9923 6 років тому
As inspiring as usual, thanks for this present, Andreas! I'll start looking into a miflora-to-mqtt project soon. Marry Christmas, my friend.
@AndreasSpiess
@AndreasSpiess 6 років тому
Please show us your findings! Merry Christmas, too
@peterwhyte4526
@peterwhyte4526 6 років тому
Hi Andreas, so excited! - tonight I got my Garmin 935 to find and connect to my "fake" polar h7 using your sketch - thank you so much - I am now a fan of the ESP32 and will leave the world of the ESP8266 for bigger and better things!! :)
@AndreasSpiess
@AndreasSpiess 6 років тому
Great! Thanks for your feedback.
@TobiasWitting
@TobiasWitting 3 роки тому
Thank you for this fantastic video and the code! I was able to fake the heart rate belt on my ESP32 dev board and pair with my Polar vantage M watch without problem. Now I'm trying to make a speed and cadence sensor using this and two 44E402 Hall switch sensors...
@AndreasSpiess
@AndreasSpiess 3 роки тому
Sounds like a fun project. I wish you success!
@dougmanatt4317
@dougmanatt4317 6 років тому
My first 2 ESP-32s will come about Christmas time. With your help I will be using them soon!
@AndreasSpiess
@AndreasSpiess 6 років тому
Good timing!
@arduinomaker7210
@arduinomaker7210 6 років тому
Great work. I can now use BLE for my projects. Thank you.
@AndreasSpiess
@AndreasSpiess 6 років тому
:-)
@hansschenker
@hansschenker 6 років тому
Solid swiss work! Not giving up before having found the solution! Thank's a lot for your work in the public!! :-)
@AndreasSpiess
@AndreasSpiess 6 років тому
You are welcome. Giving up after a few days only usually is no good option...
@ezanchet
@ezanchet 5 років тому
Many thanks Andreas, this video was very useful for a project I'm doing ! I'm watching all your videos and are inspirational :-)
@AndreasSpiess
@AndreasSpiess 5 років тому
You are welcome!
@neuralianmetazoan
@neuralianmetazoan 6 років тому
Thank you! Just received my first esp32s, off to try them out now ...
@AndreasSpiess
@AndreasSpiess 6 років тому
:-)
@istvanzilizi6194
@istvanzilizi6194 6 років тому
Big Thanks for this Andreas! I really think I can learn from you new things! It is time to experiment!
@AndreasSpiess
@AndreasSpiess 6 років тому
Enjoy!
@charlesdorval394
@charlesdorval394 6 років тому
Congratulation Andreas! Glad you got it working :)
@AndreasSpiess
@AndreasSpiess 6 років тому
:-)
@jamisusijarvi646
@jamisusijarvi646 6 років тому
This was really useful for my projects. I think i allready have to test today
@AndreasSpiess
@AndreasSpiess 6 років тому
:-)
@evanjones9764
@evanjones9764 4 роки тому
Hi Andreas, thanks for your contribution. I was having a lot of issues with getting BLE notification going for a project using Heltec esp32 board using arduino platform. I was having core 0 panic error. It seems that it is quite sensitive to how characteristics are defined, and cast. Also found the addition of BLE2902 seemed to help things go better. I had tried basing my code on the Neil Kolban BLE server example which is where I saw these core panic errors. Patching your interpretation of the code has meant that my project is now doing notify without bombing out. Thanks once again for your contributions our collective understanding of working with BLE on ESP32.
@AndreasSpiess
@AndreasSpiess 4 роки тому
I more or less stopped BLE on the ESP32 because it was not very stable. Maybe they changed it in the meantime. But it does not seem to have a high priority for Espressif
@radselius
@radselius 6 років тому
Thank you Andreas, I have learned a lot with your videos... greetings from Mexico.
@AndreasSpiess
@AndreasSpiess 6 років тому
You are welcome!
@omaryanas435949
@omaryanas435949 6 років тому
Absolutely Brilliant !
@AndreasSpiess
@AndreasSpiess 6 років тому
Thank you!
@ThomasHaberkorn
@ThomasHaberkorn 6 років тому
Very useful! Can't wait to try it. Thanks Andreas !
@AndreasSpiess
@AndreasSpiess 6 років тому
Good luck!
@deangreenhough3479
@deangreenhough3479 5 років тому
Back again for a refresher and yes, I missed things and learned more.
@AndreasSpiess
@AndreasSpiess 5 років тому
I did not try it since then...
@LooLL321
@LooLL321 6 років тому
thank you for all of your work :) 10/10 :)) cant wait for next episode :)
@AndreasSpiess
@AndreasSpiess 6 років тому
You are welcome. The next episode should be out by now.
@knightautomation2020
@knightautomation2020 3 роки тому
so Beautiful! Great Video! and Nice Done!!
@hollensted
@hollensted 6 років тому
Awesome! My dream goal would be to make a crank force sensor for my unicycle. Thanks for sharing!
@AndreasSpiess
@AndreasSpiess 6 років тому
That should now be possible together with my cat video (weight measurement)
@rklauco
@rklauco 5 років тому
As always, PERFECT video. Thanks!
@AndreasSpiess
@AndreasSpiess 5 років тому
You are welcome!
@peopledrivemecrazy
@peopledrivemecrazy 6 років тому
Amazing work.
@AndreasSpiess
@AndreasSpiess 6 років тому
:-)
@DavideMenegalli
@DavideMenegalli 6 років тому
Hi Andrea, i found your channel today while searching for wifi devices, and i discovered that you're in Swiss too like me, how small is this world :) You have gained a new follower, best regards ! Davide
@AndreasSpiess
@AndreasSpiess 6 років тому
Welcome to the channel!
@mb106429
@mb106429 2 роки тому
cracking video..... . because you researched stuff for beginners as a beginner, published your mistakes, and then published this video showing how you overcame the problems that took you a week to think about, with help from other experimenters.
@AndreasSpiess
@AndreasSpiess 2 роки тому
Thank you for your kind words!
@mb106429
@mb106429 2 роки тому
@@AndreasSpiess yep, when you publish your struggles and problems it makes the video very accessible and easy for learners. It helps us see that the subject is accessible and do-able instead of being really heavy and difficult. Lots of UKpostsrs edit out their mistakes, try to be big-headed and try to make themselves look like experts. There's an important difference between someone trying to make themselves look good vs someone who is really trying to encourage learning.
@JohnoScott
@JohnoScott 6 років тому
Well done. Good to get some closure on this problem
@AndreasSpiess
@AndreasSpiess 6 років тому
Maybe it is the opening for many other questions like energy consumption, deep sleep, range and others...
@CristiIstrate
@CristiIstrate 6 років тому
Great conclusion for your last video on ble.
@AndreasSpiess
@AndreasSpiess 6 років тому
:-)
@sumaxeme
@sumaxeme 6 років тому
This is Christmas - such amazing stuff to look into during the coming season.....
@AndreasSpiess
@AndreasSpiess 6 років тому
Enjoy tinkering!
@artem_ur3q
@artem_ur3q Рік тому
Andreas, Thank you! Your explains really good!
@AndreasSpiess
@AndreasSpiess Рік тому
Glad you think so!
@VideoDetection
@VideoDetection 6 років тому
Well done Andreas! Loved the inclusion of "Dinner For One" its a true classic that can be watched over and over :) Have you seen the new LolinESP32 Pro? It uses the new Wrover module and has an SD card reader, step up from the Wroom module equipped Loloin32's. Have a great xmas and looking forward to see what projects you present in the new year. Love your work!
@AndreasSpiess
@AndreasSpiess 6 років тому
I have a pro in the mail. We will see what I will do with it. For the moment I have no special project in mind
@avejst
@avejst 6 років тому
Thanks for sharing 😀👍 interesting stuff
@AndreasSpiess
@AndreasSpiess 6 років тому
I am also glad we can use BLE now for our projects.
@chuxxsss
@chuxxsss 6 років тому
Nice one Andreas will watch it in the morning.
@AndreasSpiess
@AndreasSpiess 6 років тому
:-)
@northshorepx
@northshorepx 6 років тому
WOW WOW WOW WOW perfect!!!!! thank you so much!
@AndreasSpiess
@AndreasSpiess 6 років тому
You are welcome!
@giaras64
@giaras64 6 років тому
Nice work Andreas. I just got the same Polar H7 device and successfully tried your sketch. Really useful examples. I'm looking in Kolban's snippets for work in progress on ibeacon but not so easy to integrate under arduino IDE .. too much rust on my brain :-)
@AndreasSpiess
@AndreasSpiess 6 років тому
Thanks for the feedback. Maybe I will have a look into beacons later.
@giaras64
@giaras64 6 років тому
ok. In the case it may be useful my last message on ESP32-snippets (by qrpfun) github.com/nkolban/esp32-snippets/issues/271
@AndreasSpiess
@AndreasSpiess 6 років тому
Thanks for the link. I will have a look at ir
@daskasspatzle2396
@daskasspatzle2396 6 років тому
Great, thanks to you and also the helping viewers ;-)
@AndreasSpiess
@AndreasSpiess 6 років тому
You are welcome!
@DougHanchard
@DougHanchard 6 років тому
Just an observation, for a retired Electrical Engineer, I bet you are busier now than when you were working full-time! Nice job!
@AndreasSpiess
@AndreasSpiess 6 років тому
I am not retreated. I still work. Here we stop at 65 and I am only 61 :-(
@joeybushagour2612
@joeybushagour2612 6 років тому
Great as always!
@AndreasSpiess
@AndreasSpiess 6 років тому
:-)
@MrSasha3050
@MrSasha3050 3 роки тому
Listen on one breath. Thank you Andreas.
@AndreasSpiess
@AndreasSpiess 3 роки тому
You are welcome!
@luchoescobar
@luchoescobar 6 років тому
This is great thanks Andreas!!! Have you tried the BLE 5.0???
@AndreasSpiess
@AndreasSpiess 6 років тому
ESP32 cannot do it and I hardly understand 4.0 ;-)
@fuxfuzzy
@fuxfuzzy 4 роки тому
Great Video! Thanks!
@AndreasSpiess
@AndreasSpiess 4 роки тому
You are welcome!
@rhm84119
@rhm84119 2 роки тому
Thanks for the video and the code. It helped me a lot. In order to connect to my Polar H9 as a client I had to change the line pClient->connect(pAddress); to pClient->connect(pAddress, BLE_ADDR_TYPE_RANDOM); I did not fine this myself but when I put a link in my comment giving proper credit my comment disappears.
@AndreasSpiess
@AndreasSpiess 2 роки тому
Thank you. UKposts does not allow links anymore. I changed the code.
@BIN8675
@BIN8675 5 років тому
Great Video. I'm getting results with my ESPs spoofing your heart rate monitor. My only problem is that I need to use another type of data that is a little larger than your example. I have tried to use other service UUIDs to get data larger than a the little 8bits used in the heart rate moniter(180D). I'm trying to transfer gyroscope data over BLE so I need a data type that can hold 0-360. Also, all of the services have very specific uses. What service/characteristic do you recommend?
@AndreasSpiess
@AndreasSpiess 5 років тому
I did not further work with BLE. So I am not a big help. But I think, together with Goole you will be able to find a solution. BLE is not limited to the ESP32 and maybe somebody else solved it.
@kevintan4001
@kevintan4001 2 роки тому
Nicely done. Are you able to do up another tutorial for BLE GNSS profile which requires Service Class: "Serial Port" (0x1101) and Protocol: "L2CAP" (0x0100) "RFCOMM" (0x0003). Thanks.
@tablatronix
@tablatronix 6 років тому
This is great, does anyone know if its possible to send btle notifications to IOS without software or a custom app ? Is there like a prowl for bt ?
@dontaskme1625
@dontaskme1625 6 років тому
Another interesting topic would be how high the power consuption is when the ESP32 is solely used as a BLE server. Does it save much energy compared to a ESP8266 on wifi? Yet another topic would be to receive data via blutooth and retransmitt it via MQTT. That could be used for the plant monitor (the one you used in the video) to intergrate it in node red. btw: do you have an aliexpress affilitate link, to support you by shopping there?
@axelmagnusmansson3265
@axelmagnusmansson3265 6 років тому
banggood methinks. and yes power consumption is really an interesting race for these gadgets now.
@AndreasSpiess
@AndreasSpiess 6 років тому
1. MQTT should be easy. 2. I am also interested in power consumption ans sleep modes.
@johnhmacleod
@johnhmacleod 6 років тому
I'd like to find a very low powered, programmable device with built-in BT (like the ESP32) to build BLE sensors. If you know of one, or how to make the ESP32 run like that - maybe on its super low power processor - that might be interesting. Then you could make a cat food monitor without a USB lead to trip her up as it would run for years on a button battery!
@christosmoutevelis4896
@christosmoutevelis4896 6 років тому
BLE sensors need to work with a CR2032 battery for six months to a year . ESP32 is good for making a cheap BLE to WiFi Gateway ( instead of having a full raspberry 3 for example ) . If you need a simple BLE sensor you should perhaps try the nRF or Dialog BLE chips . They even cut consumption by selecting the right amount of flash memory model needed for each application down to a few nA in sleep mode !
@raohamza4484
@raohamza4484 6 місяців тому
Well explained
@AndreasSpiess
@AndreasSpiess 6 місяців тому
Thank you!
@victorandrespolo
@victorandrespolo 3 роки тому
you dont know, how i love you.
@AndreasSpiess
@AndreasSpiess 3 роки тому
:-)
@FrankZosso
@FrankZosso 6 років тому
Thank you so much for that awesome update. Will try immediately on the LoPy board. Adding BLE to my projects is a big PLUS! Vy 73 de HB9FXQ
@FrankZosso
@FrankZosso 6 років тому
Can confirm it is working w. LoPy boards: twitter.com/HB9FXQ/status/942343732405391361
@AndreasSpiess
@AndreasSpiess 6 років тому
Thanks for your feedback!
@manecourquhart3242
@manecourquhart3242 6 років тому
Excellent once again Andreas, would like to know if it's possible to add feedback in the sensor to notify that the client received data?
@AndreasSpiess
@AndreasSpiess 6 років тому
I think many things are possible, but I am a beginner in this topic.
@cdawson875
@cdawson875 6 років тому
Andreas, this is amazing. Have you been able to get the client to automatically reconnect to the server if the connection is lost, or the client is reset? Or is this only achieved through bonding/pairing?
@AndreasSpiess
@AndreasSpiess 6 років тому
I did not do this work so far. I am a real BLE beginner and just started the journey...
@skimonsters
@skimonsters 3 роки тому
What a great videos every time again, just wondering why it connects perfect to apple but not to android ? All app on apple read the heartbeat but not on the apps in android? Thanks again
@AndreasSpiess
@AndreasSpiess 3 роки тому
I do not know :-(
@michip.1196
@michip.1196 4 роки тому
Ciao Andreas, thanks for your great work! I'm searching for an tool to monitor and save BLE readings from an (own made) device under Windows. Do you have any hints for me... Thanks Michi
@AndreasSpiess
@AndreasSpiess 4 роки тому
No, I never used BLE on Windows
@AgimRamqaj
@AgimRamqaj 6 років тому
Hi Andreas, did you measure how much energy does esp use in client or server mode?
@AndreasSpiess
@AndreasSpiess 6 років тому
No not yet
@AgimRamqaj
@AgimRamqaj 6 років тому
Andreas Spiess i'm sure you'll update us on that topic :) keep up the good work!
@AndreasSpiess
@AndreasSpiess 6 років тому
:-)
@shanebekker
@shanebekker 6 років тому
I wonder if this useful information applies to BLE 5.0. Would be cool if it did. Thanks again for your time in explaining these things for us.
@luchoescobar
@luchoescobar 6 років тому
Shane Bekker have you see some MCU’S with BLE 5.0? I think they re not Comercial at this time
@AndreasSpiess
@AndreasSpiess 6 років тому
ESP32 is not on 5.0 So we have to wait...
@chegewaras
@chegewaras 6 років тому
BLE 5.0 is backward compatible. Yes, all info from this vid will work with BLE 5.0.
@naasikhendricks1501
@naasikhendricks1501 6 років тому
BLE is a complete standard. If you able write, the complete standard then you able to access the ble. The RF is only a hardware function. The ble is a standard and protocol. That is not hard just time consuming and involved...
@aaronchan1498
@aaronchan1498 4 роки тому
Hi Andreas the characteristic value on the client serial monitor should be displaying the heart sensor reading right? Because it seems to be displaying some non-numerical values.
@AndreasSpiess
@AndreasSpiess 4 роки тому
It should. But this is an old video and I do not remember the details.
@aaronchan1498
@aaronchan1498 4 роки тому
@@AndreasSpiess Ok can thanks. BTW have you tried pushing real-time sensor data with timestamp onto the firebase database for the purpose of data analytic.
@t540985
@t540985 6 років тому
Great Video :) I'm trying to get my ESP32 to send data for 2 x voltmeters 1 x temperature 1 x humidity 1 x GPS coordinates using BLE to my phone (I'm using nRF Connect on the phone for testing) I cannot see a example how to create my own custom service with 3 x float , 1x integer, and 2 x double - values that can be displayed on the phone or may be use some of the already defined GATT Services ? Any suggestions will be well appreciated...
@AndreasSpiess
@AndreasSpiess 6 років тому
I am not a BLE specialist. But I think, if you can transfer one characteristic, you can also transfer the other values. You find a link for all defined GATT services.
@seb1099
@seb1099 3 роки тому
Thanks andreas. Just a question : how is connected the esp32 client to collect the datas? Thx
@AndreasSpiess
@AndreasSpiess 3 роки тому
I do not understand your question :-(
@vincenthorn3611
@vincenthorn3611 6 років тому
Grüetzi Andreas did you connect a ESP32 BLE client to your Polar H7 ? The HR caracteristic returns me different value formats like : 6 83 22 83 218 2 22 84 221 2 206 2 Why does the H7 not sending always the same format ? The first (6 83) and the second (22 83 218 2) seems correct from the flag point of vue (respect. 8byte HR value and 8byte HR + 16b RR). But how should I understand this 22 84 221 2 206 2 ? I noticed that the Polar H7 delievers a unkown service on the UUID = 6217ff4b-fb31-1140-ad5a-a45545d7ecf3. Any idea on this vendor specific UUID ? Vincent
@AndreasSpiess
@AndreasSpiess 6 років тому
Unfortunately, I do not know more than presented in this video. And I do no more remember all details. I think the links to the underlying documentation is in the comment. Maybe you find a solution.
@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. thanks
@AndreasSpiess
@AndreasSpiess 3 роки тому
I never made a project with a smartphone.
@aaliankhan4998
@aaliankhan4998 4 роки тому
Is ble secure. Can anyone see packets coming out. Can you control things with ble eg. A client sends a command and The server acts accordingly
@richardhedderly
@richardhedderly 5 років тому
Hi Andreas, Looking to extend the heart code for cadence and speed on a sensor: I understand the heart sensor position array, 2 being chest but for the heart characteristic array itself, which sub characteristics do the values relate to? byte heart[8] = { 0b00001110, 60, 0, 0, 0 , 0, 0, 0}; I think I’m missing something... Many thanks Richard
@AndreasSpiess
@AndreasSpiess 5 років тому
This is a quite old video, so I do no more remember the details. Sorry.
@richardhedderly
@richardhedderly 5 років тому
@@AndreasSpiess Not to worry, I think I've worked it out. That of the byte array, the first entry array[1] is the binary flags for the BLE characteristic.
@hworangs
@hworangs 6 років тому
But if you have two HR monitors that uses the same UUIDs and measurement, how do you define to which one to connect? Do you use the MAC address to differentiate?
@AndreasSpiess
@AndreasSpiess 6 років тому
I do not know. Unfortunately, I am not a BLE expert.
@LanceThumping
@LanceThumping 6 років тому
Do you think it would be possible to turn an ESP32 into a Bluetooth HID using this stuff as a base? I want to see about making my own Bluetooth controller with one I have laying around.
@AndreasSpiess
@AndreasSpiess 6 років тому
It should be possible. I found this link: github.com/asterics/esp32_mouse_keyboard . It is not for the Arduino platform.
@nomadcrossfire
@nomadcrossfire 6 років тому
Any chance you could do a video showing how to send data back and forth between 2 esp32s using BLE?
@AndreasSpiess
@AndreasSpiess 6 років тому
I have no plans for BLE for the moment. But this can change if more functionality appears.
@rolandstiebel1966
@rolandstiebel1966 5 років тому
Hi Andreas, Thanks again for your great video. I just tried to do the same with a Bluetooth Joystick. But I get an error bta_gattc_conn_cback() - cif=3 connected=0 conn_id=3 reason=0x003e while searching the web I found you had the same problem and asked for help. Can you tell me, what I have to do? Hardware: Wroom32 and HZ-2749 joystick Thanks a lot!
@AndreasSpiess
@AndreasSpiess 5 років тому
I do not know more than written into the post you mention and my example files. They worked at that time and I did not touch BLE since.
@rolandstiebel1966
@rolandstiebel1966 5 років тому
@@AndreasSpiess ok. Thanks anyway!
@giannimoretto1534
@giannimoretto1534 3 роки тому
Hi Andreas, could you please specify where the Notification ON/OFF must be placed?
@AndreasSpiess
@AndreasSpiess 3 роки тому
This is and old video and I do no more remember the details :-(
@tenminutetokyo2643
@tenminutetokyo2643 6 років тому
Ah so that is how you stay in such good shape.
@AndreasSpiess
@AndreasSpiess 6 років тому
Exactly...
@flatsix606
@flatsix606 6 років тому
Wow, thats great! Future: diy garmin edge 1000 :)
@AndreasSpiess
@AndreasSpiess 6 років тому
Maybe too complicated for me...
@jankijonka
@jankijonka 10 місяців тому
Hi Andreas, is it possible to build fake BLE heart rate monitor sensor (server) using AT commands implemntation ?
@AndreasSpiess
@AndreasSpiess 10 місяців тому
You have to be more specific.
@fabiocristini8793
@fabiocristini8793 6 років тому
Incredible work, as usual. Well done. I'm trying to use your samples to read my Flower Care (miflora) sensor (not sure if it's genuine as most of the common apps does not work with it). Have you have already started to analyze the protocol of your? I've a 4 custom services: FE95, FEF5, 1204, 1206. Do you have something similar?? Ciao Hjfabius
@AndreasSpiess
@AndreasSpiess 6 років тому
There seem to be several software revisions. So you have to experiment, change the different values of the sensor and watch which values in the client change. I did not do it so far, but mine worked with the app (after upgrading to the newest firmware)
@johnhmacleod
@johnhmacleod 6 років тому
I worked with chegewara on this & we found that there seems to be a problem communicating with this device using the Arduino IDE. You can read packets from it OK but are unable to command it to go into real-time reporting so it continues to report default data (AA BB CC....). It all works fine if you use the esp-idf instead.
@AndreasSpiess
@AndreasSpiess 6 років тому
Aha. So it is a problem of Neils implementation?
@fabiocristini8793
@fabiocristini8793 6 років тому
Can you upgrade the firmware without using the app? I was not aware of it.
@AndreasSpiess
@AndreasSpiess 6 років тому
I had to do it with the app
@cosmicbandito6926
@cosmicbandito6926 6 років тому
Maybe I'm crazy, but it seems like you are using the ble_2902 to reverse the normal operation. It seems like the sensor wants to be a server, and the app or database or whatever wants to be a client. It seems like it is already set up to be used that way. The server would notify about changing sensor values, since the sensor is the server, and the client would be that which displays or records the sensor values, and maybe doesn't need to send any notifications.
@cosmicbandito6926
@cosmicbandito6926 6 років тому
Dang it, the nomenclature of server and client is confusing, since they are kind of acting like both at different times. What I meant to say is that the sensor seems to want to be a (ble) client, listening for a (ble) server to ask for data, and sending the data when the (ble) server asks . The (ble) server could display, record, modify, or utilize the sensor data. The GAP and GATT roles can be switched and mixed as one needs, I guess: community.nxp.com/thread/332319
@AndreasSpiess
@AndreasSpiess 6 років тому
There is a two-way communication between the two devices. If someone calls a data transmitter a "server" then it changes all the time. AFAIK server and client are not very well defined roles and were the reason for a lot of confusion also in the past. For me (and this seems also the way GATT sees it) the server is connected to the sensor and the client to the "display". That is easy enough to be understood by me ;-)
@cosmicbandito6926
@cosmicbandito6926 6 років тому
Thank you. Certainly most of the documentation always refers to the (GAP) peripheral sensor as a (BLE) server and the (GAP) central as a (BLE) client. After studying more, If I were implementing my own heart monitors and displays (for something like a gym or hospital), I would probably emulate i-beacons, cramming the data into parts of the advertising data and scan response GAP payloads (whatever is allowed by i-beacons). Then I could monitor multiple sensors at once. With something like temperature sensors, you could save a lot of battery by adjusting the frequency (and power) of the advertising data payloads going out, since it also advertises how frequently GAP advertising data payloads will be sent out. It would never actually connect, it would just send out advertising data payloads that match the i-beacon/eddystone format containing the data. Thank you for your helpful videos. Sorry to drag you back here :) I bet you end up exploring beacons at some point either for energy savings, or very accurately triangulating people's location in buildings and such using multiple beacons and their signal strength (in an app running on a person's phone). There I go trying to run before learning to walk again.
@caocaolua9356
@caocaolua9356 3 роки тому
Pleas tell me how to autoconnect esp32 ble vs galaxy watch and more driver ble
@AndreasSpiess
@AndreasSpiess 3 роки тому
I have no idea about connecting smart watches
@19dai93
@19dai93 6 років тому
So if I would buy an ESP32 then I could use it to read the heart rate data from my Polar H7? Unfortunately I haven't found any working solution for Arduino Uno + Bluetooth module + Polar H7. By the way, great videos and very informative commentary!
@AndreasSpiess
@AndreasSpiess 6 років тому
Yes. And thank you.
@stefanhoellerl381
@stefanhoellerl381 Місяць тому
Servus Andreas, i am struggling a little bit with my ESP32 Bluetooth Fan which is controlled by a BLE Heartrate Sensor as you describe in your video. My main problem is actually that somehow my second heart rate sensor disturb the connection and the ESP32 just read the wrong sensor values. I would like to program something to seperate the heart rate sensors that only the belt i wear will connect to ESP32. The program itself works fine so far, but always interrupted by disconnection and connect to other same sensor UUIDs (0x180D) and (0x2A37). its alredy quite frustrating, that ESP32 ble does not connect to MAC Adress...😒. Maybe you have an idea. many thanks in advance and br stefan
@AndreasSpiess
@AndreasSpiess Місяць тому
It should be possible to find the number of your HR sensor and filter on it. But I do not have the exact code. Maybe you find a similar project?
@stefanhoellerl381
@stefanhoellerl381 Місяць тому
thanks for prompt answer, ok, thats a pity, but lets see if otherones have an idea. @@AndreasSpiess
@inakiinchaurregui4848
@inakiinchaurregui4848 5 років тому
Hi! Do you know if you can change the name of the bluetooth so that it appears as we want, when looking for it with another device?
@AndreasSpiess
@AndreasSpiess 5 років тому
Did you look ath the code? (BLEDevice::init("FT7");)
@inakiinchaurregui4848
@inakiinchaurregui4848 5 років тому
Andreas Spiess yes, the same!
@AndreasSpiess
@AndreasSpiess 5 років тому
FT7 is the name it displays
@ThomasHaberkorn
@ThomasHaberkorn 6 років тому
Is there a way to set the BLE transmit power or is it fixed?
@AndreasSpiess
@AndreasSpiess 6 років тому
I do not know. But I think, it is variable (maybe not in the Arduino IDE). But on the ESP32, most of the current is used because the device is on for way too long, not for the BT sender.
@naasikhendricks1501
@naasikhendricks1501 6 років тому
I had a similar question. The RSSI or dBm adjustment file. That will determine the range and application space. One can use more Powerful dBm for Controlled indoor application.
@TheManudulux
@TheManudulux 3 роки тому
Thanks for the video. Can this be done in micropython? What do you think?
@AndreasSpiess
@AndreasSpiess 3 роки тому
I never tried BLE with micropython
@TheManudulux
@TheManudulux 3 роки тому
@@AndreasSpiess Thanks. Bluetooth with micropython on esp32 see s very challenging and not well documented. If you search for a project here is one. Do what is in next video using python.
@TheManudulux
@TheManudulux 3 роки тому
@Andreas spiess, here is the correct link : ukposts.info/have/v-deo/g5Jhmp1_b32aunU.html Really nice project, isn’t it?
@rBazan
@rBazan Рік тому
Grande el Che
@AndreasSpiess
@AndreasSpiess Рік тому
:-)
@ara197
@ara197 4 роки тому
Dear Andreas, I ran into one more issue. My home laptop which used to run esp32 ble programs, is now issuing some errors, while I try to compile any BLE program, including the examples, which are already provided with the ESP32 BLE arduino library file. The reported error is panic: runtime error: invalid memory address or nil pointer dereference [signal 0xc0000005 code=0x0 addr=0x0 pc=0x7855fb] . goroutine 1 [running]: github.com/arduino/arduino-cli/legacy/builder.ResolveLibrary(0x11ce25a0, 0x11fc2151, 0xb, 0x11fc2151) Even I tried reinstalling ESP32 Boards once again from Boards manager. It works fine when I try compiling it in office system, but its not working in my home laptop. Any suggestions in this regard? Thanks
@AndreasSpiess
@AndreasSpiess 4 роки тому
Unfortunately I cannot do remote debugging. I never saw this error.
@SA-oj3bo
@SA-oj3bo 11 місяців тому
Hi Andreas, 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.
@AndreasSpiess
@AndreasSpiess 11 місяців тому
You have to google what services the HM10 exposes and simulate them with the ESP32. did you have a look at this project: "github.com/joelszy/ESP32-HM10"
@WagonLoads
@WagonLoads 2 роки тому
Can you make an esp32 emulate a Tile tracking tag?
@AndreasSpiess
@AndreasSpiess 2 роки тому
Maybe. If they use an official profile. I do not know tile.
@WagonLoads
@WagonLoads 2 роки тому
@@AndreasSpiess Tiles are (I think BT) key fobs used to find lost keys, bikes or other items. The Tile app searches for Tiles and maps their GPS location by any phone running the Tile app in the background. I was wondering if the esp32 could emulate a Tile.
@stefanboicu
@stefanboicu 4 роки тому
Have you tried esp32 classic bluetooth connection with iPhone/iOS? I try to figure it out what I am doing wrong but I cannot make it be discoverable and detectable by iPhone, maybe you could help.
@AndreasSpiess
@AndreasSpiess 4 роки тому
I never used classic
@stefanboicu
@stefanboicu 4 роки тому
Andreas Spiess thank you. I cand detect the esp32 on android and laptop but on ios/iphone i cannot, i am not sure what I am doing wrong
@jamisusijarvi646
@jamisusijarvi646 6 років тому
And yes, now i do get navigation info from Android/iPhone to ESP32 from Komoot (distance to next turn, where to turn and road name). But that Komoot is not very good software. Any info of better ones that sends info thru BLE?
@jamisusijarvi646
@jamisusijarvi646 6 років тому
github.com/komoot/BLEConnect
@AndreasSpiess
@AndreasSpiess 6 років тому
I love komoot because it is quite precise with telling me the road quality also in other countries. What would be the goal of such a project?
@jamisusijarvi646
@jamisusijarvi646 6 років тому
To get navigation information from phone to motorcycle display (i have talked about this project with Onno Dirkzwager because plan is to use also iotappstory in this project). I think i have to work more with Kamoot. At least roads at my neighborhood are partly missing, but Kamoot is using OpenStreetMap so i can make that better.
@muneebtempacc1412
@muneebtempacc1412 Рік тому
Hi anyone pls help me with the code... Am working on a project, my esp 32 should work as beacon scanner, once it scanned and found Beacon A nearby then turn on its led and keep it on until the Beacon A is lost from its scanning results....as soon as the Beacon A is lost turm of Led immediately.
@AndreasSpiess
@AndreasSpiess Рік тому
If a BLE device is connected to another device (Smartphone, watch) it stops to send advertising signals.
@MrBurakko
@MrBurakko 2 роки тому
Great tutorial. I have a problem. I want to connect to a car that is steering BLE. Using uRF i can see 4 servises. But ESP32 only see one that i can connect to. How to connect to another UUID? If you want to help, enter your e-mail and I will send you a more detailed description with photo. THX
@AndreasSpiess
@AndreasSpiess 2 роки тому
UKposts is only my hobby and, unfortunately, I have no time for consulting :-(
@MrBurakko
@MrBurakko 2 роки тому
@@AndreasSpiess 😢😭
@zam_ii
@zam_ii 6 років тому
Can you advise purpose or meaning of below code? // If we are connected to a peer BLE Server, update the characteristic each time we are reached // with the current time since boot. if (connected) { if (onoff) { Serial.println("Notifications turned on"); pRemoteCharacteristic->getDescriptor(BLEUUID((uint16_t)0x2902))->writeValue((uint8_t*)notificationOn, 2, true); } else { Serial.println("Notifications turned off"); pRemoteCharacteristic->getDescriptor(BLEUUID((uint16_t)0x2902))->writeValue((uint8_t*)notificationOff, 2, true); } onoff = onoff ? 0 : 1; }
@AndreasSpiess
@AndreasSpiess 6 років тому
Maybe you ask this question on Github (BLE library, nkolban). He is the creator and knows much more about his code than me.
@user-sk6ku3sx3g
@user-sk6ku3sx3g 6 років тому
Please help me the following error during compilation: In file included from D:\Download\ESP32_BLE_UART_Demo\ESP32_BLE_UART_Demo.ino:22:0: C:\Users\user\Documents\Arduino\libraries\ESP32_BLE_Arduino-master\src/BLEDevice.h:16:20: fatal error: esp_bt.h: No such file or directory compilation terminated. I am using Sparkfun ESP32 thing.
@AndreasSpiess
@AndreasSpiess 6 років тому
I have no idea. But maybe you re-install the ESP32 support. Something seems to be wrong with it.
@user-sk6ku3sx3g
@user-sk6ku3sx3g 6 років тому
Thank you for your reply. Yes, it turns out wrong ESP32-BLE library from Git-Hub. Please guide to everybody there is ESP32-BLE-Arduino library. I enjoy your video..
@algre977
@algre977 3 роки тому
What's the current consumption like ?
@AndreasSpiess
@AndreasSpiess 3 роки тому
It is a standard ESP32 which consumes around 80mA.
@janaruch8565
@janaruch8565 2 місяці тому
I would like to read Garmin Sensors (Speed, Cadence and Heartrate) with an ESP32 and display them on a TFT or OLED display. Does anyone know if it's is possible and if it is how do I do it?
@AndreasSpiess
@AndreasSpiess 2 місяці тому
Search for garmin and esp32
@luisbangueses
@luisbangueses 2 роки тому
Any code to transmit audio to a BT speaker?
@AndreasSpiess
@AndreasSpiess 2 роки тому
I never tried it.
@luisbangueses
@luisbangueses 2 роки тому
@@AndreasSpiess May be it's not easy....
@slientpower_3661
@slientpower_3661 6 років тому
I need vedios on how to install library esp32 on ardunio die plz help me
@AndreasSpiess
@AndreasSpiess 6 років тому
There are a few videos around. just google.
@0805bryan
@0805bryan 5 років тому
how to disconnect bluetooth from esp32?
@AndreasSpiess
@AndreasSpiess 5 років тому
I do not know
@MaxGoddur
@MaxGoddur 6 років тому
Not sure if you entertain this type request on your channel if you prefer requests of this type are not made then please disregard this post. In need of a detailed video walking, no crawling, through the steps for several items related to the NodeMCU ESP8266. How to see what is loaded in the memory of the device. How to erase the contents of the memory. How to load different firmware, for example, MicorPython then back again to ESP8266 original firmware. List the tools for best carry out the listed items above. Discuss NodeMCU memory amounts used and why. Have seen discussion on 1Meg and 4Meg but not sure how they are implemented. Lastly, if you can dumb it down I am a hobbyist and started my journey down using IOTs a few months back and need all the hand holding I can get.
@AndreasSpiess
@AndreasSpiess 6 років тому
How to see what is loaded in the memory of the device. You cannot see it. You have to know what you loaded into the memory. Maybe there is a possibility to extract the low level code, but this is not very readable for humans How to erase the contents of the memory For sure there are functions to erase flash memory. But I do not know them. However, this is usually done by the programmer itself before it uploads the new code. How to load different firmware, for example, MicorPython then back again to ESP8266 original firmware. As soon as you load something on the ESP8266 all flash memory is erased. So you can switch firmware just by loading a new one on the device List the tools for best carry out the listed items above. I use the Arduino IDE to do that. Micropython has its own infrastructure to work with the ESP8266. And there are more tools available. However, the Arduino IDE is best for beginners. Discuss NodeMCU memory amounts used and why. Have seen discussion on 1Meg and 4Meg but not sure how they are implemented. Most ESP8266 boards have a 4MByte Flash chip. Old ESP-01 boards have only a 1M chip. You select the chip size before compiling and uploading your code in the IDE. Lastly, if you can dumb it down I am a hobbyist and started my journey down using IOTs a few months back and need all the hand holding I can get. There are many videos around on how to get started with the ISP8266. Maybe you watch one or two of them. It is not very complicated.
@andylindsayvlog
@andylindsayvlog 6 років тому
Andreas please waive your magic wand once again and show us how to receive data via bluetooth and retransmit it via MQTT.
@AndreasSpiess
@AndreasSpiess 6 років тому
We will see...
@jan.8879
@jan.8879 3 роки тому
Hi im stuck at "- Connected to server" i waited for 5 min but nothing happens
@AndreasSpiess
@AndreasSpiess 3 роки тому
Unfortunately I cannot do remote debugging :-(
@NisseDILLIGAF
@NisseDILLIGAF 6 років тому
Hi... thanx for great videos! I'm having a little trouble... I want to send longitude and latitude in Location and Speed Characteristic 0x2A67 www.bluetooth.com/specifications/gatt/viewer?attributeXmlFile=org.bluetooth.characteristic.location_and_speed.xml How should I set up the setValue array?
@AndreasSpiess
@AndreasSpiess 6 років тому
Exactly as described in this document. But you might have to read it a few times and try. Use NRF connect to see what is sees. This will help you to correct your code. Maybe you use my fake Polar sensor sketch as a reference. Yours seems to be more complicated, though.
@NisseDILLIGAF
@NisseDILLIGAF 6 років тому
I have tied your sketch with success.. I think I'm stuck with the Characteristics.setValue.. the HeartRate Flags is 8bit, and the Location is 16bit... should I split it? byte location[xx] = { 0b00100000, 0b00000000,.. and so on.. ? All I get in NRF connect is an array of hex(?) values... Anyway... I will have a closer look at it next year... :) Happy New Year!
@AndreasSpiess
@AndreasSpiess 6 років тому
You have to understand each byte and first distinguish, which you need and which not. Then, you have to fill /decode the important ones. Takes some time but is possible. Happy New Year, too.
@deangreenhough3479
@deangreenhough3479 5 років тому
Back again
@AndreasSpiess
@AndreasSpiess 5 років тому
Today I got TPMS sensors with BLE and tought it would be easier to use them than 433 MHz. I was wrong. Messed around with BLE on the RPI. Also a mess in my opinion.
@dexterweb
@dexterweb 6 років тому
Am I the only one who gets "sketch too big to compile" ? sketch uses 106% of program storage space. I'm using a doit esp32 dev kit V1 PS: the arduino setup is working because if I compile a esp32 ble sniffer example everything works
@AndreasSpiess
@AndreasSpiess 6 років тому
So far I did not read any other comments like that if I remember right.
@dexterweb
@dexterweb 6 років тому
github.com/SensorsIot/Bluetooth-BLE-on-Arduino-IDE/issues/3 Looks like it is a config issue with the esp32/arduino library at least on windows. Modifying the boards.txt file removed the issue, still I'm not able to get any output on the serial monitor after compiling and configuring your sketch.
@AndreasSpiess
@AndreasSpiess 6 років тому
I saw the issue too now. BLE is still under heavy development for the Arduino IDE...
@DaveMody
@DaveMody 4 роки тому
I'm wondering if anyone has built a multiplexer? ... Take one heart rate monitor signal and serve it out to multiple simultaneous devices.
@AndreasSpiess
@AndreasSpiess 4 роки тому
AFAIK you can receife these messages as often as you want. As long as the Oximeter is not connected it sends these messages to everybody
@legoscratch
@legoscratch 6 років тому
Esp32 smartwatch?
@luchoescobar
@luchoescobar 6 років тому
legoscratch i like to see that too
@AndreasSpiess
@AndreasSpiess 6 років тому
With an e-ink display maybe...
@SiddyYT
@SiddyYT 6 років тому
First of all: I'm a big fan of all your videos!! Your recent videos inspired me to play around with ESP32 and the Xiaomi Mi plant sensor and it works like a charm! Check github.com/sidddy/flora if you're interested in an ESP32-based Xiaomi Mi plant sensor BLE client, pushing the measurements to an MQTT server. So, also a big thanks to you from my "guinea-pig-plant" for the much improved supply of water and fertilizer! ;-)
@AndreasSpiess
@AndreasSpiess 6 років тому
Thank you for the link. I will try it over the Christmas days.
BLE with ESP32 tutorial part 1: the Server
25:23
MoThunderz
Переглядів 68 тис.
Commercial Smartwatch VS DIY Heart Rate Monitor
8:28
GreatScott!
Переглядів 196 тис.
"Поховали поруч": у Луцьку попрощались із ДВОМА Героями 🕯🥀 #герої #втрати
00:15
Телеканал Конкурент TV - новини Луцька та Волині
Переглядів 97 тис.
Что будет с кроссовком?
00:35
Аришнев
Переглядів 1,2 млн
Спектакль для окупантів та ждунів 🤯
00:47
Радіо Байрактар
Переглядів 509 тис.
#173 ESP32 Bluetooth BLE with  Arduino IDE (Tutorial) and Polar H7
15:55
Andreas Spiess
Переглядів 170 тис.
461 The Tools and Organizers I Use (with some tricks)
15:32
Andreas Spiess
Переглядів 81 тис.
We should use this amazing mechanism that's inside a grasshopper leg
19:19
Master BLE Basics in Just 10 Minutes: The Ultimate Guide!
9:15
Novel Bits
Переглядів 86 тис.
Add USB To Your Electronics Projects! - The USB Protocol Explained
15:19
10 заповедей по пайке. Учимся паять
12:05
#363 Which ESP32 pins are safe to use?
11:53
Andreas Spiess
Переглядів 124 тис.
PlatformIO: All you need to know in 10 Minutes!
10:56
J's e-shack
Переглядів 277 тис.
All New Atlas | Boston Dynamics
0:40
Boston Dynamics
Переглядів 5 млн
Как должен стоять ПК?
1:00
CompShop Shorts
Переглядів 591 тис.
I7 2600K тест в играх и сравнение с AMD Ryzen
17:53
Cách sửa này được không các bạn?
1:00
Cơ Khí Toàn Nghĩa
Переглядів 841 тис.