cnlohr / espusb

Software-only ESP8266 USB Device
Other
1.47k stars 230 forks source link

Nodemcu with espusb #40

Closed openscoreboard closed 6 years ago

openscoreboard commented 6 years ago

I have a nodemcu I can flash espusb inside I can connect my smartphone to 192.168.4.1 But i lost connection if push web buttons...

What schematic need for connect a nodemcu and work with espusb in mode hid?

Thank!!!

cnlohr commented 6 years ago

You need to flash the webpage.

Flash web/page.mpfs to 0x100000

Charles

cnlohr commented 6 years ago

Please see schematic info on this page: https://github.com/cnlohr/espusb

Charles

openscoreboard commented 6 years ago

I try flash to 0x100000 but the connection from smartphone lost again.... I see schematic too, but my nodemcu is a little diferent...

I have connect a resistor(>=1K) between 3,3v and gpio4

Is It ok my connection?

example

Thanks...

cnlohr commented 6 years ago

What resistor are you using? 1.5k is nominal. Connection should be ok.

Do you have access to a Linux computer, using dmesg it can make it much easier to understand what's going on.

openscoreboard commented 6 years ago

I have a resistor with 1,2K

And this is the output dmesg

[sáb mar 3 13:23:35 2018] ch341 2-2:1.0: device disconnected [sáb mar 3 13:23:40 2018] usb 2-2: new full-speed USB device number 5 using uhci_hcd [sáb mar 3 13:23:40 2018] usb 2-2: New USB device found, idVendor=1a86, idProduct=7523 [sáb mar 3 13:23:40 2018] usb 2-2: New USB device strings: Mfr=0, Product=2, SerialNumber=0 [sáb mar 3 13:23:40 2018] usb 2-2: Product: USB2.0-Serial [sáb mar 3 13:23:40 2018] ch341 2-2:1.0: ch341-uart converter detected [sáb mar 3 13:23:40 2018] usb 2-2: ch341-uart converter now attached to ttyUSB0

My steps

Thanks...

cnlohr commented 6 years ago

uuhhhh ... can you take a picture of your setup? I don't see where you're hooking the second USB in. Also, you should never need to unplug the NodeMCU usb. Just plug both USB plugs in.

openscoreboard commented 6 years ago

I have only one USB port connect to my PC. This is my connection image

openscoreboard commented 6 years ago

oooohhhh!!! I think I understood it now. It is necessary to connect a second USB to the GPIO5 (D +) and GPIO4 (D-) pin. This second USB is the works as HID Is correct?

cnlohr commented 6 years ago

Yep

openscoreboard commented 6 years ago

Now this is my setup

seleccion_014

One USB for flash and other for HID

This is my dmesg now...

[ 263.532501] ch341 3-1:1.0: device disconnected [ 270.544035] usb 3-1: new full-speed USB device number 4 using uhci_hcd [ 270.719080] usb 3-1: New USB device found, idVendor=1a86, idProduct=7523 [ 270.719085] usb 3-1: New USB device strings: Mfr=0, Product=2, SerialNumber=0 [ 270.719089] usb 3-1: Product: USB2.0-Serial [ 270.721268] ch341 3-1:1.0: ch341-uart converter detected [ 270.728196] usb 3-1: ch341-uart converter now attached to ttyUSB0 [ 280.808041] usb 5-2: new full-speed USB device number 14 using uhci_hcd [ 281.148045] usb 5-2: device descriptor read/64, error -71 [ 281.384144] usb 5-2: device descriptor read/64, error -71 [ 281.612035] usb 5-2: new full-speed USB device number 15 using uhci_hcd [ 281.740030] usb 5-2: device descriptor read/64, error -71 [ 281.976033] usb 5-2: device descriptor read/64, error -71 [ 282.204032] usb 5-2: new full-speed USB device number 16 using uhci_hcd [ 282.620032] usb 5-2: device not accepting address 16, error -71 [ 282.740030] usb 5-2: new full-speed USB device number 17 using uhci_hcd [ 283.156030] usb 5-2: device not accepting address 17, error -71 [ 283.156061] usb usb5-port2: unable to enumerate USB device

cnlohr commented 6 years ago

It is likely you've either flipped the D+/D- pins or some issue with the pullup resistor being large enough, etc.

joBr99 commented 6 years ago

I have an similar issue with my nodemcu, i tried to flash my own build of page.mpfs with the docker container and make burnweb and i tried to flash page.mpfs from your github repository. There appers no wifi network and dmesg says the following:

