-
Notifications
You must be signed in to change notification settings - Fork 382
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
esp32 crashes in begin() call #40
Comments
I think, the ble keyboard uses 130kb of ram, can this be true? Serial.printf("RAM left %d\n", esp_get_free_heap_size());
bleKeyboard.begin();
delay(1000);
Serial.printf("RAM left %d\n", esp_get_free_heap_size()); yields
is there a way to reduce this? |
I'm actually not sure why it is so big in size. Maybe there is some sort of memory leak in my code or the issue is actually the underlying BLE libraries. It would be nice to see how RAM usage compares. |
@fabsenet Him, did you ever figure this out? I have the same experience when combining this library with others (IRRemote. PubSubCLient, ArduinoJson). I don't think this is a memory issue, rather there is a hidden interrupt somewhere in this library. @T-vK , do you have some interrupts in these libraries? The panic I receive points to this Guru Meditation Error: Core 1 panic'ed (Cache disabled but cached memory region accessed) This points to an interrupt issue: |
I've used the BleKeyboard with a few projects without issue but my latest one has also run into a problem related to what @TheStigh was saying, where my program cant even seem to get analog reads from a couple of pins after calling After calling |
@jason-kong, if it doesn't crash/panic, I don't think it is interrupt issues, perhaps the pins are overrun somehow? For me, the solution was to discard the custom IRRemote library and use the official one. Now it runs smoothly. |
Hello, i'm using BLECombo library derived from your library and i have the same issue, around 130kb ram used after begin(); |
I think #53 might help reduce RAM usage. |
Hi @T-vK thanks for your fast reply. |
I'm not sure if the RAM usage can be further reduced. I don't really know to figure out where it is coming from. It could be the BLE libraries, it could be the HID libraries, ... but it could also be that I'm just using them wrong. |
Hi! This patch allowed me to run the keyboard beside to esphome's WiFi and OTA. Might be related to T-vK#40 Please, consider applying. TIA
#111 vastly reduces memory consumption. Also if you add We still need people with Mac OS and iOS devices to test it before we can create an official release. |
Hi,
I try to build a ble keyboard which is controlled via a webserver over wifi.
I had your sample script running and controlling the ble keyboard via serial.
Also I had a webserver running and sending commands via web sockets.
Combining both is where I fail.
Whenever I call
blekeyboard.begin()
, it crashes, when it leaves the setup() method. I decoded the stack trace:it feels to me like the ram is full, because
new
fails, but the build process shows only 11.3% used.platform.io ini file:
relevant part of my main.cpp:
and a sample serial log:
notice the spaces in the backtrace? seems wrong to me.
I do not know where I should continue at all with this.
The text was updated successfully, but these errors were encountered: