Page 1 of 2

bluetooth on esp32

Posted: Wed Jun 12, 2019 12:37 pm
by asaf
i try to show the esp32 on my android bluetooth list.
someone has example code for reading and writing to esp32 with python.
i success to do this with c on arduino :
#include "BluetoothSerial.h" //Header File for Serial Bluetooth, will be added by default into Arduino
BluetoothSerial ESP_BT; //Object for Bluetooth

void setup() {
Serial.begin(115200); //Start Serial monitor in 9600
ESP_BT.begin("ESP32_LED_Control"); //Name of your Bluetooth Signal
Serial.println("Bluetooth Device is Ready to Pair");

}

void loop() {
// put your main code here, to run repeatedly:

}

but how can i do it with python ?
Thanks

Re: bluetooth on esp32

Posted: Wed Jun 12, 2019 10:16 pm
by jimmo
Unfortunately there is not currently any support for Bluetooth Low Energy, but it is being actively worked on. See https://github.com/micropython/micropython/pull/4589 for more info

Re: bluetooth on esp32

Posted: Thu Jun 13, 2019 9:44 am
by asaf
but i got :ImportError: no module named 'bluetooth'
where can i find bluetooth class ?
Thanks

Re: bluetooth on esp32

Posted: Thu Jun 13, 2019 9:51 am
by jimmo
Are you running a build from that branch?

This work hasn't been finished yet - it's still in development, and potentially might make into MicroPython v2.0

Re: bluetooth on esp32

Posted: Thu Jun 13, 2019 10:35 am
by asaf
what do u mean build ?
i use v1.11 from here http://docs.micropython.org/en/latest/e ... ckref.html
Thanks

Re: bluetooth on esp32

Posted: Thu Jun 13, 2019 1:42 pm
by jimmo
v1.11 does not include this.

By "build" I mean that you would have compiled the firmware from source (including the changes from that PR). You can also access an older version of this from http://micropython.org/download (esp32--bluetooth.bin) but you're going to have a hard time because it's different to what's in the PR and not documented anywhere.

Re: bluetooth on esp32

Posted: Thu Sep 12, 2019 6:56 pm
by mikronauts
Any idea when BLE will be in the main line?

Re: bluetooth on esp32

Posted: Thu Sep 12, 2019 9:42 pm
by jimmo
https://github.com/micropython/micropython/pull/5051 -- PYBD any day now. ESP32 soon (although we might wait to move to ESP-IDF 4.0).

Re: bluetooth on esp32

Posted: Fri Sep 27, 2019 5:40 pm
by iotman
Hi, we are working on a BLE project and we're wondering when we will be able to write code for BLE on ESP32 boards.

Is there some way of being notified when it is ready? Will it be a separate library, or will it be built into the main download?

Tks, AB

Re: bluetooth on esp32

Posted: Sat Sep 28, 2019 3:32 am
by jimmo
See the updates on that PR. I'll address the review comments from yesterday this weekend, and then you can see the comment from me this morning about the esp32 branch.