-->
Page 1 of 1

ESP8266 USB wiretap

PostPosted: Thu Jun 02, 2016 4:49 pm
by krzycho

code: https://github.com/krzycho1024/esp8266_usb_wiretap

Small proof of concept that ESP can dump USB packets and send them over IP.
Other name of this: IoT keyboard :)

Re: ESP8266 USB wiretap

PostPosted: Mon Jun 06, 2016 5:35 pm
by D3thAdd3r
Very nice, actually kind of incredible it has the horse power to do that and get it across. Must be a sweet piece of code to handle the USB frames.

Re: ESP8266 USB wiretap

PostPosted: Tue Jun 07, 2016 8:30 am
by eduperez
Very interesting! Do you think it would be possible to extend it into an universal usb-over-wifi bridge?

Re: ESP8266 USB wiretap

PostPosted: Tue Jun 07, 2016 9:13 am
by krzycho
Collecting samples:
Code: Select all   for (i = 0; i < 600 && pos < 128; i++)
   {
      state[pos] = getState(GPIO_REG_READ(GPIO_IN_ADDRESS));
      stateTick[pos] = get_ccount();
      if (state[pos] != state[pos - 1])
      {
         pos++;
      }
   }

takes about 40-42 cycles@160mhz between getState(depends on IF in getState)

only usb 1.1 1.5mbps(low speed) devices could be supported- 106.6 cycles@160mhz between state changes

I'm working to connect USB low speed keyboard to ESP directly.

If someone is interested what is sent over wire when device gets connected:
Code: Select all802d0010
80c38006000100004000dd94
80d2
80690010
805a
80690010
805a
80690010
804b12011001000000081177
80d2
80690010
80c36d041cc300640102ba46
80d2
80690010
805a
80690010
804b00013f8f
80d2
80e10010
804b0000
80d2
802d0010
80c300051c0000000000e8a8
80d2
80690010
805a
80690010
804b0000
80d2
802d1cb8
80c38006000100001200e0f4
80d2
80691cb8
805a
80691cb8
805a
80691cb8
804b12011001000000081177
80d2
80691cb8
805a
80691cb8
80c36d041cc300640102ba46
80d2
80691cb8
805a
80691cb8
804b00013f8f
80d2
80e11cb8
804b0000
80d2
802d1cb8
80c3800600020000ff00e9a4
80d2
80691cb8
805a
80691cb8
805a
80691cb8
804b09023b00020103a00825
80d2
80691cb8
805a
80691cb8
80c32d090400000103017401
80d2
80691cb8
804b010209211001000175a6
80d2
80691cb8
805a
80691cb8
80c322410007058103088923
80d2
80691cb8
805a
80691cb8
804b000a090401000103a4c0
80d2
80691cb8
805a
80691cb8
80c30000020921100100687e
80d2
80691cb8
805a
80691cb8
804b01229f00070582035041
80d2
80691cb8
805a
80691cb8
80c30400ff8fbe
80d2
80e11cb8
804b0000
80d2
802d1cb8
80c3800600030000ff00d464
80d2
80691cb8
805a
80691cb8
805a
80691cb8
804b040309040978
80d2
80e11cb8
804b0000
80d2
802d1cb8
80c3800602030904ff0097db
80d2
80691cb8
805a
80691cb8
805a
80691cb8
804b1a035500530042002066
80d2
80691cb8
805a
80691cb8
80c320004b00650079008f0b
80d2
80691cb8
805a
80691cb8
804b62006f00610072000a06
80d2
80691cb8
805a
80691cb8
80c36400d48f
80d2
80e11cb8
804b0000
80d2