micropython / micropython-esp32

Old port of MicroPython to the ESP32 -- new port is at https://github.com/micropython/micropython
MIT License
678 stars 218 forks source link

Initial BLE implementation #73

Closed danicampora closed 5 years ago

danicampora commented 7 years ago

Mostly copied from: https://github.com/pycom/pycom-micropython-sigfox

The API is described here: https://docs.pycom.io/pycom_esp32/library/network.Bluetooth.html

At the moment the board crashes immediately at boot-up inside heap_alloc_caps_init(). I'm still trying to figure out what's the reason of the crash, but I could use some help if anyone here wants to try this patch and help investigate.

danicampora commented 7 years ago

Comments and feedback at every level are more than welcome.

dpgeorge commented 7 years ago

At the moment the board crashes immediately at boot-up inside heap_alloc_caps_init()

You'll probably need to decrease the uPy heap, try something like 32k to start with and if it works then you know that's the problem.

danicampora commented 7 years ago

@dpgeorge thanks, I already tried that and it didn't help. I also tried allocating the MP heap dynamically (that's what we do in our repo), but no difference either. I'm sure I'm missing something really obvious so that's what I thought it'd be good to submit the PR and let others take a look :-)

dpgeorge commented 7 years ago

I reduced the uPy heap to 16k, and didn't update the ESP IDF (ie I didn't include your last commit), and it booted ok. But doing network.Bluetooth() leads to a crash: E (30502) BT: Startup BTU

danicampora commented 7 years ago

@dpgeorge ok I'll try that, thanks!

rmokerone commented 7 years ago

@danicampora I compiled successfully. But I can not enter the REPL when I'm testing on the ESP-WROOM-32 development board. The results are shown below.

2017-04-20 10 30 59
danicampora commented 7 years ago

I compiled successfully. But I can not enter the REPL when I'm testing on the ESP-WROOM-32 development board.

I know :-), that's why I meant with:

At the moment the board crashes immediately at boot-up inside heap_alloc_caps_init()

I tried @dpgeorge suggestion of lowering the RAM to 16K, but it didn't help with the latest IDF.

dpgeorge commented 7 years ago

There were lots of changes recently in the ESP IDF so it was a non-trivial upgrade, but it's now done in 67d141cb95d0ff57300d07e6f966ef469a4bbcae.

@danicampora you may want to remove from this PR the commit that updates the IDF, decrease heap size and try again.

danicampora commented 7 years ago

Thanks @dpgeorge !

I pushed another commit. Now with Bluetooth linked the board boots (and the MicroPython heap is 64K), but trying to enable Bluetooth leads to the same crash: E (56743) BT: Startup BTU

BEMNETADEFIS commented 6 years ago

linux is not compactible for micropython or requies more work on plugins

BEMNETADEFIS commented 6 years ago

BLE is among them

aykevl commented 6 years ago

This repository has been merged upstream, see #233.

For Bluetooth, take a look here: https://github.com/micropython/micropython/issues/3809#issuecomment-407469624 (I should probably make a real PR out of that).

BEMNETADEFIS commented 6 years ago

the micropython programming is validate in LIUNX enviroment does any one tests it best regards bemnet adefris

On Mon, Aug 27, 2018 at 3:19 PM Ayke notifications@github.com wrote:

This repository has been merged upstream, see #233 https://github.com/micropython/micropython-esp32/issues/233.

For Bluetooth, take a look here: micropython/micropython#3809 (comment) https://github.com/micropython/micropython/issues/3809#issuecomment-407469624 (I should probably make a real PR out of that).

— You are receiving this because you commented. Reply to this email directly, view it on GitHub https://github.com/micropython/micropython-esp32/pull/73#issuecomment-416387507, or mute the thread https://github.com/notifications/unsubscribe-auth/APM4l8LyXLf40irT787PDc9NsOfX1gazks5uVHBlgaJpZM4NCjx2 .

aitjcize commented 5 years ago

Is anyone still working on this?

dpgeorge commented 5 years ago

BLE support for esp32 is being implemented upstream via the following PR: https://github.com/micropython/micropython/pull/5051