boot failure when connected to powered relay board [Solved]

All ESP32 boards running MicroPython.
Target audience: MicroPython users with an ESP32 board.
Post Reply
clueleescris
Posts: 3
Joined: Mon Jan 15, 2018 3:15 pm

boot failure when connected to powered relay board [Solved]

Post by clueleescris » Mon Jan 15, 2018 3:47 pm

Forgive me I am a newbie to microcontrollers (hence the desire to use (micro)Python rather than C).

I am still experimenting and getting to know my way around.

I have a DOIT esp32 development board and have successfully loaded microPython on it and used it to play with leds, touch panels and some sensors. I am now trying to use a 8 channel relay board with it. Ultimately I want it to control remote lighting using MQTT.

I have been able to control all relays through the repl and written simple functions to cycle through relays, all on all off, etc. All work fine through the repl. My problem comes when I create a main.py with the test functions and power up (or hard reset in the repl). It does work when I do a soft reset from the repl.

If the relay board is powered the DOIT board will not fully boot into microPython. Viewing the terminal I see repeated errors which continue add infinitum until I remove the power from the relay board. An extract of the errors displayed is:

rst:0x10 (RTCWDT_RTC_RESET),boot:0x33 (SPI_FAST_FLASH_BOOT)
flash read err, 1000
ets_main.c 371
ets Jun 8 2016 00:22:57

rst:0x10 (RTCWDT_RTC_RESET),boot:0x33 (SPI_FAST_FLASH_BOOT)
flash read err, 1000
ets_main.c 371
ets Jun 8 2016 00:22:57

rst:0x10 (RTCWDT_RTC_RESET),boot:0x33 (SPI_FAST_FLASH_BOOT)
flash read err, 1000
ets_main.c 371
ets Jun 8 2016 00:22:57

rst:0x10 (RTCWDT_RTC_RESET),boot:0x33 (SPI_FAST_FLASH_BOOT)
flash read err, 1000
ets_main.c 371
ets Jun 8 2016 00:22:57

rst:0x10 (RTCWDT_RTC_RESET),boot:0x33 (SPI_FAST_FLASH_BOOT)
flash read err, 1000
ets_main.c 371
ets Jun 8 2016 00:22:57

The above problems occur whether or not the board is powered by VN from the DOIT or by separate 5V power supply. VN is 5V (from USB)

As I say if I remove the power from the relay board the errors stop and the microPython starts OK and main.py is executed.

Inputs to the relay board are attached to pins 12,13,14,25,26,27,32,33.

Anyone able to shed any light on this for me?

Thanks.
Last edited by clueleescris on Tue Jan 16, 2018 5:28 pm, edited 1 time in total.

Swessels
Posts: 6
Joined: Fri Dec 22, 2017 4:20 pm
Location: Germany

Re: boot failure when connected to powered relay board

Post by Swessels » Tue Jan 16, 2018 8:07 am

- Check the supply voltage with the relay board connected.
- the ESP has 3.3V IO's. Maybe your relay board requires 5V at its inputs.
- the power consumption of the relay board inputs may be to high.

Regards,
Stefan

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

Re: boot failure when connected to powered relay board

Post by Roberthh » Tue Jan 16, 2018 8:22 am

According to the ES32 data sheet (http://www.espressif.com/sites/default/ ... eet_en.pdf), Page 10, Pin 12 (or MTDI) is one of the strapping pins, next to 0, 2, 5 and 15. Their status at cold boot time is critical. Try to avoid these, unless you exactly know it is not critical..

clueleescris
Posts: 3
Joined: Mon Jan 15, 2018 3:15 pm

Re: boot failure when connected to powered relay board

Post by clueleescris » Tue Jan 16, 2018 11:04 am

[quote=Swessels post_id=24663 time=1516090041 user_id=3526]
- Check the supply voltage with the relay board connected.
- the ESP has 3.3V IO's. Maybe your relay board requires 5V at its inputs.
- the power consumption of the relay board inputs may be to high.
[/quote]

Thanks for the reply. This board has a published trigger voltage range of 1 to 15v, although the relays rely on a 5v supply.

The board works fine once microPython is running and current drain with all relays on (approx. 320mA) seems well within the doit board (approx. 600mA).

The problem was actually me not realising one of the pins used was a strapping pin (pin 12) and the impact that would have on power up of the DOIT board. See my replay to Robert, below.

Thanks again,

Cris

clueleescris
Posts: 3
Joined: Mon Jan 15, 2018 3:15 pm

Re: boot failure when connected to powered relay board

Post by clueleescris » Tue Jan 16, 2018 11:06 am

Roberthh,

[quote=Roberthh post_id=24665 time=1516090952 user_id=601]
According to the ES32 data sheet (http://www.espressif.com/sites/default/ ... eet_en.pdf), Page 10, Pin 12 (or MTDI) is one of the strapping pins, next to 0, 2, 5 and 15. Their status at cold boot time is critical. Try to avoid these, unless you exactly know it is not critical..
[/quote]

Taking Pin 12 out did it. Many, many thanks. I still have a lot to learn. On to getting a reliable, robust wifi connection and MQTT working....

Thanks again.

Cris

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

Re: boot failure when connected to powered relay board

Post by pythoncoder » Wed Jan 17, 2018 5:59 am

clueleescris wrote:
Tue Jan 16, 2018 11:06 am
... On to getting a reliable, robust wifi connection...
I think you'll have to wait for a new major release of the firmware for this. The official ESP32 port is still somewhat experimental. See this bug report.
Peter Hinch
Index to my micropython libraries.

Post Reply