Software USB On the ESP8266

A while back, [cnlohr] needed a USB keyboard and mouse. His box ‘o junk didn’t hold this particular treasure, and instead of hopping on Amazon like a normal geek or venturing into the outside realm on a mid-level ‘store’ quest like a normal person, [cnlohr] decided to turn an ESP8266 into a USB keyboard and mouse. How hard could it be? The ESP doesn’t support USB, but bitbanging hasn’t stopped him before. The end result is a USB stack running on the ESP8266 WiFI module.

[cnlohr] has been working for about a month on this USB implementation for the ESP, beginning with a logic analyzer, Wireshark, Xtensa assembly, and a lot of iteration. The end result of this hardware hacking is a board based on the ESP8285 – an 8286 with integrated Flash – that fits snugly inside a USB socket.

This tiny board emulates low-speed USB (1.5 Mbps), and isn’t really fast enough for storage, serial, or any of the fancier things USB does, but it is good enough for a keyboard and mouse. Right now, [cnlohr]’s ESP USB device is hosting a webpage, and by loading this webpage on his phone, he has a virtual keyboard and mouse on a handheld touchscreen.

If you’re keeping track, [cnlohr] has now brought Ethernet and USB to a tiny microcontroller that can be bought for a few bucks through the usual online outlets. If you’d like to build your own ESP USB stick, all the files are over on the Gits.

Thanks [lageos] for the tip.

38 thoughts on “Software USB On the ESP8266

  1. That seems like an exercise in sadism, with turn key solutions at <3$ not even looking for it.

    There is always that trade off between selling a month of your life for 3 $ or not when making things.

    Sometimes its hard not to invoke "because i can" even thought maybe you shouldnt.

    Hattip anyways it would have taken me 2 months im sure.

          1. Whoops, accidentally reported child comment. Sorry, Addidis :(. What I was going to reply with was: “$3 more, per project, times all the projects that will ever use espusb, which is like 10, so $30.”

    1. If he takes the time to fill out the usb spec to a functional level agreed. Its liable to play havoc on devices its used on if they send it a command its not prepared to handle as it stands with a quasi sw usb stack.

  2. Wonder if it would be possible to bit-bang USB host as well, thus turning the ESP into a mouse and keyboard “logger”, except instead of logging you’re broadcasting blind across a network silent SSID. Could control it remotely as well.

  3. I am beginning to realise I have a terrible curse, that prevents me from authoring 1337 hax… I seem to have this unfortunate ability to find what I want…. I go, “I need to write a …. oh there’s an app” … “I need a thing that… oh, this will work.”

  4. Why does something have to be directly profitable to be a good use of time? Would he be better off getting paid $20 an hour to stand in the supermarket and watch the self-service robots?
    This is basically a 32bit DigiSpark with WiFi and integrated flash. It’s much more energy efficient than tacking on serial modules and now we can all downsize our projects.
    If these start getting mass produced in china that’s saving all of us time and money. This is why we need to start using blockchains. Our money doesn’t actually signify worth anymore.

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s