ESP32 Bluetooth SPP with IDF v5

Tips, Tricks and methods for programming, learn ways of making your programming life easier, and share your knowledge with others.
Post Reply
BenR
Matrix Staff
Posts: 2305
http://meble-kuchenne.info.pl
Joined: Mon Dec 07, 2020 10:06 am
Has thanked: 637 times
Been thanked: 847 times

ESP32 Bluetooth SPP with IDF v5

Post by BenR »

Hello,

It looks like some of the configuration options in the menuconfig tool have changed for IDF v5 and this is causing the Bluetooth SPP to not be able to startup.

If you go into the folder containing your Flowcode project and then go into the folder with the same name then you should find a file called menuconfig.bat.

Double click this file and then in the window that appears, using the keyboard cursor keys go into Component Config -> Bluetooth -> Bluedroid Options.

Copy the settings shown here.
Opt1.jpg
Opt1.jpg (114.17 KiB) Viewed 20944 times
Once done here, press escape and go into Controller Options -> Bluetooth Controller Mode and change the option to BR/EDR Only.
Opt2.jpg
Opt2.jpg (72.75 KiB) Viewed 20943 times
Press S and Enter to save the configurations, then press escape several times to exit.

Hopefully Bluetooth should now work correctly in IDF v5 onwards.
Regards Ben Rowland - MatrixTSL
Flowcode Product Page - Flowcode Help Wiki - My YouTube Channel

BenR
Matrix Staff
Posts: 2305
Joined: Mon Dec 07, 2020 10:06 am
Has thanked: 637 times
Been thanked: 847 times

Re: ESP32 Bluetooth SPP with IDF v5

Post by BenR »

Also a side note, Windows has now hidden legacy Bluetooth SSP devices when trying to add a new device.

You have to scroll down in the Bluetooth dialogue window and change device descovery from Default to Advanced to be able to see them.

This is Win11 but we have also found this to be an issue in Win10.
Device.jpg
Device.jpg (64.32 KiB) Viewed 20939 times
Regards Ben Rowland - MatrixTSL
Flowcode Product Page - Flowcode Help Wiki - My YouTube Channel

mnfisher
Valued Contributor
Posts: 2179
Joined: Wed Dec 09, 2020 9:37 pm
Has thanked: 177 times
Been thanked: 1021 times

Re: ESP32 Bluetooth SPP with IDF v5

Post by mnfisher »

As another aside - there is also an option to use AT commands.
This requires the download of a component from espressif. I'll see if I can get it to compile. It's probably better to use the 'native' component - but it might be useful for some legacy programs.

Martin

stefan.erni
Valued Contributor
Posts: 1288
Joined: Wed Dec 02, 2020 10:53 am
Has thanked: 246 times
Been thanked: 257 times

Re: ESP32 Bluetooth SPP with IDF v5

Post by stefan.erni »

Hi Ben , Hi Martin

Set Default to Advanced is good tip. I've also had computers where I had to change this settings.

One more small question:
When i compile an esp32 project, several files are created. One of them is a msg.txt file.
It shows at about line 27, which python version and which IDF version is used.
Maybe we can see which combination works with bluetooth and which does not.
I had problems with Python versions higher than 3.7.3 for example 3.12 did not work with bluetooth

Info in msg.txt file:
Snag_20a56c.png
Snag_20a56c.png (60.72 KiB) Viewed 20927 times

BenR
Matrix Staff
Posts: 2305
Joined: Mon Dec 07, 2020 10:06 am
Has thanked: 637 times
Been thanked: 847 times

Re: ESP32 Bluetooth SPP with IDF v5

Post by BenR »

This is my setup confirmed working.

Python 3.7.3
git version 2.21.0.windows.1
IDF Version: v5.1.1-1-gd3c99ed3b8 ...
Regards Ben Rowland - MatrixTSL
Flowcode Product Page - Flowcode Help Wiki - My YouTube Channel

Post Reply