简体   繁体   English

ESP8266 NodeMCU MicroPython 垃圾串行,无法擦除_flash 或上传文件

[英]ESP8266 NodeMCU MicroPython garbage in serial, cannot erase_flash or upload files

Looks like I broke my NodeMCU Lolin esp8266 module, please confirm)看起来我弄坏了我的 NodeMCU Lolin esp8266 模块,请确认)

Firstly everything worked fine, but then...首先一切正常,但随后......

  1. I uploaded a bit strange boot.py to play with UART0我上传了一个有点奇怪的boot.py来玩UART0
#boot.py
import uos, machine
import gc
gc.collect()

import esp
import time

esp.osdebug(None)
uart = machine.UART(0, 115200)

def uart_test():
    print('before disabling REPL on UART')
    uos.dupterm(None, 1) # disable REPL on UART(0)
    print('after detaching REPL')
    time.sleep(5)
    uart.write('123')
    r=uart.read()
    # reattach REPL
    uos.dupterm(uart, 1)
    print('after attaching REPL')
    print('r: ')
    print(r)
  1. Then I uploaded main.py with blink in infinity loop with time.sleep() to check state while I mount module in box.然后我用main.py () 在无限循环中使用闪烁上传main.py以检查状态,同时我在框中安装模块。
#main.py
import time
from machine import Pin, Signal

led = Signal(2, mode=Pin.OUT, invert=True)
while True:
    led.on()
    time.sleep(1)
    led.off()
    time.sleep(1)
  1. Then, when I was mounting module in box I accidentally tore one element from PCB, but then solder it back.然后,当我将模块安装到盒子中时,我不小心从 PCB 上撕下了一个元件,然后将其焊回。 I don't know what is this element and what purpose of it.我不知道这个元素是什么以及它的目的是什么。 I marked this element on image IMG: broken element我在图像IMG上标记了这个元素:broken element

And after all of that I cannot connect to module by serial port, I see only garbage in screen, tried different baud rates.毕竟我无法通过串口连接到模块,我在屏幕上只看到垃圾,尝试了不同的波特率。 IMG: screen is empty and doesen't react to keys or Ctrl+C IMG:屏幕为空,对按键或 Ctrl+C 没有反应

After resetting board only garbage in screen IMG: garbage after reset重置后只有屏幕IMG 中的垃圾:重置后的垃圾

Also I cannot erase flash using esptool .我也无法使用esptool擦除闪存。

MCU is working because when it powered led is blinking as it programmed in main.py MCU 正在工作,因为当它通电时 LED 闪烁,因为它在main.py编程

I tried to enable bootloader mode by connecting GPIO0 with GND , blink is not working in this mode, but esptool.py also doesn't work in this mode.我试图通过将GPIO0GND连接来启用引导加载程序模式,blink 在这种模式下不起作用,但esptool.py在这种模式下也不起作用。 esptool log esptool 日志

python3 -m esptool --port /dev/cu.usbserial-142240 --baud 9600 erase_flash
esptool.py v3.1
Serial port /dev/cu.usbserial-142240
Connecting........_____....._____....._____....._____....._____....._____....._____

A fatal error occurred: Failed to connect to Espressif device: Timed out waiting for packet header

esptool log with --trace arg带有 --trace arg 的 esptool 日志

python3 -m esptool --port /dev/cu.usbserial-142240 --baud 115200 --trace erase_flash
esptool.py v3.1
Serial port /dev/cu.usbserial-142240
Connecting...TRACE +0.000 command op=0x08 data len=36 wait_response=1 timeout=0.100 data=
    0707122055555555 5555555555555555 | ... UUUUUUUUUUUU
    5555555555555555 5555555555555555 | UUUUUUUUUUUUUUUU
    55555555                          | UUUU
TRACE +0.000 Write 46 bytes: 
    c000082400000000 0007071220555555 | ...$........ UUU
    5555555555555555 5555555555555555 | UUUUUUUUUUUUUUUU
    5555555555555555 5555555555c0     | UUUUUUUUUUUUU.
TRACE +0.023 Read 1 bytes: e2
TRACE +0.000 Read invalid data: e2
TRACE +0.000 Remaining data in serial buffer: 
    6efe6ee43cfe2792 07eceeee708ef21c | n.n.<.'.....p...
    1e0e1c906e6c6c1c 9227c71eeee76c   | ....nll..'....l
.TRACE +0.056 command op=0x08 data len=36 wait_response=1 timeout=0.100 data=
    0707122055555555 5555555555555555 | ... UUUUUUUUUUUU
    5555555555555555 5555555555555555 | UUUUUUUUUUUUUUUU
    55555555                          | UUUU
TRACE +0.000 Write 46 bytes: 
    c000082400000000 0007071220555555 | ...$........ UUU
    5555555555555555 5555555555555555 | UUUUUUUUUUUUUUUU
    5555555555555555 5555555555c0     | UUUUUUUUUUUUU.
TRACE +0.002 Read 1 bytes: ee
TRACE +0.000 Read invalid data: ee
TRACE +0.000 Remaining data in serial buffer: 
    240eec6e9c9c8c9c e70e026c6ce4ee9c | $..n.......ll...
    6e6e00f26c62e4ee 70e26ee2ec626c   | nn..lb..p.n..bl
...
# and a lot of similar messages

What is with my nodemcu module is it died or not?我的 nodemcu 模块是怎么死的? What can I try to do?我可以尝试做什么?

It's more likely that you are experiencing hardware related issues than software related issues as you imply yourself.与您暗示的软件相关问题相比,您遇到硬件相关问题的可能性更大。

Re-solder the part that broke off and try again.重新焊接断掉的部分,然后再试一次。 You probably broke of a resistor/capacitor that is used for noise filtering the output (I am not a hardware guy) or something that is vital to regulating the voltage required for the board to operate.您可能损坏了用于过滤输出噪声的电阻器/电容器(我不是硬件人员)或对调节电路板运行所需的电压至关重要的东西。

EDIT编辑

As indicated by: https://raw.githubusercontent.com/hallard/NodeMCU-Gateway/master/pictures/NodeMCU-Lora-Gateway-top.png it seems, albeit that board is of a different design, that you broke off a capacitor.如: https : //raw.githubusercontent.com/hallard/NodeMCU-Gateway/master/pictures/NodeMCU-Lora-Gateway-top.png所示,虽然该板的设计不同,但您似乎断开了电容器。 Either resolder or get yourself a new one (100nf)转焊或给自己买一个新的(100nf)

Conclusion:结论:

Today I received USB to UART converter, connected it to TX and RX of my ESP8266 board and everything works well.今天我收到了 USB 到 UART 转换器,将它连接到我的 ESP8266 板的 TX 和 RX,一切正常。 So the problem is with onboard CH340 converter.所以问题出在板载 CH340 转换器上。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM