Current state of BLE?

All ESP32 boards running MicroPython.
Target audience: MicroPython users with an ESP32 board.
Post Reply
ARTaylor
Posts: 29
Joined: Fri Mar 23, 2018 4:04 pm
Contact:

Current state of BLE?

Post by ARTaylor » Thu Aug 02, 2018 8:14 am

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 :D
Grow something!

User avatar
mattyt
Posts: 295
Joined: Mon Jan 23, 2017 6:39 am

Re: Current state of BLE?

Post by mattyt » Tue Aug 28, 2018 2:59 pm

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:

Code: Select all

import bluetooth
bt = bluetooth.Bluetooth()
bt.active(True)
bt.advertise(100, 'hello MicroPython!')
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

gmli
Posts: 6
Joined: Mon Nov 26, 2018 1:07 pm

Re: Current state of BLE?

Post by gmli » Mon Nov 26, 2018 1:10 pm

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

User avatar
Roberthh
Posts: 2054
Joined: Sat May 09, 2015 4:13 pm
Location: Rhineland, Europe

Re: Current state of BLE?

Post by Roberthh » Mon Nov 26, 2018 1:43 pm

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.

gmli
Posts: 6
Joined: Mon Nov 26, 2018 1:07 pm

Re: Current state of BLE?

Post by gmli » Mon Nov 26, 2018 2:13 pm

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.

User avatar
Roberthh
Posts: 2054
Joined: Sat May 09, 2015 4:13 pm
Location: Rhineland, Europe

Re: Current state of BLE?

Post by Roberthh » Mon Nov 26, 2018 2:22 pm

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.

gmli
Posts: 6
Joined: Mon Nov 26, 2018 1:07 pm

Re: Current state of BLE?

Post by gmli » Tue Nov 27, 2018 8:45 am

Good to know thanks.

sara
Posts: 8
Joined: Thu Oct 03, 2019 12:26 pm

Re: Current state of BLE?

Post by sara » Sat Jan 11, 2020 1:33 pm

*********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:

Code: Select all

import ble_temperature
ble_temperature.demo()
And on the second one I run the following to start scanning and reading:

Code: Select all

import ble_temperature_central
ble_temperature_central.demo()
Great Example! ;)
They worked properly on ESP32! :D

jdcrunchman
Posts: 17
Joined: Wed Jun 19, 2019 8:17 pm

Re: Current state of BLE?

Post by jdcrunchman » Mon Jul 20, 2020 1:41 am

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

User avatar
jimmo
Posts: 1769
Joined: Tue Aug 08, 2017 1:57 am
Location: Sydney, Australia
Contact:

Re: Current state of BLE?

Post by jimmo » Mon Jul 20, 2020 4:07 am

jdcrunchman wrote:
Mon Jul 20, 2020 1:41 am
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....
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.

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

Post Reply