Status of Bluetooth for ESP32 #7148
Replies: 1 comment
-
Posted at 2017-10-04 by Wilberforce Hi @jumjum So, perhaps start a new branch esp32-ble and put the espruino changes under that, and also a new branch under espruino build tools with the same name, that will capture the partition changes and sdkconfig changes. I can get this all working with Travis if you like - then if we want to return to this point, or someone else want to pick up the gauntlet, we have a starting point. I think the bluedroid libraries might be quite large - but at the end of the day there is plenty of flash, it's the ram there the issue. It would be great to get it working, as a ble to wifi bridge would be awesome. Contact me on gitter if you would like some help. Posted at 2017-10-26 by JumJum Actual status of my work for Bluetooth is here https://github.com/espruino/Espruino/tree/ESP32/targets/esp32/docs/Bluetooth_first_attempt Posted at 2017-11-01 by JumJum Just tested mem release function for BLE and got about 30k back. BTW, after some chatting with Gordon, I'll try to come closer to already existing Bluetooth in Espruino (for Puck.js). World is different between nrf and esp-idf, so this will take some time. Posted at 2018-01-20 by dashxdr I was able to get the ESP32 branch of Espruino to build with functional BT but I had to modify line 45 of targets/esp32/bluetooth.c
It always fails trying to release ESP_BT_MODE_BTDM and if it returns none of the following initialization gets executed. Is there any newer version of this? It seems like a work in progress... Posted at 2018-01-21 by JumJum First of all, BLE is work in progress. From time to time changes are uploaded.
Posted at 2018-01-25 by dashxdr
This version does work. I left the ret = esp_ble_gatt_set_local_mtu(500); section in place at the end. Thanks-- Posted at 2018-02-10 by dashxdr I've abandoned Espruino, its performance is just insufficient for my application. I've switched to a duktape javascript engine. https://github.com/nkolban/duktape-esp32 Their bluetooth implementation hasn't been fleshed out. I think your work on the Espruino would translate well. Posted at 2018-03-23 by JumJum Has been a long time since last push to github, but today its done. First of all, thanks to Gordons help in SW, discussions, hints, .... …
Added:
Changes to be committed: Posted at 2018-03-23 by @allObjects gut Ding will Weile haben... congratulations! - auf die Schnelle lebt nicht lange! Posted at 2018-03-27 by @gfwilliams That's great news! Just for anyone wondering, the firmware is here: https://github.com/espruino/Espruino/tree/ESP32 This looks really good - and it'll build with the current ESP-IDF? I'm less sure about adding a totally ESP32-specific @wilberforce obviously the available memory for vars on normal boards has really dropped, but is there any reason why it'd be a bad idea to merge this? Posted at 2018-03-27 by Wilberforce Firstly, well done @jumjum, I know that is has been a mammoth task to get this far! At the moment there are dependencies that would also need to be added to the espruino build tools... for example there is a new partition.bin, however I think we can make one partition that could be used for both, as it just makes the firmware partition bigger, and we could get rid of the ota partition as that is not implemented (it's a good idea in principle but not sure about the practicality- that is a different issue). The ble libs might also need to be added, I have not yet tried to build this. If I get a chance over Easter I might be able to do a pull and see what happens. I'm not too keen on dropping the number of vars in the esp32 normal build. In a conversation I had on gitter with @jumjum I don't think it has yet been tested with the Bluetooth turned off in the Makefile. For example at the moment there are changes to main.c that could have conditional includes and some of the intialisation code could be in conditional includes. I'm not sure how much more memory the ble stack uses, and if it only uses the memory when it is turned on. If that was the case we could have a run time switch to turn in on just one build. Gordon, what is the best way to handle this - have two board files - one with wifi and one with wifi and ble? Is there another board that handles things like this that way? I know for the esp8266 there are two builds, one for the 4mb flash, the other for 512. Posted at 2018-03-27 by Wilberforce It doesn't look like Travis has run against the build - I think that happens when a pull request occurs. I think it will break because the dependencies will need to be updated in the build tools. Might need to do an esp32-ble branch there to check against. @jumjum - I see the sdk config changes - is this for ESP-idf 2.1 still? Posted at 2018-03-27 by Wilberforce I've pulled the ESP32 and attempted a compile. It errors out with:
So it looks like a new tool chain is required. @jumjum Are you using ESP-IDF Pre-release 3.0-rc1 ? Shall I start an issue on git hub so we can continue this conversation there? Posted at 2018-03-28 by @gfwilliams Yes, it's probably better to chat about this on GitHub. If we're going to have a build with Bluetooth and one without it's probably better with 2 board files. I do have 2 builds for some Espruino boards (eg. the Original with CC3000 or WIZnet support) but I'd rather not repeat it since it involves hacks in the script that creates the distribution zip. We could modify the build to include the extra parameters in the BOARD.PY file for all boards that did this, but it's not great. I'd still really advise against splitting the build up though. 2000 vars is still quite a lot (and I'm sure that can be increased again as time goes on), and I doubt many people will hit it as a limit especially with the Posted at 2018-03-28 by JumJum @wilberforce, I'm on latest on github, not on pre release. Yes, lets use github for more Posted at 2018-03-28 by JumJum Most of sdk config changes are not available in ESP 2.1 Posted at 2018-03-28 by JumJum I will not fight for OTA, its a big idea, but at the end, there are a lot of limitations. Having a lot of jsvar sizes based on used hardware is something which needs to be checked. Following some discussions around ESP8266, I would prefer to have one binary only. Otherwise a lot of confusion could appear, "which binary is running on which board ?". Posted at 2018-03-28 by JumJum Checked compiling with out Bluetooth and ran into problems. Posted at 2018-03-28 by JumJum Compiling without Bluetooth is working. Next tested with default of 3000 jsVars. Starting and some first small tests work fine. Posted at 2018-03-28 by @gfwilliams That looks great - in fact you might be able to push the vars up to 3300? 55k heap is still a lot. I'd say given the choice most people would happily drop those vars to have Bluetooth. People manage pretty well with the available memory on normal Espruino boards, which is around that. Posted at 2018-03-28 by JumJum Oh, sorry, there was a mistake on my side. Free heap is swapped. Posted at 2018-04-13 by Saurabh HI Team I am working on project which need on board wifi and Ble support do we have espruino support for the both on ESP32? Posted at 2018-04-16 by JumJum We are (still) waiting for next release of ESP-IDF. Posted at 2019-07-01 by Alfie Hello, I was looking into how to test BLE on the ESP32, but it looks like the firmware is bigger than the allowed space on the ESP32. If any of you could direct me on how to properly apply a custom partition table with the Espruino firmware I'd appreciate it. I would love to test this and update the documentation, as there is none currently. Posted at 2019-07-05 by JumJum There is a problem with actual ESP-IDF. Guys from espressif moved some functions from ROM to flash. And added functions which are not used in Espruino. Posted at 2019-07-11 by hungryforcodes These guys are a little cowboy with their IDF, huh? |
Beta Was this translation helpful? Give feedback.
-
Posted at 2017-10-03 by JumJum
I spend lot of days to get Bluetooth up and running in a very first simple step
So is time to give a first status.
To be open, I'm not sure, we will ever get it running in a nice way.
Memory consumption in binary file and in RAM is huuuuge
This is what I did in some short steps:
There is still no functionality available in Javascript, and UART is receiving data only.
Question is, should I spend more time on this, or wait for availibility of breadboards with ESP32 wrover which has additional PSRAM.
Beta Was this translation helpful? Give feedback.
All reactions