:S, i don't know man, running the program first time, esp32 scan ble and connect, so it supposed it would use that radio, but after that i connect with wifi and start sendind post request, it works.
You may be right, but if it were completely like this, the problem would be replicated at the moment I connect bluetooth and then wifi, and send the post request.
Because the first time, look, I print everything on the serial port and indeed I receive the data from the sensor and make the requests correctly:
HTTP Response code: 201
5561eaffecff08000000aeff7705427 //Sensor data
{
"id": 101
}
The problem comes when I disconnect from the sensor for the first time and reconnect to it for the second time, it is super strange, it is as if the problem with the radios that you tell me happened is to the second connection, not the first.
I think you are right, because the problem occurs right when this is launched, I checked:
if (connectToServer()) {
But it puzzles me a lot that this happens the second time, if it were as you say it should always fail.
Can you think of something that may cause the first time to work and not the second? Is it possible that I am not correctly disconnecting from my sensor the first time? I am still very new to this, and I may not be using it well, the bluetooth library.