As discussed in an earlier thread, I still fight with spurious resets of the ESP8266. It seems to be a problem with stack or heap, because both of them are quite small.
All my application code is called inside of Mongoose callbacks, exclusively. So, my questions are the following:
- In which context are these callbacks called?
- Are these callbacks called strictly sequentially?
- Can these callbacks interrupt one another?
- Is the Uart callback called in the interrupt context?
- Why some ‘hook functions’ start with ‘mgos_’ and some with ‘mg_’, what is the difference?
I use the following hooks for the application callbacks (while the two server callbacks are hooked from application code called by one timer callback):
Timer: mgos_set_timer(SHEDULE_TIME_MS, MGOS_TIMER_REPEAT, sheduleTimer_cb, NULL); UDP server: mg_bind(mgos_get_mgr(), uri, udpConn_cb, NULL); Http server: mgos_register_http_endpoint(pUrlPath, httpConn_cb, NULL); UDP client: mg_connect(mgos_get_mgr(), url, udpConn_cb, NULL); Http client: mg_connect_http(mgos_get_mgr(), httpConn_cb, this, pUrl, NULL, NULL); Uart: mgos_uart_set_dispatcher(m_iUartNr, uartDispatcher_cb, NULL);
Thanks for any help and