espressif / esp-protocols

Collection of ESP-IDF components related to networking protocols
198 stars 135 forks source link

Integrate UART_WAKEUP as part of the esp modem (IDFGH-12062) #505

Open srikanthpalvai opened 9 months ago

srikanthpalvai commented 9 months ago

Is your feature request related to a problem?

Integration of UART_WAKEUP in esp_modem component

Describe the solution you'd like.

Dear ESP-IDF Development Team,

I hope this message finds you well. I'm reaching out to request a feature enhancement for the esp_modem component in the ESP-IDF repository.

Requirement: I'm currently working on a project where I need to implement a functionality wherein upon receiving a new SMS on the SIM module, a specific message is sent to the UART in the form of +CMTI:"sm",0. This message serves as a trigger to wake up the ESP32 from light sleep mode. However, I've encountered an issue where the UART_WAKEUP feature is not integrated into the esp_modem component, hindering the smooth implementation of this functionality.

Observation: I have attempted to integrate UART_WAKEUP In my project and set a threshold of 3. However, the behavior is inconsistent. Despite sending SMS continuously, the wakeup is triggered intermittently. I've tested this scenario using the UART0 and UART1 pins on the ESP32S3. https://github.com/espressif/esp-idf/blob/v5.1.2/examples/system/light_sleep/main/uart_wakeup.c#L84

But the same works in the light sleep example. Please find the screenshot.

Note: With ESP32 It's not working with the same code. UART Pins ESP32 UART 1, RX_IO_NUM:9, TX_IO_NUM:10 I have added these two extra lines for IOMUX. for esp32 https://github.com/espressif/esp-idf/blob/v5.1.2/examples/system/light_sleep/main/uart_wakeup.c#L124

if CONFIG_IDF_TARGET_ESP32

PIN_FUNC_SELECT(PERIPHS_IO_MUX_SD_DATA2_U, FUNC_SD_DATA2_U1RXD); // GPIO9 should be configured as function_5 PIN_FUNC_SELECT(PERIPHS_IO_MUX_SD_DATA3_U, FUNC_SD_DATA3_U1TXD);

endif

LightSleep example

image

Describe alternatives you've considered.

No response

Additional context.

No response

srikanthpalvai commented 9 months ago

image

srikanthpalvai commented 9 months ago

@david-cermak Please have a look on it

david-cermak commented 9 months ago

Hi @srikanthpalvai

I'll look into it, but probably won't integrate the functionality into the esp_modem. I'll check if we can add this to one of our examples, just to demonstrate how the UART wakeup event could be used with this library.

srikanthpalvai commented 9 months ago

@david-cermak From an end-user perspective, Integrating UART wakeup into esp_modem would enhance convenience for developers by reducing the need for additional patchwork. This integration could streamline processes and improve the overall usability of the library.

srikanthpalvai commented 9 months ago

@david-cermak @espressif-bot Any updates on this

srikanthpalvai commented 9 months ago

@david-cermak Kindky reminder ...

david-cermak commented 9 months ago

Hi @srikanthpalvai

I'm sorry, no update yet. This hasn't been planned yet, since we'll only consider it after v1.2 is available (with already planned features).

I'd like to keep this open for some time to see if there are any related requests a ideas for other people.

srikanthpalvai commented 4 months ago

Hi @david-cermak could you please add this feature into your bucket.