I am using an ESP32 to periodically wake up from Deep Sleep to publish some data to a AWS IOT server about every 5 minutes. This process takes about 7.7 seconds and the application does very little processing. I would like to get to 2 seconds. Is this reasonable?
Boot up to mos_init2 takes about 2 seconds, and there are some things to try to speed this up from what I read by disabling boot messages, and faster spi clock speeds and flash modes. Probably not a discussion for this forum
[Aug 30 19:01:46.833] rst:0x5 (DEEPSLEEP_RESET),boot:0x13 (SPI_FAST_FLASH_BOOT) .... [Aug 30 19:01:47.588] mgos_init2 demo-c 1.0 (20180829-050129)
Then the OS starts many things, wifi, bt, shadows, time, etc and a a little later
[Aug 30 19:01:48.279] mgos_init Init done, RAM: 184544 total, 78728 free, 78688 min free
And connects to wifi a second later
[Aug 30 19:01:49.262] mgos_net_on_change_c WiFi STA: connected
And starts to send messages for SNTP and MTTQ and AWS Shadow. It would be nice for all this to faster! Still about half the time, nearly 4 seconds, is used with this:
[Aug 30 19:01:50.111] SW ECDSA verify curve 3 hash_len 32 sig_len 71 [Aug 30 19:01:51.235] SW ECDSA verify curve 3 hash_len 64 sig_len 72 [Aug 30 19:01:52.353] SW ECDH curve 3 [Aug 30 19:01:54.065] mongoose_poll New heap free LWM: 59468
I assume this is some "big number" calculations for TLS.
Since this is the biggest time sink is there any way to speed this up? Does it need to occur every time the system boots and connects?
Any other speed up techniques/strategies are welcome.