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
ESP32: Adding Bluetooth support #1208
Comments
Ok, so you want someone else to add bluetooth for you - but you can't be bothered to write a description or even to spell the title correctly? Nice. :( |
@gfwilliams , sorry for my mistake. |
Hello @gfwilliams. Could you tell me what's is involved in developing support for Bluetooth and BLE for the ESP32? Then I could try and do that myself and contribute back to the project? Thanks! |
There are a lot problems, getting Bluetooth/BLE running for Espruino on
ESP32.
With Classic Bluetooth you cannot even start Espruino anymore, lack of heap
during start.
With BLE, size of binary becomes very big, first test was about 500kb more
and binary arrived at >1300kb
Actually I'm testing standard Espruino and add Gatts Server example.
Since this is my hobby, don't expect results soon.
2017-10-01 12:47 GMT+02:00 Henrique Recidive <notifications@github.com>:
… Hello @gfwilliams <https://github.com/gfwilliams>. Could you tell me
what's is involved in developing support for Bluetooth and BLE for the
ESP32? Then I could try and do that myself and contribute back to the
project?
Thanks!
—
You are receiving this because you are subscribed to this thread.
Reply to this email directly, view it on GitHub
<#1208 (comment)>,
or mute the thread
<https://github.com/notifications/unsubscribe-auth/AB-GnpkeqgTXW_kHnvhi-joh37UAqmBtks5sn23BgaJpZM4Opa8y>
.
|
Thanks @jumjum123 - I think you know more about this than me. The first step would definitely be getting EspressIF's BLE examples compiled in like you're doing. After that, it'd be a job of trying to get |
@gfwilliams - first of all I tried to get the ESP example for BLE server running in Espruino. This is working now with a lot of restrictions. Restrictions like reducing available jsvars down to 2000.
|
Hi, it's great that you have it going - a bit sad that it takes so much RAM though :( Do you have a link to your code available somewhere? I'm really against coming up with a brand new API for BLE though - I want to avoid the problem we have for internet stuff where we have a bunch of subtly different APIs for Ethernet, WiFi, WiFi on ESP8266, and GSM. Very little in the existing NRF class is actually specifically for Nordic chips. I totally understand why you'd want your own API for testing to avoid having to (Renaming the existing NRF class to BLE is something we could easily do at any point though) It feels like given what you have implemented you've proved that it'll work, and 2k vars is still pretty reasonable - so in a way it makes more sense to now try and work on code on top of the NRF API, as at some point soon you'll end up spending a lot of time reimplementing code that already exists and is tested in the nRF5x port. |
Me, as @recidive, am too interested of contributing my own time in getting this to work. if @jumjum123 can share his work maybe we could use it as a starting point |
Take a look to github targets/ESP32/docs in branch ESP32. There is a new folder with all changes created during my testing. |
@gfwilliams I took a closer look to Bluetooth classes in Espruino. NRF class is different from that, but as name says, this is strongly nrf oriented Porting Bluetooth to Espruino is my way to get a better understanding of BLE. |
Espruino supports both as a peripheral (NRF.setAdvertising/setServices) and as a central, in exactly the same form as the Web Bluetooth group (NRF.requestDevice/connect, then BluetoothDevice, and BluetoothRemote*). It'd be worth looking at all the existing Puck.js tutorials to see what it's like using Bluetooth: http://www.espruino.com/Puck.js#tutorials But using BLE as a service, literally all you need is to implement 3 functions - NRF.setServices, setAdvertising, and updateServices. I understand that this is just a fun way to learn BLE, and that's great - obviously you're free to do whatever you want. However I'm not going to merge in any code that uses a totally different API for Bluetooth - it's just going to be a nightmare to support. I mean, we have a whole bunch of tutorials, modules, and code in EspruinoDocs showing people how to use BLE. If you come up with a different API then that's all of no use - and worse, it'll actually confuse anyone trying to use BLE on Espruino. |
Fully understand, it would be a nightmare to support ESP32 specific Bluetooth and NRF specific Bluetooth and xyz specific .... Naming my testing class BLE is nothing which should survive, its a working name nothing more. On the other hand, its a bit confusing to have a wrapper named NRF.... for hardware from somewhere else. To avoid problems with existing software/docu/etc may be, we could start with an additional wrapper. I will try to create an example for that, since an example often tells more than my wording ;-) |
Hey guys. If BLE is a challenge on ESP32, what other platforms does it work well on (other than the puck which is awesome). I want to settle on Espruino as a platform and would like to have a cheap little companion device similar to an ESP32 or 8266 based thing.. what else is out there? |
You want something that's more of a bare PCB? If so there'll be an Espruino device coming pretty soon like that |
For ESP32, we are (still) waiting for next release of ESP-IDF. |
We're playing a lot with beacons at the moment... they actually have a lot of interesting and practical uses. We're testing a lot of simple devices with basic or minimal sensors, or just the BLE itself. |
Ble support on the esp32 has just been merged into the master branch! Yay! |
Maybe the docs should be updated, to reflect this merge @ https://www.espruino.com/ESP32 -> Bluetooth :) And how https://www.espruino.com/BLE+Communications suits this change. |
Yes definitely, there is an open issue list about missing documentation, have a look #1770 and feel free to contribute. |
Can we use WiFi and Bluetooth at the same time? Eg. scan for beacons and send the result on WiFi to somewhere? |
Yes |
Hello,
I'm working with ESP32 and i went to use internal BLE of esp32 instead of connecting an external module.
The text was updated successfully, but these errors were encountered: