Current state of BLE?
Current state of BLE?
Hello, last time I tried working with BLE on the ESP32 a couple of months back, it was very broken - I think due to a knock on effect of changes to the ESP-IDF. Can anyone update me on how things are right now? Google is producing very little since 2017
I have this crazy idea about ble sync between a cheap fitness band and ESP32 with neopixels attached - mood lighting influenced by human heart rate/sleep
I have this crazy idea about ble sync between a cheap fitness band and ESP32 with neopixels attached - mood lighting influenced by human heart rate/sleep
Grow something!
Re: Current state of BLE?
Heya ARTaylor,
Ayke van Laethem, Eric Poulsen and Glenn Bakke started collaborating some time ago to push forward the Bluetooth API. You may be aware that Glenn and Eric have both previously made attempts to implement a Bluetooth API (for the NRF and ESP32 respectively) but both were not quire ready for prime time. About a month ago Ayke had a very simple (advertising only) fork working that allowed the following code to operate for NRF and ESP32:
There is a channel (#bluetooth-le) in the MicroPython Slack (auto invite) where those folks have been discussing the implementation, though it's been quiet lately.
There's also #3809: esp32: Implementation of bluetooth? that covers some of this.
In the meantime, Damien has announced the Pyboard D-Series. PYBD has Bluetooth. There was an extended 'Hallway track' discussion at PyCon AU where the MicroPython Bluetooth interface was discussed; I can assure you Damien is very keen to implement this soon! I believe he's also reached out to Ayke, Glenn and Eric to compare notes.
So, no, we don't have Bluetooth for MicroPython yet. But watch this space! And please join in if you're able to collaborate.
Cheers,
Matt
Ayke van Laethem, Eric Poulsen and Glenn Bakke started collaborating some time ago to push forward the Bluetooth API. You may be aware that Glenn and Eric have both previously made attempts to implement a Bluetooth API (for the NRF and ESP32 respectively) but both were not quire ready for prime time. About a month ago Ayke had a very simple (advertising only) fork working that allowed the following code to operate for NRF and ESP32:
Code: Select all
import bluetooth
bt = bluetooth.Bluetooth()
bt.active(True)
bt.advertise(100, 'hello MicroPython!')
There's also #3809: esp32: Implementation of bluetooth? that covers some of this.
In the meantime, Damien has announced the Pyboard D-Series. PYBD has Bluetooth. There was an extended 'Hallway track' discussion at PyCon AU where the MicroPython Bluetooth interface was discussed; I can assure you Damien is very keen to implement this soon! I believe he's also reached out to Ayke, Glenn and Eric to compare notes.
So, no, we don't have Bluetooth for MicroPython yet. But watch this space! And please join in if you're able to collaborate.
Cheers,
Matt
Re: Current state of BLE?
Hi,
I don't understand something. Maybe I'm wrong but I thought Wipy uses MicroPython, and with Wipy you have bluetooth support (in Python).
So how is this possible ?
Regards
I don't understand something. Maybe I'm wrong but I thought Wipy uses MicroPython, and with Wipy you have bluetooth support (in Python).
So how is this possible ?
Regards
Re: Current state of BLE?
There are three versions of WiPy.
WiPy1 is based on a CC3200 controller and supports WiFi only. The Support for this product is in this forum.
WiPy2 and WiPy3 are based on the ESP32. They are products of Pycom and are supported in their forum at forum.pycom.io. The Pycom variant of micropython supports both WiFi and Bluetooth. If you have either an ESP32 with a Rev0 chip or an ESP32 with Rev1 chip SPIRAM, you can install the Pycom Firmware for WiPy.
WiPy1 is based on a CC3200 controller and supports WiFi only. The Support for this product is in this forum.
WiPy2 and WiPy3 are based on the ESP32. They are products of Pycom and are supported in their forum at forum.pycom.io. The Pycom variant of micropython supports both WiFi and Bluetooth. If you have either an ESP32 with a Rev0 chip or an ESP32 with Rev1 chip SPIRAM, you can install the Pycom Firmware for WiPy.
Re: Current state of BLE?
Ok thanks, I didn't knew Pycom made a custom version of MicroPython.
I will join the slack to see if I could help maybe. Since Pycom successfully added BLE support, it should be doable to replicate it.
I will join the slack to see if I could help maybe. Since Pycom successfully added BLE support, it should be doable to replicate it.
Re: Current state of BLE?
Pycom puts software made by themselves under GNU GPL, wheres micropython.org is using the MIT License and does not accept software under a different license. You can do that for your own purpose, but it will not be accepted for merging.
Re: Current state of BLE?
*********Only to update this post**********
I have just downloaded the latest firmware built with ESP-IDF v4.x that comes with BLE support. (esp32-idf4-20200111-v1.12-45-gbfbd94401.bin) from (http://micropython.org/download#esp32)
I tested both the temperature peripheral and central examples that are available here: https://github.com/micropython/micropyt ... /bluetooth.
I downloaded ble_advertising.py and ble_temperature.py to a board and ble_advertising.py and ble_temperature_central.py to the other.
On the first one I run to start advertising the fake temp values:
And on the second one I run the following to start scanning and reading:
Great Example!
They worked properly on ESP32!
I have just downloaded the latest firmware built with ESP-IDF v4.x that comes with BLE support. (esp32-idf4-20200111-v1.12-45-gbfbd94401.bin) from (http://micropython.org/download#esp32)
I tested both the temperature peripheral and central examples that are available here: https://github.com/micropython/micropyt ... /bluetooth.
I downloaded ble_advertising.py and ble_temperature.py to a board and ble_advertising.py and ble_temperature_central.py to the other.
On the first one I run to start advertising the fake temp values:
Code: Select all
import ble_temperature
ble_temperature.demo()
Code: Select all
import ble_temperature_central
ble_temperature_central.demo()
They worked properly on ESP32!
-
- Posts: 17
- Joined: Wed Jun 19, 2019 8:17 pm
Re: Current state of BLE?
Hi,
I am very interested in getting a MicroPyhon BLE on the ESP32 so I can develop a stand alone iPhone app to connect the ESP32 to an iPhone app I'm developing. I suppose I could use the WIFI, but we require very low power utilization for our app. So WIFI is really not an option.
Can someone please send me info in how I can get this MicroPython support for BLE. Is there a GitHub repo on this? and I have some pretty smart coders who can roll up their sleeves and contribute to this project. I see some good progress is being made, as I'm actually seeing Python code. So there must be a Bluetooth Python import module somewhere....
My associate has been following this development effort and it seems to be somewhat dragging along, so I'm hoping I can bring in new talent to help push this along. I know at least 3 other major iPhone developers wanting this BLE Python Library working on the ESP32. And right now, I'm just querying on the status of the creation of this library, and seeing what I can do to help.
I'm not much of a coder myself, but I do have access to a development team and some students at "Open Source University" who are very sharp and smart, and eager to help out. And as a project manager, I would be honored to head this project.
Thanx Guys,
Keep up the good work
John D
I am very interested in getting a MicroPyhon BLE on the ESP32 so I can develop a stand alone iPhone app to connect the ESP32 to an iPhone app I'm developing. I suppose I could use the WIFI, but we require very low power utilization for our app. So WIFI is really not an option.
Can someone please send me info in how I can get this MicroPython support for BLE. Is there a GitHub repo on this? and I have some pretty smart coders who can roll up their sleeves and contribute to this project. I see some good progress is being made, as I'm actually seeing Python code. So there must be a Bluetooth Python import module somewhere....
My associate has been following this development effort and it seems to be somewhat dragging along, so I'm hoping I can bring in new talent to help push this along. I know at least 3 other major iPhone developers wanting this BLE Python Library working on the ESP32. And right now, I'm just querying on the status of the creation of this library, and seeing what I can do to help.
I'm not much of a coder myself, but I do have access to a development team and some students at "Open Source University" who are very sharp and smart, and eager to help out. And as a project manager, I would be honored to head this project.
Thanx Guys,
Keep up the good work
John D
Re: Current state of BLE?
For ESP32, STM32, and Linux/Mac the "ubluetooth" module covers most BLE functionality. Currently the main limitations are lack of support for pairing & bonding, and management of low power states. But other than that, the four main roles (observer, broadcaster, central, peripheral) are implemented.jdcrunchman wrote: ↑Mon Jul 20, 2020 1:41 amCan someone please send me info in how I can get this MicroPython support for BLE. Is there a GitHub repo on this? and I have some pretty smart coders who can roll up their sleeves and contribute to this project. I see some good progress is being made, as I'm actually seeing Python code. So there must be a Bluetooth Python import module somewhere....
Docs here: https://docs.micropython.org/en/latest/ ... tooth.html
Examples here: https://github.com/micropython/micropyt ... /bluetooth
The other area for improvement for MicroPython BLE is an "async" version of the API. That doesn't affect the functionality, but an async API would be much easier to use. That's currently blocked on the work related to https://github.com/micropython/micropython/pull/6125