Project lvgl + wifi softAP +ble client server

Olfox59
Posts: 23
Joined: Tue May 02, 2017 12:36 pm

Project lvgl + wifi softAP +ble client server

Postby Olfox59 » Sun Sep 29, 2024 7:32 pm

Hi,

I'm developping a project that requires to connect with ble on two sensors, manage a display, and when needed, start a softAp for file transfert on microSD.

Ble client and server coexist fine.
My display too.

I'm at the step tonintegrate the softAp example code into my project and i meet issue to properly alternate between ble and wifi soft ap as both can not coexist properly according to documentation

I have two free rtos tasks:
-Gui (lvgl for the display) running on core 1
-Ble running on core 0, and wifi soft ap into the same tasks.

Program start with running ble client and server.
When I need to upload files on sd card, i connect my smartphone via ble, write a string into a characteristic. A variable is set and this variable is checked into the while() loop of the ble task.
If true, ble is switch off by calling 4 functions to deinit /disable the bluedroid stack and ble stack as required out of the ble callback . Then, wifi soft ap is init and file server is started.

It works, but lwip seems to not start and any ipv4 is printed in the console like i have when i run the light files serving example.

When i don't init the ble gatts gattc I can properly connect to my wifi file serving.

It seems i'm a little bit limit on ram too (overflowed iram 112 percent).

Do you think that my code is properly organised ? Should i use two separate tasks for ble and wifi soft ap and start wifi soft ap task via ble task and stop ble in the wifi task for example ?

Thanks for your help !

chegewara
Posts: 2364
Joined: Wed Jun 14, 2017 9:00 pm

Re: Project lvgl + wifi softAP +ble client server

Postby chegewara » Sun Sep 29, 2024 8:16 pm

Im not sure what documentation you are referring to, but you can use ble and wifi at the same time.

Just in case you have problems with memory shortage, not iram related you mentioned, you should consider to use nimble stack.

Olfox59
Posts: 23
Joined: Tue May 02, 2017 12:36 pm

Re: Project lvgl + wifi softAP +ble client server

Postby Olfox59 » Mon Sep 30, 2024 6:54 am

Hi, thanks a lot for your reply,

Ciexistence is mentionned as C1 in the table of the esp-idf documentation, what means :"unstable".

As i just need wifi not do often, i prefer to have only ble to improve ble performance and have my two sensors connected at the same times.

What nimble can bring compare to bluedroid ? I have read that it just support ble and not blutooth classic, it should explain why it is lighter.

Hiw deep the changes from bludroid to nimble ? Is it just just in menuconfig ?

Does function name similar ? Thanks a lot ;)

chegewara
Posts: 2364
Joined: Wed Jun 14, 2017 9:00 pm

Re: Project lvgl + wifi softAP +ble client server

Postby chegewara » Tue Oct 01, 2024 4:14 am

I believe that nimble API is completely different than bluedroid.

Who is online

Users browsing this forum: Majestic-12 [Bot] and 79 guests