Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Bluetooth classic stops working after running .begin() #32

Closed
alex1115alex opened this issue Mar 31, 2022 · 4 comments
Closed

Bluetooth classic stops working after running .begin() #32

alex1115alex opened this issue Mar 31, 2022 · 4 comments

Comments

@alex1115alex
Copy link

I'm trying to use Bluetooth (classic, not BLE) and display composite video at the same time, but it seems as if Bluetooth stops working once the video output starts.

Has anyone run into a similar issue? If so, how did you work around this limitation?

@Roger-random
Copy link
Owner

Have you looked at ESP_8_BIT's Bluetooth classic input device support? Since ESP_8_BIT had such support, there should be no fundamental reason preventing Bluetooth from working here.

This library extracted only the color composite video generation code from ESP_8_BIT, stripping out everything else. If a project requires Bluetooth, perhaps one of these two approaches would work:

  1. Fork this project and add ESP_8_BIT Bluetooth back in.
  2. Fork ESP_8_BIT and keep color composite and Bluetooth, strip out the rest.

@alex1115alex
Copy link
Author

alex1115alex commented Apr 4, 2022

Sorry about the late response. I also found a solution, so feel free to close the issue:

I couldn't get it running on my HiLetGo ESP32, so I tried it on the TinyPICO which has more memory (Chip is ESP32-PICO-D4 (revision 1)). I also freed up the memory pertaining to BLE which seemed to do the trick. Code:

#include "BluetoothSerial.h"
#include <BLEDevice.h>
#include <BLEUtils.h>
#include <BLEServer.h>
#include "esp_bt.h"
#include "esp32-hal-bt.h"

btStarted();
esp_bt_controller_mem_release(ESP_BT_MODE_BLE);
esp_bt_controller_config_t bt_cfg = BT_CONTROLLER_INIT_CONFIG_DEFAULT();
bt_cfg.mode = ESP_BT_MODE_CLASSIC_BT;
esp_bt_controller_init(&bt_cfg);
esp_bt_controller_enable(ESP_BT_MODE_CLASSIC_BT);
SerialBT.begin("ESP32test"); //start bluetooth
videoOut.begin(); //start video

@Roger-random
Copy link
Owner

Thank you for letting us know. I'll add "ESP32-PICO-D4 (revision 1)" to the list of ESP32 chips known to work with this library.

@normen
Copy link

normen commented Sep 27, 2023

Can confirm the above workaround for disabling BLE is needed on the ESP32-NodeMCU v1 as well.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants