nodemcu / nodemcu-firmware

Lua based interactive firmware for ESP8266, ESP8285 and ESP32
https://nodemcu.readthedocs.io
MIT License
7.68k stars 3.13k forks source link

Use ESP32's built-in Bluetooth interface + wired UART at the same time? #2737

Closed Alfrederson closed 5 years ago

Alfrederson commented 5 years ago

I'm looking through this https://github.com/nodemcu/nodemcu-firmware/blob/dev-esp32/components/base_nodemcu/user_main.c file and it seems to me that the function that initializes the UART for usage through a usb-serial chip (for example) is this console_init(). Now, would it be absurde to assume I could sneak in a function to initialize the built-in bluetooth interface as well, so that one could send commands via a bluetooth-serial application from an android phone?

For anyone who knows ESP32's api in depth, is there such a thing as a way to setup an interrupt handler for bluetooth events (connection, disconnection, data receive) like there is one for wired uart?

EDIT: I've been reading and it is totally possible, I just need to understand both NodeMCU's serial "architecture" and how the BluetoothSerial library for Arduino works

devsaurus commented 5 years ago

See #1010.