Closed wolfgangr closed 4 years ago
@wolfgangr
You can add in Ethernet.h
around L220
virtual bool flush(unsigned int maxWaitMs = 0) { (void)maxWaitMs; return flush(); }
virtual bool stop(unsigned int maxWaitMs = 0) { (void)maxWaitMs; return stop(); }
and
virtual int connect(const IPAddress& ip, uint16_t port) { return connect((IPAddress)ip, port) };
Compilation error or infinite loop may happen with this one, better change connect()
signature to match this one instead (in .h and .cc)
virtual IPAddress remoteIP() const;
virtual IPAddress remotePort() const;
You may add const
like above in Ethernet.h
L239,L240
@PaulStoffregen What version of this arduino core did you use for your testings ?
We could also replace the old version with Paul's updated one, but it's better if we could
use it as a submodule like we did with SoftwareSerial
.
edit: that was you :) https://github.com/d-a-v/W5500lwIP/issues/4
I am sad to report the testing I did last summer had DNS lookup fail on ESP8266. Here's a blog article I wrote at the time. Scroll to the end for test data.
@d-a-v
edit: that was you :) d-a-v/W5500lwIP#4
yepp. small world, eh :)... Just wanted to test basic functionality, before I dived into your testing instructions - and got stuck even at that basic level...
@PaulStoffregen
I am sad to report the testing I did last summer had DNS lookup fail on ESP8266.
Ashes on my head: I have linked your article but not read it to the bottom? So I'll try my test with a fixed IP? But it does not even build... So, if you just could point me to some git to ESP8266-arduino where you built your tests aginst, I might be happy.
Some remarks on the wider view angle
In your blog, you quest for support from the ESP community.
So, I assume, there is no easy solution at hand yet. This begs the question whether it is worth the effort to fix it.
Looks like just another case of ordered network configuration is conflicting with opaque ESP8266 core . ESP8266 always has WiFi on it, and even if I look for ESP32, modules without WiFi sell at a multifold price than the ones with WiFi included.
While I think it is safe to say that WiFi sticks to ESP (both ...8266 and ...32) like s...orry..., not all use cases do so.
I see different constellations if it comes to ethernet on the ESP8266:
regarding 4.) While a real FOSS ESP core replacement would be the dream scenario, I don't feel elected to contribute, not even comment anything on that.
regarding 1.) Disabling WiFi when I need ethernet would be OK for my test purpose currently at hand.
It also might fulfill the need e.g. of many tasmota and other IoT framework use cases: Stay with the same platform and if possible with the same module, no matter whether a thingie (e.g. sensor interface, realy, button,....) is connected by wire or by thin WiFi air.
Of course it complicates code maintenance of such projects, that may end up with loads of #ifdefineds, and spoils the on-binary-for-all-purpose approach of e.g. tasmota.
Maybe, this might be implemented by a complete seperate fork of esp8266, which disables the onboard WiFi and just uses the MCU core. Maybe this even could be designed without any proprietary ESP code at all? Is something like that flowing around?
regarding 2.) Use case examples of coexisting but independent WiFi and Ethernet:
regarding 3.) WiFi and Ethernet in a single stack The app does not care whether the core delivers its package by wire or by air. I think this is what @d-a-v aims at with his lwip integration - correct? Pls correct my when I'm wrong, but I think this is not possible with the Arduino ethernet Module, OK? If it were possible to have ethernet in lwip, use cases 1.) and 2.) could be satisfied, too.
So, to make the point: I opened this issue because I thought there was an easy solution around, that had just been overlooked. If there is much work to do, I'd prefer to invest this in the lwip based architecture.
regarding 3.) WiFi and Ethernet in a single stack The app does not care whether the core delivers its package by wire or by air. I think this is what @d-a-v aims at with his lwip integration - correct?
correct.
We could however propose a PR to make Paul's library compatible with esp8266 arduino core if he's opened with that. Small changes I guess, even for DNS not working. After that, his library could be submoduled here and replace the old Ethernet library. For the sake of sketch portability without effort, the arduino way.
I'm currently very busy with a hardware project that's far behind schedule, so limited time I can spent right now.
I can tell you Ethernet 2.0.0 (on Arduino's repository) works on all other boards and it uses only the SPI library to access hardware.
So, if you just could point me to some git to ESP8266-arduino where you built your tests aginst, I might be happy.
Sorry, I've deleted and reinstalled Arduino many times since the summer, even restarted new preferences.txt files several times (partly working on a bug added in Arduino 1.8.8). ESP8266 is no longer in the boards manager at all on my machine.
There is a lingering copy if the esp8266 package on my machine with this pathname: ~/.arduino15/packages/esp8266/hardware/esp8266/2.4.1
On this part:
We could however propose a PR to make Paul's library compatible with esp8266 arduino core if he's opened with that.
I'm no longer maintaining a separate fork of the Ethernet library. So what you're talking about is a patch to Ethernet 2.0.0 on Arduino's repository, meant for all Arduino compatible boards.
Adding more called to yield() in places that wait would probably be a very welcome patch. Except in the optimized chip select pin stuff, very ESP specific stuff probably isn't appropriate in Arduino's repository. The Wiznet chip is accessed using the SPI library, so in theory all you should need to do is make sure ESP8266 has a SPI library which follows Arduino's specs.
esp8266 developers should not change the Arduino API base classes Client, Server, UDP
Any news for integrating wired ethernet?
Once https://github.com/arduino-libraries/Ethernet/pull/96 is merged, we can set it up here as a submodule.
Another version for ethernet is also coming from my ethernet + ppp drivers branch, some days are still needed to finish this up.
Hi guys, what is going on with Ethernet lib integration ??
@Smetanski you can either try #6812 or try the 0.0.2 alpha release. Please report whether it's working with you.
Or try #6680 which has a different Ethernet integrated with lwip and the wifi interfaces.
There is a new Ethernet library been developed by Paul Stoffregen https://www.pjrc.com/arduino-ethernet-library-2-0-0/ which has already found its way into arduino mainstream: https://github.com/arduino-libraries/Ethernet/blob/master/library.properties
Here at esp8266/Arduino, current master is still at "version=1.0.4" https://github.com/esp8266/Arduino/blob/master/libraries/Ethernet/library.properties
In his linked article, Paul reports succesful testing on a Adafruit Huzzah ESP8266 Feather , so I hoped, this lib would be copmatible or even included in esp8266/Arduino.
among other, I'd desperately use
Ethernet.hardwareStatus()
andEthernet.linkStatus()
to debug my network test environment.Basic Infos
Platform
Settings in IDE
Problem Description
I try to include wired networking into the tasmota Project. https://github.com/arendst/Sonoff-Tasmota/issues/4936
My test setup consists of a NODEMCU 0.9 with a generic china sourced W5100. (Yes, I got those to work with AVR MCU's, and tried different modules....) When I try the DHCPAdressPrinter example, I don't get any print at all.
I see the initial stage of DHCP handshake in my router log, but not the DHCPREQUEST / DHCPACK of a succesful lease assignment:
I concluded that either my net module does only transmit sends, not recieve the answer, or problems buried somewhere deep in the stack. More debug would be great at that point.
Googling the issue, I found PJRC's library 2.0.0. Scrutinizing my Arduino (good exercise :-), anyway....) revelaed that this was already included in mainstream arduino, but not yet in the ESP8266 platform. So I tried to add it manually.
When I override the Ethernet lib shipped with esp8266/Arduino with the new 2-0-0 Ethernet lib, I get loads of
error: invalid abstract return type for member function 'EthernetClient EthernetServer::available()'
. So obvioulsy there is more to change in the ESP8266 interface then just dropping in this library.Would be great to get it to work, however. Among else, it promises extended hardware and link state debugging. Im trying at the DNSAddressPrinter example. I see DHCPDISCOVER and DHCPOFFER in my router log, but communication seems to break down then.
I could not manage to test 2-0-0 Ethernet libs using the Arduino IDE. So I did a forceful override:
Debug Messages
Full error message:
MCVE Sketch
Nothing of my own. I used the stock DhcpAddressPrinter Example, as shipped with current Arduino IDE, e.g. here https://github.com/arduino-libraries/Ethernet/blob/master/examples/DhcpAddressPrinter/DhcpAddressPrinter.ino I just changed the serial speed to 115200
It builds without issues for AVR platforms.