AlessandroAU / Chorus32-ESP32LapTimer

This is an ESP32 port of the popular Chorus RF Laptimer
GNU General Public License v3.0
86 stars 33 forks source link

Wlan connection with activated Bluetooth not possible #117

Open Peschi90 opened 4 years ago

Peschi90 commented 4 years ago

Hey Guys, thanks for your project but i have one issue. because i cant connect with the app over wifi, i activated bluetooth. This works ok with the App but if i want to change something in the WIFI settings Page, the Module reboot directly after i connect to the wifi Network, closed the wifi,start it again and dont show the page. do you know something about this issue?

BR Peschi :)

Smeat commented 4 years ago

Are you using v1.0 or the current master? What else did you change in the configuration, besides activating bluetooth? I had some problems with bluetooth the last time I tested it, so you might try and disable that to see if that fixes the problem

Peschi90 commented 4 years ago

iam using the current master but flashed it over arduino Software. When i deactivate bluetooth the i can connet to the wifi and get the settings page. i get this issue only if i activate the bluetooth in the hardwareconfig.h file. i only uncommend the bluetooth part and change the board settings inisde arduino software to "huge app" the bluetooth connection is working with the app only the range is really poor.

Smeat commented 4 years ago

Then I am guessing this is the same problem I encountered (https://github.com/Smeat/Chorus32-ESP32LapTimer/issues/7) The Bluetooth stack is quite large and it seems we are running out of memory when we are using Bluetooth. Unfortunately I can't say when to expect a fix for that. For now you'll have to disable Bluetooth.

Edit: Yes, same crash: 0x401b230d: operator new[](unsigned int) at /builds/idf/crosstool-NG/.build/src/gcc-5.2.0/libstdc++-v3/libsupc++/new_opv.cc:32

With bluetooth there are about 40kb left on the heap and crashes at about 28kb left. Without bluetooth we have 160kb and drops to 100kb while loading the webpage and then going up again

Might be fixable with adding compression or modifying the webserver or bluetooth source. But we should definitely prevent crashing in this situation. All other code we have should be statically allocated, so a low heap should not affect them

Peschi90 commented 4 years ago

Memory could definetly be the problem. Sometimes if the Bluetooth connection lost because of range the chorus 32 stuck completely. I think you're right.