1
0
mirror of https://github.com/RIOT-OS/RIOT.git synced 2024-12-29 04:50:03 +01:00
Commit Graph

36 Commits

Author SHA1 Message Date
Gunar Schorcht
b15d7df6dc cpu/esp8266: ESP8266_SDK_DIR renamed
To make the migration progress to the new RTOS SDK easier, the ESP8266_SDK_DIR variable was renamed to ESP8266_RTOS_SDK_DIR.
2019-11-14 13:58:44 +01:00
Gunar Schorcht
ddc91df4ca cpu/esp8266: changes for RTOS SDK 2019-11-14 13:58:22 +01:00
Benjamin Valentin
b8c4ab5b69 cpu: make use of ARRAY_SIZE macro 2019-08-06 19:43:54 +02:00
Gunar Schorcht
97bb33788b cpu/esp*: changes to use esp_wifi and esp_now 2019-07-31 13:53:48 +02:00
Gunar Schorcht
f4a9f5a0d6 cpu/esp8266: netstats removed from esp_wifi 2019-02-07 15:44:04 +01:00
Gunar Schorcht
66c4cf8647 cpu/esp8266: avoid WiFi going into sleep mode 2019-01-30 08:27:21 +01:00
Gunar Schorcht
975fba8265 cpu/esp8266: check free heap before pbuf alloc
Checking by the send function that at least two maximum size Ethernet frames fit in the remaining heap before the LwIP packet buffer is allocated seems to increase stability. This can be caused by the fact that WLAN hardware interrupts allocate additional memory when receiving a frame during the send attempt.
2019-01-29 18:16:21 +01:00
Gunar Schorcht
c81138367b cpu/esp8266: dbg msg replaced by an error msg
The situation where the firmware `lwIP` packet buffer is exhausted is an important indication that the traffic sent to and sent from the esp8266 is more than the esp8266 is able to handle. Therefore, it should be an error message.
2019-01-27 12:14:18 +01:00
Gunar Schorcht
fa48e3f51f cpu/esp8266: event handling for link up/down 2019-01-26 17:34:13 +01:00
Gunar Schorcht
4e41afa2fb cpu/esp8266: readable disconn reasons in esp_wifi 2019-01-26 17:33:28 +01:00
Gunar Schorcht
1a8a560bb5 cpu/esp8266: remove timeout handling in send func
It is not necessary to realize timeout handling in send function or to disconnect from AP if lwIP packet buffer is exhausted. Waiting that the frame allocated in lwIP packet buffer is freed by MAC layer led to the complete blockage of send function on heavy network load. Disconnecting from AP is counterproductive since reconnecting usually fails on heavy network load.
2019-01-26 17:32:04 +01:00
Gunar Schorcht
fa5fe7e48f cpu/esp8266: don't disconnect on pbuf full in send
Disconnecting from the AP in the send function if the lwIP packet buffer is exhausted is counterproductive since reconnecting usually fails on heavy network load. A better strategy is to slow down the sending of MAC frames from netif a bit to wait for flushing the buffer in the MAC layer.
2019-01-26 17:23:21 +01:00
Gunar Schorcht
5d0b447209 cpu/esp8266: auto reconnect in esp_wifi
It seems to be more stable and less memory consuming to use auto reconnect policy.
2019-01-25 23:59:42 +01:00
Gunar Schorcht
24b71a7fbe cpu/esp8266: call _recv directly in esp_wifi
Since _esp_wifi_recv_cb is not executed in interrupt context but in the context of the `ets` thread, it is not necessary to pass the`NETDEV_EVENT_ISR` event first. Instead, the receive function can be called directly which result in much faster handling, a less frame lost rate and more robustness.
2019-01-25 23:59:42 +01:00
Gunar Schorcht
f12606d7c0 cpu/esp8266: removes the mutex in esp_wifi
Since _esp_wifi_recv_cb is not executed in interrupt context but in the context of the `ets` thread, the receive function can be called directly. There is no need for a mutex anymore to synchronize the access to the receive buffer between _esp_wifi_recv_cb and _recv function.
2019-01-25 23:59:42 +01:00
Gunar Schorcht
49f06efd38 cpu/esp8266: fix pbuf length check in esp_wifi
When the size of a received frame is checked, always the total length should be used instead of the length of the first lwIP pbuf in the pbuf chain. Otherwise, the check that the length does not exceed ETHERNET_MAX_LEN will always be true since the maximum size of one lwIP pbuf in a pbuf chain is 512 bytes.
2019-01-24 09:54:53 +01:00
Gunar Schorcht
88c65aff0b cpu/esp8266: allow _esp_wifi_recv_cb during send
Receiption of a frame in _esp_wifi_recv_cb while sending has no effect and should be possible to increases the performance.
2019-01-24 09:39:45 +01:00
Gunar Schorcht
0920bbb4fb cpu/esp8266: log message on reconnect in esp_wifi 2019-01-24 09:21:17 +01:00
Gunar Schorcht
92f6c1a7c6 cpu/esp8266: WiFi mode changed in esp_wifi
Although only the station interface is needed, the WiFi interface has to be used in SoftAP + Station mode. Otherwise the send function blocks sporadically. Since the SoftAP interface is not used, it is configured with a hidden SSID and a long beacon interval. Connections from other stations are not allowed.
2019-01-24 09:21:17 +01:00
Gunar Schorcht
538aac00ad cpu/esp8266: fix of allocated pbuf in esp_wifi 2019-01-24 09:21:17 +01:00
Gunar Schorcht
e384f1e502 cpu/esp8266: send timeout handling in esp_wifi
A timeout was introduced if sending a frame takes to long time. In that case the WiFi interface disconnects and reconnects automatically to recover.
2019-01-24 09:21:17 +01:00
Gunar Schorcht
04ee2ebe15 cpu/esp8266: automatic reconnect in esp_wifi
A reconnect timer is used to try to reconnect every 20 secons if WiFi interface is in disconnected or connecting state.
2019-01-24 09:21:17 +01:00
Gunar Schorcht
87b87631a6 cpu/esp8266: functions that have to run in IRAM
Due to performance reasons _esp_wifi_recv_cb and _send have to be executed in IRAM.
2019-01-24 09:21:17 +01:00
Gunar Schorcht
96d0910d33 cpu/esp8266: avoid _esp_wifi_recv_cb during send
To avoid conflicts on receiption of a frame while sending, _esp_wifi_recv_cb should not executed while a frame is in transmission
2019-01-24 09:21:17 +01:00
Gunar Schorcht
78e0aa2a77 cpu/esp8266: usage of _esp_wifi_recv_cb
Overriding ethernet_input function _esp_wifi_recv_cb is only used when the WiFi interface is in connected state.
2019-01-24 09:21:17 +01:00
Gunar Schorcht
c5a9058ab9 cpu/esp8266: simplified error handling in esp_wifi
wifi_station_connect and wifi_stattion_disconnect never produce errors. Thus, error handling can be removed.
2019-01-24 09:21:17 +01:00
Gunar Schorcht
3225aaa387 cpu/esp8266: different conn states in esp_wifi
Different connection states defined to be able to realize a better connect/reconnect handling
2019-01-24 09:21:17 +01:00
Gunar Schorcht
5a835e91ba cpu/esp8266: fix some comments in esp_wifi 2019-01-24 09:21:17 +01:00
Gunar Schorcht
107e196b18 cpu/esp8266: fix of maximum frame length in esp_wif
Since complete MAC frames are handled, ETHERNET_MAX_LEN has to be used instead of ETHERNET_DATA_LEN for receive buffer size and length check.
2019-01-24 09:21:17 +01:00
Gunar Schorcht
0e46869e57 cpu/esp8266: react to "out of memory" in esp_wifi 2019-01-24 09:21:17 +01:00
Gunar Schorcht
35a751c245 cpu/esp8266: avoid send interruption in esp_wifi 2019-01-24 09:21:17 +01:00
Gunar Schorcht
f7998c2ad6 cpu/esp8266: automatic reconnect in esp_wifi 2019-01-24 09:21:17 +01:00
Gunar Schorcht
d6664dafad cpu/esp8266: esp_wifi dbg msg changed to err msg 2019-01-24 09:21:17 +01:00
Gunar Schorcht
be3a2a4cb5 cpu/esp8266: fix compilation problem of esp_wif 2019-01-24 09:21:17 +01:00
Gunar Schorcht
698770ddb5 cpu/esp8266: fix esp_wifi stability issues
Fixes sporadic blocking of the wifi thread in esp_wifi_recv_cb function under heavy network load conditions when frames are coming in faster than they can be processed. Since esp_wifi_recv_cb function is not executed in interrupt context, the msg_send function used for ISR event can block when the message queue is full. With this change esp_wifi can be flooded with icmpv6 packets of maximum size without any problems over hours.
2019-01-24 09:21:17 +01:00
Gunar Schorcht
642c48f856 cpu/esp8266: add built-in WiFi netdev driver 2019-01-24 09:21:17 +01:00