A little while back, in a previous video with my wifi cup, I used an ESP8266 to drive some
WS2812's.
It worked, but it was awful.
I have since come back and fixed it up a lot though.
So, now, it's a much better driver.
That's not what this video is about, though.
This video is about how you can, with an ESP8266 can drive all sorts of devices and have it
internet connected without having to have another processor like Arduino or an AVR in
the mix.
So, if you're curious how to build your own programs and build them and burn them on the
ESP8266, without having to read through pages and pages of forum threads, this video is
for you.
So, when you wanna go start doing a lot of stuff with projects, git is kinda the flavor
of the week right now and most of the things you're gonna need are on github, including
this, my ESP8266 WS2812 driver.
Here, I actually have the step-by-steps on how to do this, so I'm going t obe reading
from here to do the video.
I made an ESP8266 folder in my home folder here that doesn't have anything in it right
now, and I have a git folder where I keep my projects.
Not right now, though.
I cleared it out for the video but it's where I put them.
So, the first thing we are going to do is check out this repository to my git folder,
so "git clone" and then the URL.
Github is really convenient, so whenever you visit a git page, you can scroll right down
here and you should be able to find clone URL.
And say git clone and then that thing.
As an aside, I forgot to mention that I use Linux.
No idea how you would do this in Windows.
In Linux it's just easier, so I just use linux so that's where we are.
I use Linux Mint, my guess is any of the other Linuxes would work, but whatever I'm mint.
So I'm gonna go clone the github cnlohr esp8266 git.
So, now in here I have, in here a copy of my ws2812 driver.
If I type make it's not gonna work.
It can't find the compiler and it's not gonna be able to find any of the other stuff.
That's okay, though because now we are going to go get a copy of the compiler.
Ok, so now we're gonna go get the compiler, so we need to get GCC and some of the tools
that come with it.
Conveniently, JCMBPC, I have no idea how he wants to say that has put together most of
the stuff we need.
So I'm going to make the ESP8266 folder right now it has nothing in it.
The first step is to CD into it.
So, I'm going to clone his xtensa toolchain build.
So, let's go get that.
Now it's going and cloning all of his stuff.
I'm going to go cd into it and I'm going to have to get some of the other files.
Here he has all of the build scripts that are necessary.
But, he doesn't provide a copy of GCC GDB and binutils, so we are gonna go get those
now.
So Wget the one file gets this straight from GNU, now we're gonna go into turbo time.
Ok there's the first part of the compiler, now what we're gonna have to do is get a copy
of GCC itself.
That was binutils.
And, unfortunately we have to use a special branch of GCC to do this, I guess the processor
just has a couple of weird parts.
Conveniently, he's also branched a copy of that and right here I can go clone his repository
of that branch of GCC.
This is going to take a while longer so we're gonna have to really go into turbo time.
*SILENCE*
Allll right.
So now, we have GCC-xtensa.
We do have to rename it to be the thing that it needs to be.
These instructions aren't quite right.
I'm going to go change them in a second.
But, they will be right once I'm done with this video, so I'm going to say mv gcc-xtensa
gcc-4.9.1, so that way his scripts will know where to get it.
I'm also going to need to get a copy of GDB, and his scripts support it so I figure why
not throw it in for fun.
Ok, now we have most of what we need.
We just need to prepare for the lx106 architecture.
Thankfully he has a script for that.
This script goes and it untars the bintuils and the GDB.
It notices it already has GCC so it doesn't do anything with that.
And it applies any of the patches that are needed to get it off the ground for running
on the ESP8266.
Now we're gonna have to go build it.
So, you say this and if all goes well it should just crank out a copy of GCC.
Yeah, back to turbo time.
*SILENCE*
Alright, so the compile succeeded.
This is particularly good news.
It means we might be able to go do this thing.
The other few things we're gonna need is a copy of esptool to handle the binaries and
a copy of esptool.py to handle pushing the image, and we will also need the SDK to go
build our thing, because the SDK is what helps you have all of the nice little functions
that make talking to the internet and ethernet and everything else o so easy on the ESP8266.
So, the esptool, we're going to have to go and get a copy of esptool from, I don't even
know where it's from, I'm sure if you google it you could find out where it's from I am
sure if you google it, you could find th person who made it.
So, just paste all that in.
ESPTool, so now here we have Makefile, so if we edit he Makefile and change it to Linux
for the Target Arch, and type make, now we have a file called esptool, which is exactly
what I want.
Now, next I'm going to need to a get a copy of esptool.py.
By default this tool uses 115200, for the baud rate but you can go faster than that.
I've only ever really tried twice the baudrate, but I think you can faster than that.
I think someone said you could download code to the ESP8266 at have a megabit, which is
pretty quick, so.
There's another bug.
Fix that.
So here, esptool, you can clone this git repository too.
Let's go into esp8266, gitclone, and esptool, so now if I look in esptool I can see esptool.py,
now we can edit esptool.py and change it to 230400.
So we go even faster.
Ok, the last part of gettings for this is going to be the SDK, so I have that - just
copy and paste that here.
It gets this from expressive's website off of their fourms and uuh saves it to the aproprate
files.
There are two files.
There's two files, one is the base SDK, and another is the file they've updated.
I don't know what was wrong with the original but they said use the new one, so by golly
that's what I'm going to use.
So let's see here.
Gonna paste taht in.
Ok, it's downloading the main SDK and the patch and it unzipped the main SDK and you
will have to overwrite aht file in the patch.
Okay.
Now, in here we have the SPI IOT SDK # 0.9.3.
Ok, so these are all the files you
are
going
to need to build
your projects for the ESP8266.