[riot-notifications] [RIOT-OS/RIOT] TCP lwIP Error Connecting Sock Problem (#11910)

Gunar Schorcht notifications at github.com
Sat Jul 27 18:19:43 CEST 2019

@miri64 Finally, I was able to get `lwIP` working with `esp_wifi`. However, before I open a PR, I have some questions and I would really appreciate to get some hints from you.

1. Since there is only one `esp_wifi`, the single `esp_wifi_netdev_t`, I just added 
   +#ifdef MODULE_ESP_WIFI
   +#define LWIP_NETIF_NUMOF        (1)
   +#elif defined(MODULE_ESP_WIFI)
   +    esp_wifi_setup(&_esp_wifi_dev);
   +    if (netif_add(&netif[0], &_esp_wifi_dev, lwip_netdev_init,
   +                  tcpip_input) == NULL) {
   +        DEBUG("Could not add esp_wifi device\n");
   +        return;
   +    }
   in `lwip_bootstrap` instead of having something like
    for (unsigned i = 0; i < LWIP_NETIF_NUMOF; i++) {
        esp_wifi_setup(&esp_wifi_devs[i], &esp_wifi_params[i]);
        if (netif_add(&netif[i], &esp_wifi_devs[i], lwip_netdev_init,
                      tcpip_input) == NULL) {
            DEBUG("Could not add socket_zep device\n");
   Would that be OK for you?

2. With this kind of initialization, the application can only have exactly one `esp_wifi` interface. Furthermore, if module `esp_wifi` is used, only this one `esp_wifi` interface can be used with `lwip`.

   What if the board would also have an ethernet port like the `esp32-olimex-evb` board? I guess, it's a general problem of the way how `LWIP_NETIF_NUMOF` is defined in [pkg/lwip/contrib/lwip.c](https://github.com/RIOT-OS/RIOT/blob/959c55b03f036a8937499b26e1483af141274c1d/pkg/lwip/contrib/lwip.c#L46-L80)

   Should I define `LWIP_NETIF_NUMOF` for `esp_wifi` depending on whether it is already defined by other netdev drivers? What do you think?

You are receiving this because you are subscribed to this thread.
Reply to this email directly or view it on GitHub:
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.riot-os.org/pipermail/notifications/attachments/20190727/8055d7a5/attachment.htm>

More information about the notifications mailing list