Several weeks ago, I needed to install a new raspberry pi image on my raspberry pi here.
And, for the first time, I was going to use a graphical interface. So, instead of just
needing a USB keyboard, like what I have sitting over there, I needed a USB mouse as well.
And, I did not have one - or at least, I thought I didn't have one. And, actually the whole
thing is kind of pointless because I had a touchscreen that I could, that it was plugged
into, I just clicked on the touchscreen and it all worked. But, that didn't stop me from
borrowing Brendan's mouse before I found this out. Well, actually it was Brendan's only
mouse and Brendan had to use the ctrl+shift numlock trick in linux to use his computer.
This whole thing is actually pointless because I already had a mouse right back there and
I had a few more downstairs. I guess I didn't notice or something. At any rate I decided
this is stupid I don't want to wait time for a mouse to come in the mail, so I decided
I would make an esp8266 pretend to be a mouse and keyboard. How hard could it be? How hard
could it be do you ask? How hard could it be to turn this thing right here into a USB
mouse. Well, considering the chip itself doesn't support USB at all, and Espressif saying they're
not going to support it on the ESP32, should be impossible. So, it shouldn't be possible
to turn that into a USB you know mouse or anything. Except for the fact that I did.
Or - more importantly we did. This here is an ESP8285 board. An ESP8285 is basically
an ESP8266 with the flash built in. At any rate, this board here has an esp8285 on it
along with minimal compliment of components and a bunch of programming wires. These don't
actually need to be here - they can all be desoldered. And this emulates a mouse and
keyboard. So, first of all, when I say we did. I mean this has really been a group effort.
I really want to thank everyone for coming out to the live channel. I want to thank espressif,
they've been very helpful. Though I really wanted to make this a full-speed device, it
turns out that's not possible for a series of reasons. At any rate, let's get this thing
plugged in and see what happens. So, I'm gonna go now, and plug it into my laptop here. Let's
see if it enumerates and it does. You can see here it does list the ESP8285 as both
a mouse and keyboard. Mouse. Keyboard. So, with my smartphone here, I'm going to say
"connect to the ESP." It's connected. I'm going to open up chrome. It's going to open
up a webpage that's down here, running on the ESP. And, the webpage has a couple of
things. I have a fake keyboard and I have a fake mouse. So this big green area allows
me to control the mouse. I can select areas. I can just click. You can do whatever you
can do with a normal mouse. Right-click. Check that out. Wheeee. It's like a fake mouse and
fake keyboard. Keyboard because I can come into this window here, I can say "show keyboard"
then using my phone's keyboard I can say L S. Or d m e s g. And that will show everything
that's in my kernel log there. So, With this, I can execute special commands too. So, Alt
F2 brings open a run dialog. I can type in firefox. And I can press "go" to press "enter".
I can do well, whatever I need to do here. Let's go up there, double click. And, visit
gooo gleee. G o o g l. Ooh let's open up a new tab. Control T. Agh. I'm not very good
with my phone. Hackaday.com. Go. Boom. There is hackaday. So, this is my litte ESP8266,
ESP8255 mouse and keyboard thing. And, I really do need to give credit to everybody in the
community, so things like how the mouse interacts here. That's not my code. How any of the stuff
on the ESP. Really it's just so much of the community. Especially this guy con-f-use from
github. He's just taken all of these projects and started to unify everything to make it
work a lot better. I wanted to say thank you to the community. Thank you to espressif,
thank you to everybody. Even though full-speed on the ESP is out of the question, there's
a lot of stuff you can do with low-speed USB devices. All of this code is on github under
ESPUSB and the newly created library "ESP82xx" links are in the description. One of the coolest
things about this project is now there's two new options. These are probably going to change,
and the way the bootloader works is probably not gonna remain the way it is. But, as it
is I can type make usb burn And this will actually connect to the ESP. Actually it makes
sense to close the. Whoops. Let's try that again. There we go. Now it's flashing the
ESP from the USB. And it's verifying and reflashing it now. ... B burn. Whoops. Let's try that
again.