-->
Page 1 of 1

ethernet stack - httpclient versus wifi and ethernet client

PostPosted: Thu Aug 12, 2021 2:54 am
by infrafast
Dear community,

I saw recently that the esp8266 library has been enriched with ethernet capability and would be able to use a driver for W5500 chip natively.

However, it looks like this has been added without considering utilities classes such httpclient that use to be independant from a WiFiClient. You could instantiate it without a client but now you have to call the constructor by passing such class

The immediate consequence is that the code that was woring with past version of the board (in my case 2.7.4) and separate library (lww550 driver) is not working anymore with 3.x.x framework.

Ideally, implementation should consider getting a generic Client class and then you would pass either an Ethernet or a WiFi client. I am not sure how and to whom to address this design fix (there are probably others)

Thanks for your support.

Re: ethernet stack - httpclient versus wifi and ethernet cli

PostPosted: Thu Aug 12, 2021 3:18 am
by Pablo2048
I think that You got it wrong - all W5500/W5100 and ENC28J60 drivers just adds new network interface to the lwip stack. There is no need to use anything else than WiFiClient etc - it just use the lwip socket interface.

Re: ethernet stack - httpclient versus wifi and ethernet cli

PostPosted: Fri Aug 13, 2021 12:53 am
by JurajA
WiFiClient enhances core Client class which is same in all Arduino cores. many Arduino libraries work with the generic Client class.
but for the new network interfaces you use WiFiClient.
until now there were only two network interfaces: STA and SoftAP.

Arduino API communication classes hierarchy:
Image