This here is an ESP8266 home to literally thousands of hobbyist projects and some more
commercial ones.
It's just amazing.
People have used it in over 270 projects on HackADay.io alone.
So, this little guy used to just be thought of as something that could be little more
than a serial to wifi bridge, so you'd need something like an AVR to talk to it.
Over time, people found out more and more about it.
Eventually able to program programs in C for it and taking it a step further, getting access
to the GPIO and some of the other peripherals like PWM, I2C, the SPI busses, even the SDIO
buses.
Everything about it is just insane.
It just it's this awesome part that can do well, what people thought it could do almost
anything... that is except for talk Ethernet, and that is until today.
So, this little guy, although it does not have an ethernet controller, despite my title,
it does have an awesome I2S bus with DMA which is how I told it to broadcast Channel 3 television.
If you're curious about that video you can click on it right here.
Any rate, what it does is it can talk in and out of the chip at 40 MHz.
I can digitize that, well not really digitize, digitize there.
I can take that, hook it into a line driver here, hook it into ethernet magnetics up to
this ethernet cable up to this ethernet switch.
So, even though the ESP was only ever designed to connect by wifi, we've now added another
interface.
So, it's hooked into my laptop here.
And in the browser, I can visit it's fixed IP.
It's currently sitting at 10.1.10.5, let's view that.
And it loads this web page.
It's a lot like the other websockets pages.
If you're curious about that, how these websockets interfaces work, you can click on this video
right here.
Any rate, we can actually see it's getting communications to and from the ESP8266 at
around 700 Hz.
That means the webpage is creating a new request, going to the ESP8266.
The ESP8266 is responding, going back to the webpage and all of that is able to happen
at 700 hertz.
That includes all of the acks all of the requests, everything in TCP.
Unlike the other demos, it has a new feature on this webpage here.
The feature is called "last packet."
I can open this webpage here and I can click "get packet."
Now, if you're curious you can actually visit this page online on the github.io page in
the description and we can load a test packet and you can go play with it.
You can go set some bits high and low or whatever.
You can even break it so it goes "I can't decode that packet."
Here, though, I can click "get another packet" and it will actually get the last packet on
the line, so I use this interface for debugging it when I was trying to figure out how I was
going to interpret these raw packets.
They're just the raw manchester encoded packets.
I don't go into a lot of detail in this video, but for a lot more technical information you
can either checkout the Hack A Day article linked in the description.
It's great and goes into a lot of detail of how all of this fits together.
This is more of a video showing you how it all works.
This here is the webpage that is being served from the ESP over to here.
I can do crazy things like even reflash the ESP through the ethernet just by netflashing
it.
For right now, though, let's take a look at what kind of performance it can get.
So, I'm going to go ping it at 0.002 second intervals.
But as you can see it's keeping up and much to my surprise, it's actually getting a lot
of packet throughput.
In fact there hasn't been a dropped packet yet.
The average ping response time is 0.85 ms.
That is all the way from my laptop to the switch into the ESP, decoding the packet,
checking the frame CRC then opening it up, realizing it's a ping packet, dealing with
the ping packet, responding to the ping packet, packaging it back up, calculating the frame
CRC, manchester encoding it, shifting it out the bit register then going back into the
switch into my laptop.
All of that in one - I don't know one twelve hundredth of a second.
So, it's not just little packets this thing can respond to.
Let's try sending it 1,200 bytes of ping.
Now, it's a little bit slower.
You can see it's down to 3.8ms average, but it's still able to keep up and it's able to
respond to these ridiculous packages.
This really isn't something you would want to use in a serious project.
It's more of a circus trick, like using an FTDI chip or something.
Just don't use them in any kind of commercial product.
You really shouldn't be using this, either.
And, it's kinda jankey.
It's just not done - well - right.
You really should be using a PHY and a MAC and everything else.
It's fun and this totally would work for hobbyist projects.
It just wasn't janky enough though.
So, for maximum jank.
I have here the same sort of getup, it's just with the nodemcu board and it's hooked up
with some LEDs and some other stuff, and I have it going through some capacitors and
resistors right into an ethernet cable.
Let's get this thing plugged up right now.
Here I am, this little breadboard with the ESP on it and it's plugged up to the switch
and yes, it's linking.
This is without magnetics, much of anything.
It's just two resistors, two capacitors hooked into the ESP.
And this, too is able to communicate by Ethernet.
Now, you may notice that the packet loss is significantly worse.
Even though the average packet time is only 0.85ms, we're talking about packet loss in
the 60-70% range.
It's just just plain awful.
There's an interesting thing going on here, and a lot of this is due to a whole lot of
high frequency noise going on on the line and nothing really there to clean it up and
absorb the higher frequency noise so it just corrupts the packets.
In fact it's so bad right now that it's it's back.
All I have to do, though is if I plug in this little length of wire here.
I got this little length of wire here, green wire, and this awful thing.
If I plug this into the line on the processor, you'll see that it gets much better.
That's because instead of the signal - the high frequency noise - going and messing up
our signal, it can actually be just radiated into the atmosphere where it's somebody else's
problem to deal with.
That way I don't have to worry about it.
So, I strongly do not recommend using this kind of thing, also because there's no galvanic
isolation and that's kind of dangerous unless you know that all of your grounds are the
same.
But, it works.
And, it's just insane how this little ESP8266 can go and actually talk Ethernet.
Well, I hope you guys liked this.
Check out the Hackaday article and uuh, check out all of the source code is available in
github.
I am hoping I can find some people to help me maintain this project and maybe port it
to other things and do something else interesting with it.
Thanks!