Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Nodemcu with espusb #40

Closed
openscoreboard opened this issue Feb 17, 2018 · 22 comments
Closed

Nodemcu with espusb #40

openscoreboard opened this issue Feb 17, 2018 · 22 comments

Comments

@openscoreboard
Copy link

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
Copy link
Owner

cnlohr commented Feb 17, 2018

You need to flash the webpage.

Flash web/page.mpfs to 0x100000

Charles

@cnlohr
Copy link
Owner

cnlohr commented Feb 17, 2018

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

Charles

@openscoreboard
Copy link
Author

openscoreboard commented Feb 21, 2018

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
Copy link
Owner

cnlohr commented Feb 22, 2018

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
Copy link
Author

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

  • Connect NODEMCU by USB to PC (linux)
  • run commands make burn and make burnweb (my nodemcu blink the led)
    -Disconnect USB
    -Connect GPIO4+resistor+3v
    -Reconnect USB to PC
    -I think that no happend nothing

Thanks...

@cnlohr
Copy link
Owner

cnlohr commented Mar 3, 2018

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
Copy link
Author

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

@openscoreboard
Copy link
Author

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
Copy link
Owner

cnlohr commented Mar 3, 2018

Yep

@openscoreboard
Copy link
Author

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
Copy link
Owner

cnlohr commented Mar 4, 2018

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

@joBr99
Copy link

joBr99 commented Mar 31, 2018

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
Copy link
Author

openscoreboard commented Mar 31, 2018

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
Copy link

joBr99 commented Mar 31, 2018

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
Copy link
Owner

cnlohr commented Apr 1, 2018

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

@joBr99
Copy link

joBr99 commented Apr 1, 2018

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

@cnlohr
Copy link
Owner

cnlohr commented Apr 1, 2018

@joBr99 Would you mind uploading your binaries?

@joBr99
Copy link

joBr99 commented Apr 1, 2018

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
Copy link
Owner

cnlohr commented Apr 1, 2018

Thank you!

@cnlohr cnlohr closed this as completed Apr 1, 2018
@cnlohr
Copy link
Owner

cnlohr commented Apr 1, 2018

I am posting this thread to the main readme.

@ntinos97
Copy link

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
Copy link

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

5 participants