Problem to reconnecting and play music to bleutooth speaker #439
-
Hi, My issue is, that sometimes it takes long until I hear the music after paaring (3-4 seconds). This is for me ok, but when I turn off the speaker and turn it on again, then sometims nothing happen, sometimes it takes 15 to 20 seconds until the music is streamed. Does this related to the buffer or is this an bluethooth issue of the ESP32? I try also to use the 'set_ssid_callback' and disabled the 'set_auto_reconnect(false)' to connect to a bluetooth device. But the callback function is only called once at the beginning after reboot the ESP32. When I turn off and on the speaker again, it reconnect it, but without the call of the callback function 'isValid'. Do I somthing wrong? How can I improove the connection and the speed? Thank you very much for any inputs. Here my code:
|
Beta Was this translation helpful? Give feedback.
Replies: 4 comments 1 reply
-
It is my understanding that the issue is with your bluetooth speaker which does not accept the new connection and does not recognize that the old connection was lost. This issue should go away if you end the bluetooth properly before rebooting the ESP32. You can set the Core Debug Level to Info or Debug to reproduce what's going on in detail |
Beta Was this translation helpful? Give feedback.
-
That's my point: the speaker does not allow any connections until you restart it again! That confirms that the issue is with the speaker. |
Beta Was this translation helpful? Give feedback.
-
Hey @nadmaga! I wanted to DM you but GitHub doesn't have that feature. I'm actually working on a very similar project but I'm facing some issues sending the data from ESP to ESP. To my understanding, you were able to get this done, Do you mind sharing your code? I also see you're using RTOS, which could also serve me useful in the future. Thanks! |
Beta Was this translation helpful? Give feedback.
-
From the examples directory you should be able to take any receiver sketch and sender sketch. Just make sure that the names are matching! And be careful with the automatic reconnect. I suggest to switch it off for both! To analyse what is happening in detail, just activate the logging... |
Beta Was this translation helpful? Give feedback.
It is my understanding that the issue is with your bluetooth speaker which does not accept the new connection and does not recognize that the old connection was lost.
This issue should go away if you end the bluetooth properly before rebooting the ESP32.
You can set the Core Debug Level to Info or Debug to reproduce what's going on in detail