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.

37 thoughts on “Software USB On The ESP8266

    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.

  1. 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.

  2. 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.”

  3. 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.

  4. I came across this looking for a way to potentially create a wifi based KM switch. Essentially, using software on one system I would control one or more computers. While I’m aware that Synergy and other similar products exist… they all rely on communication with the remote system via IP… which may not be possible if that other system is on a VPN or not networked.

    This could be a valid commercial use for something like this.

Leave a Reply to esot.ericCancel reply

Please be kind and respectful to help make the comments section excellent. (Comment Policy)

This site uses Akismet to reduce spam. Learn how your comment data is processed.