Hi everyone,
I'm experiencing a strange behavior whilst in BLE SPP mode.
My use case is the following:
1. Setup ESP-C6 as BLE server
2. Pair with client
3. Trigger the SPP trasnmission (AT+BLESPP)
4. Send/recv data over BLE
5. Client (Linux python script using bluepy stack) stops streaming and triggers disconnect
What kind of response should I expect when the client is disconnecting from the BLE server?
I would expect the following flow to be sent from ESP as AT messages:
1. +QUITT - SPP data mode turned off
2. +BLEDISCONN
I receive the following information in a single message:
+WRITE: <data>
+BLEDISCONN
The next message that I receive the end SPP data mode event:
+QUITT
My questions are:
1. Should I receive AT events whilst in BLE SPP data mode? Are we suppose to parse each message to avoid such a behavior?
2. Shouldn't +QUITT be sent before +BLEDISCONN has been generated?
Thanks
BLE SPP mode sending unexpected AT events
-
aliarifat794
- Posts: 201
- Joined: Sun Jun 23, 2024 6:18 pm
Re: BLE SPP mode sending unexpected AT events
On receiving +BLEDISCONN, check for +QUITT if it hasn’t already been received. This way, you can handle state cleanup in the correct sequence.
Re: BLE SPP mode sending unexpected AT events
Unfortunately that notification hasn't been transmitted. I only got it if I performed the disconnection from the other endpoint.
Re: BLE SPP mode sending unexpected AT events
In SPP mode, the output of the +BLEDISCONN log is controlled by the AT+SYSMSG command. You can refer to the usage instructions for that command for more information.
Generating +BLEDISCONN does not automatically exit SPP mode, you should always execute +++ to exit SPP mode if possible.
Generating +BLEDISCONN does not automatically exit SPP mode, you should always execute +++ to exit SPP mode if possible.
Re: BLE SPP mode sending unexpected AT events
Thank you for the kind reply!In SPP mode, the output of the +BLEDISCONN log is controlled by the AT+SYSMSG command. You can refer to the usage instructions for that command for more information.
Generating +BLEDISCONN does not automatically exit SPP mode, you should always execute +++ to exit SPP mode if possible.
So, I my understanding is right, i should received only the +BLEDISCONN, considering that the AT+SYSMSG command has set the parameter for the generation of that event.
Hence the correct sequence after receiving +BLEDISCONN would be manual exiting via +++ to exit SPP modem, if needed.
The confusion and question appeared due to the AT+SYSMSG parameter bellow.
1: Print +QUITT when quitting Wi-Fi Passthrough Mode, Bluetooth LE SPP and Bluetooth SPP.
Basically that mean that the +QUITT is a feedback once the BLE SPP mode has been successfully quit as part of the +++ command invoked by the host which generates the commands?
Who is online
Users browsing this forum: No registered users and 1 guest
