-
Notifications
You must be signed in to change notification settings - Fork 13.3k
ESP8266-12E with Ethernet lib (w5100) or enc28j60 #962
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Comments
I'm not sure if i understand your Problem. But why do you want to use another Ethernet library with the esp8266? |
you have a null ptr problem you have done all changes like here? |
In this case I want to query a device that only has a wired Ethernet connection for information and make it available to a wifi connected device via a softAP on the ESP. Doing this all without a router on site.
Thank you that worked for compiling the code. I feel foolish, I didn't see the code changes until you pointed them out to me. I will report back on the functionality today. |
Ah okay. A ethernet wifi bridge would be very nice. :-) |
Nothing good to report i am afraid. I am using a unknown version of the Arduino Ethernet shield that uses a Wiznet W5100 chip. I am using the following test code to help me debug the Ethernet library This code causes the esp8266 to crash and restart.
I don't think that the ESP8266 is correctly communicating with the Wiznet W5100 chip. I suspect this because the Ethernet library can not seem retrieve an IP address from the Wiznet W5100 chip After looking though the changes made to the Ethernet library I see that the SPI clock is set to a fixed number instead of a clock frequency divide.
Why is this not a clock frequency divide instead of a magic number? I also see that its different then the default 4000000 that is used by the Arduino default code. I am novice using a scope but I checked the SCK out from the ESP chip and found that the frequency was distorted and didn't look right to me. So I set the clock frequency to '''1000000''' the Arduino SPI library default. This produced a much cleaner data in the scope. I also tried a few other frequency all producing the same result. I then tested the SPI bus on the ESP8266 to ensure that it is working. I set up an Arduino to send out a message and use the ESP8266 to receive the message and print it the message. This worked with no issues, I also tried the reversed of this where the ESP8266 send the message and the Arduino received it. No issues. I started reading the Wiznet W5100 datasheet https://www.sparkfun.com/datasheets/DevTools/Arduino/W5100_Datasheet_v1_1_6.pdf looking for the simplest command I could send from the ESP8266 to the Wiznet W5100 and get a response. I am not an expert in SPI bus and I am struggling with this. I am still working on this but I am not having much success. |
the max clock Frequenz for the W5100 is 70ns --> 14.286 Mhz that the ESP not output the exact frequency that is configured is normal, the SPI code tries to come as close as possible to the frequency with the internal clock dividers. the bad looking signal may comes from you logic analyzer if I understand to GUI right you sample at 8000K samples per second. with this config its impossible to see the 14Mhz signal in a good way. you debug out looks like there is only 0xFF coming back from the W5100 have you not get a line like
when it stops working? you can try to use: the Exception lines give you the exact address in the code where the problem is.
|
I agree with you, I also set up a test sketch to ensure that the SPI bus is working on the esp8266 using a loop back connection (MISO <==> MOIS)
Agreed. I am not sure if the W5100 is actually sending the 0xFF or if the line is just being held high and the ESP detecting that value.
No I have not. I reverted my changes to my Ethernet library and I am using your example code. https://gist.github.com/Links2004/341307404b135e0277f8 I get the following output on the serial port.
I do not know how to read this new line in the serial buffer. Is there a tool that will convert it from the hex address to a line in code?
I have ordered more ESP8266 to ensure that there is no issues with the board I currently have. |
the soft watch dog is triggert (SOFT_WDT) the pace ist was trigger is 0x4020251b (memory address)
the elf file is in the temp dir from the arduino IDE. but its most likely a while which is waiting for a correct status. the bigger problem is the 0xFF reading, always 0xFF is not good. |
I got it working! This was all my fault and bad documentation on Arduino's site. No changes need to be made to the esp8266 Arduino project. I am using the Arduino Ethernet Shield for the W5100 chip break out. I had connected to the SPI pins on the right hand side of the board, instead of the SPI header under the Ethernet board. The documentation on the Arduino Ethernet Shield reports that it is using (pins 10, 11, 12, and 13 on the Uno) this is NOT true, The Arduino Ethernet Shield actually doesn't connect (11, 12, and 13 ) and uses the SPI header instead. I figured this out by loading the schematics into eagle and viewing the board layout. I will write up a good post on this entire process and post it to my blog. Then I will add a link to this issue for people that have issues with this in the future. Thank you for your help. |
so the library is working with the changes like this: Links2004@10c5dec |
@funvill Could you post your example sketch with your "mini router" code? :) |
Yes
I will post as much of it as I can. |
@funvill Okay, previously much thanks for it. |
Hi, main difference between SPI port and direct pins: CS (chip select) is PIN 14 on SPI header, not PIN 10. |
@funvill any success to bind ESP & w5100 |
Hi @funvill @Links2004! Is possible give us a working basic example for this modified library? Best regards. |
Hello, has anyone got this working?, been attempting this and the Ethernet.begin just returns 0, any help would be much appreciated |
Has anyone successful with Wiznet W5100 arduino shield and NodeMCU(ESP8266 12E)? |
I got ping working but the example code web-server is not!(sic) I have used the normal SPI pins on NodeMCU which are: #define D0 16 When I fired up browser I am not getting the desired webpage! |
Also sometimes it is causing soft wdt reset while handling data with the browser! |
How long is each transaction taking? There's a limit to how long you can be
away from the wifi maintenance. Try some yield()s here and there.
What does mem usage look like? If your eth interface requires additional
buffers, you could be running out of heap.
What is your worse case stack usage? There's a limit to how much you can
allocate there.
Awesome progress, I suspect you need just some tweaking to get it stable.
…On Jul 19, 2017 4:29 AM, "tusharvb19" ***@***.***> wrote:
Also sometimes it is causing soft wdt reset while handling data with the
browser!
—
You are receiving this because you are subscribed to this thread.
Reply to this email directly, view it on GitHub
<#962 (comment)>,
or mute the thread
<https://github.com/notifications/unsubscribe-auth/AQC6BmlW8lom8cRjV45CFjK1hM_34Ayeks5sPb5dgaJpZM4GbYHu>
.
|
Board: ESP8266-12E using a NodeMCU v1.0 dev board.
Library: ESP8266 Arduino library version: 1.6.5-947-g39819F0
IDE: Arduno 1.6.6 or visual studios with visual micro
I am following up on this issue closed but incomplete issue.
#574
I was able to alter the EthernetClass::begin function and compile.
#574 (comment)
But when the board runs i get the following error on the serial port.
I added in some serial port debug messages and I have tracked down this exception to line 44 of the WebServer example.
I started breaking it down line by line by coping code out of the Ethernet.begin() function into the Arduino sketch and adding serial port debug messages.
At this point its out of my depth and I am not sure where to go from here.
Should I keep trying to get the Ethernet lib (w5100) working with the ESP8266 chip or should I abandoned it?
Has anyone got this working with a different Ethernet chip?
The text was updated successfully, but these errors were encountered: