Connecting ProMini and ESP8266 together via uart but not able to upload sketch

Hello,

I’m looking for a good idea how I can solve the issue with uploading a sketch to a Pro Mini and a ESP8266 via Uart. They both are connected to each other and send regularly data. When trying to update one of the two there is interference because it basically looks like this
USB TX → RX AVR ← TX ESP8266

One solution came to my mind is pulling down the reset of the other board that interfere with its transmission. If pushing manually the reset button that works. So I need to trigger that reset somehow during the entire time when one of the boards is being updated.

How would you solve it? Is it maybe possible to pull a pin high during the bootloader receives the new update?

reset is low. connect the reset pin to ground.

it can't work for both. esp is to usb connected rx-rx tx-tx

maybe I get you wrong but pushing manually the others reset button definitely works

What ESP module do you have?

Can you show a proper schematic of your wiring?

timtailors:
maybe I get you wrong but pushing manually the others reset button definitely works

usb adapter is smart? or esp?

Hi,

I have ESP8266-12 and 7/7s

attached a schematic. For normal operation you have to close the jumpers and for programming remove them.
I’m using CP2102/CH340g (basically they do all the same job)

old.png shows my first circuit but had no inline resistor protection which killed the RX-pin regularly when connected wrong on the breadboard.
The right part of the circuit is for auto reset of the esp, it’s in the new circuit as well but doesnt play a role in my question

boards.jpg shows the whole thing simplified

Bildschirmfoto 2017-11-23 um 21.55.28.png

So you have a WeMOS board. Which indeed has an ESP12 module on board, but also a USB adapter. I was already wondering if you really went through the trouble of adding reset buttons and so.

Why don't you just connect that board directly to the USB and upload that way? Much easier.

Otherwise you'll at least need a resistor on the Arduino's Tx pin to bring down the voltage, and prevent breaking the WeMOS.

Hi, yes actually I manufactured a pcb which has the auto reset etc. It's more or less those two boards redesigned on a single pcb with some other additional hardware

For testing I'm also using the Wemos board + Uno as it has the inbuild USB adaptor.

Why don't you just connect that board directly to the USB and upload that way?

Because it doesnt work if the two boards are connected when uploading the sketch. That's the problem and my question what to change :wink:

for inspiration Robot Dyn Uno + WiFi board. scroll down to the table

On this board exists the same problem which I'm trying to solve..

timtailors:
On this board exists the same problem which I'm trying to solve..

they simply switch the lines of rx/tx between chips. What you want do better?

They also have to disconnect the two chips when flashing one of those.
I need to do that automatically without removing the connection by hand

How do you plan to detect which chip should be flashed?

That's why I'm asking here. One first idea is that the bootloader of the device which gets flashed pulls an output high which is connected to the other device's reset. So during uploading the other device's reset is high and so didnt send any text which can interfere

EDIT:
Ah maybe you mean how I choose which chips will be flashed? In the Arduino IDE I select the port

back to problem X. why is it a problem to toggle a switch on the board before pushing Upload button in IDE?

btw: I have a WiFi solution for upload to both chips.

because I dont want an additional external switch for that and also dont want to open the case every time i flash it new. but that's not the question

what would be your wifi solution? I tried ota for esp8266 but there you dont have the terminal window of the IDE working?

and how do you plan to put esp gpio0 low to enter bootloader mode at reset?

one chip must be in reset and the second in bootloader mode.

some boards (Primo) have a third chip to manage this

the ota solution is for the project which doesn't use USB

oh come on, we're on page 2 now...that's not the issue of this topic. I have two transistors in my circuit which does that and anyway also the wemos board has this. You just plug in the usb cable and press upload on the program

one chip must be in reset and the second in bootloader mode.

that's what I just wrote could be an idea for a solution

I will what the Primio is about

DTR. ok. sorry.

on DTR signal USB chip resets both mcu. ATmega waits only short time for the program, esp prints one short line and then waits forever. and makes nothing.
a modified booltloader for the ATmega could detect the sync frame packet for the ESP and simply disable the ATmega.

That's a good idea but there you could also just simply put a delay of 10s or so in setup() I guess?
The only disadvantage would be that you have to wait that long ever time you turn the whole device on till it's executing the programs