[ 2898.113377] usb 1-1.4: new full-speed USB device number 56 using dwc_otg [ 2898.246462] usb 1-1.4: New USB device found, idVendor=1a86, idProduct=7523 [ 2898.246476] usb 1-1.4: New USB device strings: Mfr=0, Product=2, SerialNumber=0 [ 2898.246484] usb 1-1.4: Product: USB2.0-Serial [ 2898.247557] ch341 1-1.4:1.0: ch341-uart converter detected [ 2898.250440] usb 1-1.4: ch341-uart converter now attached to ttyUSB0 [ 2949.163393] usb 1-1.2: new low-speed USB device number 57 using dwc_otg [ 2949.263395] usb 1-1.2: device descriptor read/64, error -32 [ 2949.483388] usb 1-1.2: device descriptor read/64, error -32 [ 2949.703389] usb 1-1.2: new low-speed USB device number 58 using dwc_otg [ 2949.803383] usb 1-1.2: device descriptor read/64, error -32 [ 2950.743390] usb 1-1.2: device descriptor read/64, error -32 [ 2950.863493] usb 1-1-port2: attempt power cycle [ 2951.523503] usb 1-1.2: new low-speed USB device number 59 using dwc_otg [ 2951.963388] usb 1-1.2: device not accepting address 59, error -32 [ 2952.063398] usb 1-1.2: new low-speed USB device number 60 using dwc_otg [ 2952.503395] usb 1-1.2: device not accepting address 60, error -32 [ 2952.503499] usb 1-1-port2: unable to enumerate USB device [ 2952.503814] usb 1-1.4: USB disconnect, device number 56 [ 2952.504402] ch341-uart ttyUSB0: ch341-uart converter now disconnected from ttyUSB0 [ 2952.504457] ch341 1-1.4:1.0: device disconnected [ 2952.803390] usb 1-1.4: new full-speed USB device number 61 using dwc_otg [ 2952.936588] usb 1-1.4: New USB device found, idVendor=1a86, idProduct=7523 [ 2952.936601] usb 1-1.4: New USB device strings: Mfr=0, Product=2, SerialNumber=0 [ 2952.936609] usb 1-1.4: Product: USB2.0-Serial [ 2952.937683] ch341 1-1.4:1.0: ch341-uart converter detected [ 2952.940305] usb 1-1.4: ch341-uart converter now attached to ttyUSB0

img_20180331_182621

openscoreboard commented 6 years ago

The last week i tried connect a wemos d1 and dont work for me.

I think that my firmware isnt ok. Is there a link to donwload the firmware pre-compiled?

Thanks

joBr99 commented 6 years ago

In this repository is a pre compiled firmware. You can flash it with the esptool and the following command: esptool.py -b 115200 --port /dev/ttyUSB0 write_flash 65536 web/page.mpfs

As I have already said it does not work for me, I will attach my compiled firmware too.

page.mpfs.zip

cnlohr commented 6 years ago

The page.mpfs is only the webpage... you'll need both the 0x0000 and 0x4000 binaries. I don't have them handy, sadly.

joBr99 commented 6 years ago

Thanks, I overlooked that ... now it is working.

cnlohr commented 6 years ago

@joBr99 Would you mind uploading your binaries?

joBr99 commented 6 years ago

esptool.py -b 115200 --port /dev/ttyUSB0 write_flash -fm dio 0x00000 image.elf-0x00000.bin 0x40000 image.elf-0x40000.bin esptool.py -b 115200 --port /dev/ttyUSB0 write_flash 65536 web/page.mpfs

espusb.zip

cnlohr commented 6 years ago

Thank you!

cnlohr commented 6 years ago

I am posting this thread to the main readme.

ntinos97 commented 4 years ago

esptool.py -b 115200 --port /dev/ttyUSB0 write_flash -fm dio 0x00000 image.elf-0x00000.bin 0x40000 image.elf-0x40000.bin esptool.py -b 115200 --port /dev/ttyUSB0 write_flash 65536 web/page.mpfs

espusb.zip

love you...i had all day until to find this solution... thank you so much

NicoAlmazan commented 2 years ago

Hello guys.. I think I f*** it up. Today I boght this Module I share with you in the picture. image

I tryed to make it work but I couldn´t. I even flashed it on the memory addresses you shared. image.elf-0x00000.bin 0x40000 image.elf-0x40000.bin and web/page.mpfs to 0x100000 It kindda work.. but it is not the interface I am used to see on videos and it does not even send commands to the module. This is what everybody sees:

image

This is what I see:

image

Can you guys please help me? Thank you