Serial REPL not responding

All ESP8266 boards running MicroPython.
Official boards are the Adafruit Huzzah and Feather boards.
Target audience: MicroPython users with an ESP8266 board.
Post Reply
User avatar
liudr
Posts: 211
Joined: Tue Oct 17, 2017 5:18 am

Serial REPL not responding

Post by liudr » Tue Oct 24, 2017 6:05 pm

I enabled webrepl and played with it a bit, connecting to it etc. It's very cool. But after that I tried to connect to its serial repl and it looked ok but wasn't taking any inputs. I reset multiple times and then erased firmware and reloaded everything (this time I didn't enable webrepl). It still didn't work. I also pushed reset button several times. And all of a sudden it just worked. I tried my board on a second computer with the same symptom when it was still not working. Has anyone experienced similar things before? The prompt was displaying (>>>) the whole time before and after firmware reload.

User avatar
Roberthh
Posts: 3667
Joined: Sat May 09, 2015 4:13 pm
Location: Rhineland, Europe

Re: Serial REPL not responding

Post by Roberthh » Tue Oct 24, 2017 9:04 pm

I had a similar experience with an ESP32 board, wich stopped responding a few minutes after turning it on. It was caused by bad soldering, only visible with a good magnifying lens. After resoldering now it woks fine.
Even if it does not look like that in your case, it could be a intermittent hardware problem.

User avatar
pythoncoder
Posts: 5956
Joined: Fri Jul 18, 2014 8:01 am
Location: UK
Contact:

Re: Serial REPL not responding

Post by pythoncoder » Wed Oct 25, 2017 6:19 am

I'll second that - on good hardware the ESP8266 serial REPL is reliable. The other hardware issue is to check the power supply.
Peter Hinch
Index to my micropython libraries.

User avatar
liudr
Posts: 211
Joined: Tue Oct 17, 2017 5:18 am

Re: Serial REPL not responding

Post by liudr » Wed Oct 25, 2017 5:24 pm

I have a NODEMCU I bought from banggood. It looks decent but the serial REPL lockup has been happening a lot lately. There is no good way to get it out of locked state. Here are some of my additional suspicions besides bad soldering:

1. The voltage of the "5V" may be too low. I measured once with an ADS1115 to be 4.6V on my system. I'll do a careful measurement with a multimeter. There might be a diode on the USB supply that drops 0.3V and then the USB port actual output voltage depends on computer and load.
2. The CP2102 chip is not working properly causing occasional lockups. I tried sending files to 8266 using ampy after a serial lockup and it worked multiple times but not necessarily always removing the lockup.
3. Too much current drain. I have a PCF8574 LCD backpack. The back light is very darn bright. It's only supposed to light up enough to show text in darkness, not lighting the room. I guess rookies think backlights should be very bright so do ebay sellers. The lcd library I use activates back light upon init. I may have to change the code.
4. Breadboard issues. My pullup resistors on I2C are not very tight, with very thin wires compared with thick wires that 1/4W resistors used to come with.

Anyway, I'm getting a wemos d1 mini to see if the CP2102 is the issue. While waiting, I'll solder an ESP-12E to a breakout board and add an FTDI chip for serial.

I am wondering, since the chips inside the ESP-12E modules are reflow soldered, if I were to reflow the module on a board, would I damage the reflow of the chips inside the metal cap? I suspect lead solder may have been used. If I use lead-free solder to reflow the module, the lead solder may liquefy and flow away or make bridges. Any advice on how to safely reflow a module to a board? I may just design a board with all my components on it to remove any suspicion of loose wiring.

User avatar
liudr
Posts: 211
Joined: Tue Oct 17, 2017 5:18 am

Re: Serial REPL not responding

Post by liudr » Wed Oct 25, 2017 11:45 pm

It's troubling. I used my logic analyzer to read the 3V3 and 5V sides of the logic level converter. The 3V3 side looks OK but the 5V side is bad. It almost looks like some sort of capacitive coupling, when there is supposed to be a clock pulse on 3V3 SCL, there is only a very narrow pulse on the 5V side. Whenever I put a channel on the 3V3 SCL line, the I2C stops working. No scan reveals any devices and no signals on either SCL or SDA according to my analyzer. Maybe the TXB0108 is just not the right level converter for I2C. Both sides have pullups, 10K on 3V3 side and 4.7K on 5V side.

User avatar
pythoncoder
Posts: 5956
Joined: Fri Jul 18, 2014 8:01 am
Location: UK
Contact:

Re: Serial REPL not responding

Post by pythoncoder » Thu Oct 26, 2017 7:02 am

The WeMos D1 Mini is reliable.

As for the TXB0108 I don't think this is suitable for I2C which requires open drain drivers. There are logic level converters specifically designed for I2C.
Peter Hinch
Index to my micropython libraries.

User avatar
liudr
Posts: 211
Joined: Tue Oct 17, 2017 5:18 am

Re: Serial REPL not responding

Post by liudr » Thu Oct 26, 2017 1:57 pm

Thanks. I've purchased some n-channel MOSFET based level shifters that are said to work with I2C. I'm switching out the 0108. I'll be able to see some improvement this weekend when the new level shifters arrive.

BTW, there is indeed a diode on the NODEMCU board and after the diode the voltage drops from 5.10V to 4.68V, which is sufficient for CP2102. If the 3V3 supply is an LM1117-3.3, then I suspect 4.75V or more is required to generate 3.3V output. The 3V3 rail measures 3.25V only. That could be the reason for the serial REPL lockup.

User avatar
Roberthh
Posts: 3667
Joined: Sat May 09, 2015 4:13 pm
Location: Rhineland, Europe

Re: Serial REPL not responding

Post by Roberthh » Thu Oct 26, 2017 3:20 pm

Supply voltage tolerances are typically at least +/- 10%. The ESP8266 is specified fo a VDD range of 2.5 - 3.6V, and 3.25V is well within the specs of the LD1117 regulator, which should have a dropout of about 1V at 200 mA. So that looks well for me. If there is a voltage problem, then small dropouts are more likely, caused by transmission. What happens if you turn WiFI off? Then there are not short power drains any more.

User avatar
liudr
Posts: 211
Joined: Tue Oct 17, 2017 5:18 am

Re: Serial REPL not responding

Post by liudr » Thu Oct 26, 2017 4:20 pm

What's the correct way to turn off wifi? How do I issue commands that are persistent through reboots? Thanks.

User avatar
liudr
Posts: 211
Joined: Tue Oct 17, 2017 5:18 am

Re: Serial REPL not responding

Post by liudr » Sun Oct 29, 2017 12:58 am

I got n-channel MOSFET bidirectional level shifters in the mail. All is good with the I2C devices.
FYI, I was using a usb hub I got from adafruit. It further drops the 5V by about 0.3V so after the hub and the diode on NODEMCU my 5 is only about 4.3V and 3.3V is about 3.15V.

I might move up to ESP32 to get more pins but my experience with serial REPL is definitely positive despite the freeze-ups. I'll see if I get any freeze-ups after I switched to the new level shifters.

Post Reply