How can I exit SPP mode?

Ariany_HM
Posts: 1
Joined: Fri Sep 27, 2024 9:33 pm

How can I exit SPP mode?

Postby Ariany_HM » Fri Sep 27, 2024 9:55 pm

Hi everyone,

I have an ESP32-WROOM-32D, and I’ve installed the AT firmware. I'm currently trying to execute this example: Establish SPP connection between ESP32 and mobile phone and transmit data in UART-Bluetooth LE passthrough mode. I'm using the following commands:

AT+BLEINIT=2
AT+BLEGATTSSRVCRE
AT+BLEGATTSSRVSTART
AT+BLEADVPARAM=50,50,0,0,7,0,,
AT+BLEADVDATA="0201060809534F434F52524F030302A0"
AT+BLEADVSTART

After these steps, I successfully establish a connection:

18:24:07.849 -> +BLECONN:0,"51:4a:42:d8:92:12"
18:24:08.129 -> +BLECONNPARAM:0,0,0,6,0,500
18:24:08.631 -> +BLECFGMTU:0,517
18:24:08.678 -> +WRITE:0,1,6,1,2,�
18:24:08.678 -> +BLECONNPARAM:0,0,0,39,0,500

Then I configure and start SPP mode:

AT+BLESPPCFG=1,1,6,1,4
AT+BLESPP

Everything works well, but I’m wondering: How can I exit SPP mode without resetting the board?

ESP_Sun
Posts: 326
Joined: Thu Dec 30, 2021 9:52 am

Re: How can I exit SPP mode?

Postby ESP_Sun » Wed Oct 09, 2024 3:37 am

Perhaps you could read the introduction to the AT+BLESPP command to find the answer (+++) you're looking for.

espc6user
Posts: 5
Joined: Mon Oct 21, 2024 9:33 am

Re: How can I exit SPP mode?

Postby espc6user » Mon Oct 21, 2024 9:48 am

Hi,
Hope this information helps you out.

There are 2 ways:
1. When the central is disconnected, if you configured the SYSMSG correspondingly, you will get the +QUITT message and you will automatically exit the SPP mode.
2. By sending the +++ data. Once you request SPP via AT+BLESPP command, you automatically enter a passthrough data mode, similar to the WiFi passthrough mode. Therefore similar to the TCP/IP part, this should work in a similar manner. Unfortunately this isn't explained somewhere, it was more of a bit and piece for here and there and trying it out.

I also have a question to you, not on topic, hope you might be able to help me with some info since I haven't managed to do that yet.
Did you do something in particular to change the MTU to 517 bytes? What client do you have?

I've tried setting the MTU from the server (although this is negociated and should work only for client mode anyway), change the PHY and also trying to change the advertisement, however nothing helped here, the MTU was still 23 bytes: :(

espc6user
Posts: 5
Joined: Mon Oct 21, 2024 9:33 am

Re: How can I exit SPP mode?

Postby espc6user » Tue Oct 22, 2024 3:36 am

Hi,
Actually this is something that I also experience.
I'm tried the following snippet:
1. Wait 5 seconds after the BLE connection with a client has been established and SPP have started.
2. Send the "+++" message to exit passthrough and enter command mode
3. Wait 3 seconds
4. Send an AT command (AT+BLEDISCONN=0).

Although after sending the "+++" message I do manage to receive the "+QUITT" response, expected, after issueing the AT command I'm not receiving any response.

Any thoughts on this?

Thank you

Who is online

Users browsing this forum: No registered users and 15 guests