Here's the situation :
- station mode, tcp socket
-RTOS SDK V1.4.2
- Light sleep after every data transmission
- wake up from Light Sleep with connected ISR on GPIO0
- task waiting a semaphore to be released by wake up pin call back
- my code wait for a semaphore so is not doing anything between the next external trigger
- after every wake up transmits a bunch of data through tcp socket
- wake up time 1 second
- station and soft ap are close to each other in a relatively clean channel.
Facts :
- call back got called after external signal became high
- light sleep works ( just for a while unfortunately )
- data received correctly from esp server ( built with at binary )
- After a bunch of seconds of correct behaviour power consumption start to stay really high, though system works correctly => REALLY UNEXPECTED.
- WHY ???
- with a shorter wake up time , let's say 0.5 seconds max consumption start even earlier!
Attached a snapshot of transition to high current consumption :
- purple is current consumption
- yellow is external trigger to wake up Light Sleep
- blu is light sleep wake up gpio call back ( it toggles at every wake up)
After more or less 20 seconds working the system cannot exit from maximum consumption at the end of a dealing with a beacon ( purple peaks ).
Does anyonone experienced good results with the same approach? maybe with another sdk ?
This way the system is totally unreliable in embedded system attached to batteries as my requirements ask!
A bit of code :
Task sending data after wake up controlled with a semaphore .
Code: Select all
case SEND:
if ( xSemaphoreRd ) {
sprintf(localStr,"Debbio::WAIT_SEND::Sem releleased, executing op..\n");
DebbioPutStr(localStr);
//vTaskDelay(5/portTICK_RATE_MS);
if (connected){
if ( send ( sta_socket, pData, strlen(pData) + 1, MSG_DONTWAIT ) < 0){ /* Non blocking con DONTWAIT */
close(sta_socket);
sprintf(localStr,"Debbio::WAIT_SEND::Error not connected\n");
DebbioPutStr(localStr);
connected = false;
}
}
_xt_isr_unmask(1<<ETS_GPIO_INUM);
waitCb = true;
while( ! wifi_set_sleep_type(LIGHT_SLEEP_T) ) {}
xSemaphoreTake( xSemaphoreRd , portMAX_DELAY );
}
break;
EDIT :
I tried with NON OS SDK 2.0.0 and i got the same result.
Here i wake up light sleep with gpio, with another ext interrupt on a different gpio i post a message to a task for data transmission, after data sent call back i ask the system to go back to light sleep, without result after 15/20 seconds.
No Bueno!