Trouble getting a Serial Repl

All ESP32 boards running MicroPython.
Target audience: MicroPython users with an ESP32 board.
Post Reply
DavidRKnowles
Posts: 9
Joined: Mon Sep 23, 2019 10:11 am

Trouble getting a Serial Repl

Post by DavidRKnowles » Wed Feb 05, 2020 4:10 am

Hi guys,

I have a nodemcu esp32 (well two of them), this one seems to have some form of issue with the connection

Behaviour
It flashes fine as long as you hold the boot button while resetting then run the esptool.py flasher and as that is connecting release the boot/gpio0.

It will not connect in uPyCraft or Putty.

It connects fine in Arduino and you can use the serial monitor to issue and receive signals fine.

It also won't connect with uPyCraft or Putty by using the serial rx0/tx0 connection over another serial device but works fine with the Arduino serial connection.

I have flashed it with about every form of micropython for esp32's I could find, and with no success.
I used the Arduino serial connection to connect the wifi and webrepl and they work fine, but trying to get a serial connection just won't work.

Any Idea's what this could be? I am at a total loss.

User avatar
jimmo
Posts: 1837
Joined: Tue Aug 08, 2017 1:57 am
Location: Sydney, Australia
Contact:

Re: Trouble getting a Serial Repl

Post by jimmo » Wed Feb 05, 2020 4:36 am

Just to clarify -- what you're saying is that the Arduino serial monitor works (both with the onboard uart/usb adaptor, and with an external one wired directly to the TX/RX pins on the ESP32), and PuTTY / uPyCraft don't work in either configuration?

My guess is that it's got to be something about which COM port / baud rate that you're using. Somehow the Arduino serial monitor has the correct setting, but the others don't. (Baud rate should be 115200).

DavidRKnowles
Posts: 9
Joined: Mon Sep 23, 2019 10:11 am

Re: Trouble getting a Serial Repl

Post by DavidRKnowles » Wed Feb 05, 2020 5:29 am

jimmo wrote:
Wed Feb 05, 2020 4:36 am
Just to clarify -- what you're saying is that the Arduino serial monitor works (both with the onboard uart/usb adaptor, and with an external one wired directly to the TX/RX pins on the ESP32), and PuTTY / uPyCraft don't work in either configuration?
Yes, that is exactly correct.
My guess is that it's got to be something about which COM port / baud rate that you're using. Somehow the Arduino serial monitor has the correct setting, but the others don't. (Baud rate should be 115200).
That's what I thought too, but baudrate, bytresize, stopbit are all the same, even if I grab another MCU with micrpython on it and plug it in, that works fine.

The only thing I can think of is there is some sort of a handshake over the UART that's not taking place, as the problem is happening both with USB and UART0.

This is the serial restart output in the Arduino monitor, but everything seems normal:

Code: Select all

rst:0x1 (POWERON_RESET),boot:0x13 (SPI_FAST_FLASH_BOOT)
configsip: 0, SPIWP:0xee
clk_drv:0x00,q_drv:0x00,d_drv:0x00,cs0_drv:0x00,hd_drv:0x00,wp_drv:0x00
mode:DIO, clock div:2
load:0x3fff0018,len:4
load:0x3fff001c,len:5008
ho 0 tail 12 room 4
load:0x40078000,len:10600
ho 0 tail 12 room 4
load:0x40080400,len:5684
entry 0x400806bc
[0;32mI (531) cpu_start: Pro cpu up.[0m
[0;32mI (531) cpu_start: Application information:[0m
[0;32mI (531) cpu_start: Compile time:     Feb  5 2020 00:37:26[0m
[0;32mI (534) cpu_start: ELF file SHA256:  0000000000000000...[0m
[0;32mI (540) cpu_start: ESP-IDF:          v3.3.1[0m
[0;32mI (545) cpu_start: Starting app cpu, entry point is 0x400836dc[0m
[0;32mI (0) cpu_start: App cpu up.[0m
[0;32mI (555) heap_init: Initializing. RAM available for dynamic allocation:[0m
[0;32mI (562) heap_init: At 3FFAFF10 len 000000F0 (0 KiB): DRAM[0m
[0;32mI (568) heap_init: At 3FFB6388 len 00001C78 (7 KiB): DRAM[0m
[0;32mI (574) heap_init: At 3FFB9A20 len 00004108 (16 KiB): DRAM[0m
[0;32mI (580) heap_init: At 3FFBDB5C len 00000004 (0 KiB): DRAM[0m
[0;32mI (587) heap_init: At 3FFCC810 len 000137F0 (77 KiB): DRAM[0m
[0;32mI (593) heap_init: At 3FFE0440 len 00003AE0 (14 KiB): D/IRAM[0m
[0;32mI (599) heap_init: At 3FFE4350 len 0001BCB0 (111 KiB): D/IRAM[0m
[0;32mI (605) heap_init: At 40099A70 len 00006590 (25 KiB): IRAM[0m
[0;32mI (612) cpu_start: Pro cpu start user code[0m
[0;32mI (295) cpu_start: Starting scheduler on PRO CPU.[0m
[0;32mI (0) cpu_start: Starting scheduler on APP CPU.[0m
MicroPython v1.12-137-gd6a1e45ca on 2020-02-05; ESP32 module with ESP32
Type "help()" for more information.


DavidRKnowles
Posts: 9
Joined: Mon Sep 23, 2019 10:11 am

Re: Trouble getting a Serial Repl

Post by DavidRKnowles » Wed Feb 05, 2020 7:06 am

Also just tried to serial in via Python with the serial module,

This connected to the port but nothing was received back when I sent a couple of bytes, this worked fine with my other flashed micropython nodemcu.

DavidRKnowles
Posts: 9
Joined: Mon Sep 23, 2019 10:11 am

Re: Trouble getting a Serial Repl

Post by DavidRKnowles » Sun Feb 09, 2020 12:30 am

Ok some more detecting over the weekend,

I have noticed I can't get a serial connection through the Arduino serial monitor if I use directly onboard power to either 3.3v or using the onboard regulator with 5v to the vcc pin.

It only works with Arduino serial monitor if the board is powered via the USB.

So my guess is there is some issue on the actual dev board and there is something preventing a reliable serial connection.

I am going to detach the USB chip to see if that is the issue, and if that doesn't work I'll just remove the wroom32 package off the dev board for another project.

DavidRKnowles
Posts: 9
Joined: Mon Sep 23, 2019 10:11 am

Re: Trouble getting a Serial Repl

Post by DavidRKnowles » Sun Feb 09, 2020 1:08 am

Well, it was the usb-uart bridge, desoldered it and I am able to get a REPL fine in all applications using my own bridge on UART0.

Bit of pain and detective work, sucks when its the hardware :(

Post Reply