BLE Serial Port Profile with AT commands

eppppp
Posts: 5
Joined: Wed Jan 24, 2018 7:10 am

BLE Serial Port Profile with AT commands

Postby eppppp » Tue Jan 08, 2019 2:10 pm

Hi guys,
I have ESP-WROOM-32 module and I try to make BLE connection as SPP. I use ESP32_AT_V1.1.3 firmware. This firmware has below .bin files and I downloaded all of them to ESP32 module. I didnt change any .bin file. I just downloaded them.
( bootloader.bin, at_customize.bin , ble_data.bin, server_cert.bin, server_key.bin, server_ca.bin , client_cert.bin, client_key.bin, client_ca.bin, factory_param.bin, phy_init_data.bin , esp-at.bin, partitions_at.bin )

I follow the manual and send below AT commands to ESP32 to make a SPP.
AT+BLEINIT=2 // role: server
AT+BLEGATTSSRVCRE
AT+BLEGATTSSRVSTART
AT+BLEGATTSCHAR?
AT+BLEADVSTART // start advertising


After "StartAdvertise" command, I scan with my phone as a client (I try a lot of BLE scanner applications) but I cant find the ESP32.

Question 1: Is there any body make SPP with AT commands and can share the commands?
Question 2: In the manual it says
If using ESP32 as a BLE server, a service bin should be downloaded into Flash.
‣ at_customize.bin has to be downloaded, so that the relevant commands can be used.
Please refer to the ESP32_Customize_Partitions for more details.
‣ To learn how to generate a service bin, please refer to esp32-at/tools/readme.md.
‣ The download address of the service bin is the "ble_data" address in esp32-at/at_customize.csv.

I didnt understand that note. Should I need to make a new service bin or bin files (which are in ESP32_AT_V1.1.3 folder ) I downloaded are enough

Helen L
Posts: 71
Joined: Thu Aug 16, 2018 9:07 am

Re: BLE Serial Port Profile with AT commands

Postby Helen L » Wed Jan 09, 2019 3:00 am

There is an example in the ESP32 AT doc Section 9.5.2.2 UART-BLE Passthrough Mode

If you use ESP32 as BLE server, a mobile phone as BLE client, you may need a BLE phone app as the client, for example, I am using LightBlue on iphone.

And you can refer to the AT_BIN/download.config to download those binaries, it shows the details.

eppppp
Posts: 5
Joined: Wed Jan 24, 2018 7:10 am

Re: BLE Serial Port Profile with AT commands

Postby eppppp » Wed Jan 09, 2019 6:11 am

Hi Helen,

Do you use default AT firmware or did you recompile it with some changes ? Because when I set ESP32 as BLE server ( according to 9.5.2.2) I cant see ESP32 with my phone. I also use lightblue. I scan with lightblue application as client but application cant find ESP32 after scan.

eppppp
Posts: 5
Joined: Wed Jan 24, 2018 7:10 am

Re: BLE Serial Port Profile with AT commands

Postby eppppp » Wed Jan 09, 2019 1:12 pm

Hi guys,
I found the solutuion for my BLE SPP. You have to enable CCC's from the phone applicaiton after connection. I use nRF Connect application.

Here are my commands.
at+rst
OK


ready
AT+BLEINIT=2
OK


AT+BLEGATTSSRVCRE
OK

AT+BLEGATTSSRVSTART
OK

at+bleadvstart
OK
+BLECONN:0,"52:2b:6c:01:72:2f"
+BLECONNPARAM:0,0,0,6,0,500
+BLECONNPARAM:0,0,0,39,0,500
+WRITE:0,1,6,1,2,
+WRITE:0,1,7,1,2,
AT+BLESPPCFG=1,1,7,1,5

OK
AT+BLESPP

OK

>Hello World

kurta999
Posts: 14
Joined: Sat Jul 21, 2018 4:15 pm

Re: BLE Serial Port Profile with AT commands

Postby kurta999 » Wed Jan 09, 2019 3:25 pm

@eppppp: Thanks for example commands, it works!!! <3

Mickael
Posts: 10
Joined: Mon Jul 22, 2019 9:25 am

Re: BLE Serial Port Profile with AT commands

Postby Mickael » Mon Jul 22, 2019 9:31 am

Hi everybody !
@eppppp can you show me how did you flash these .bin files please ?
I'm a beginner in ESP32 and I realy don't know how to use the "flash_download_tools" specialy at the address level
Thanks
Mickael

tcpipchip
Posts: 9
Joined: Sun May 20, 2018 12:33 pm

Re: BLE Serial Port Profile with AT commands

Postby tcpipchip » Fri Oct 11, 2019 6:35 pm

Hi
I having the same problem with AT+BLESPP ERROR

What means CCC, where i config that ?

aakash
Posts: 3
Joined: Wed Apr 07, 2021 5:35 am

Re: BLE Serial Port Profile with AT commands

Postby aakash » Tue Apr 20, 2021 8:30 am

after you did AT+BLESPP
>Hello world
the above were on the server side i want to receive the same data sent on the client side..
what are the at-commands over the cient side??

Who is online

Users browsing this forum: Baidu [Spider], kaxx1975 and 350 guests