Hello! I'm trying to send a string over serial pins from an Arduino Nano ESP32 (the "parent") to a WROOM32 (the "child").
The Problem
I can see that the data is being sent by the parent to the serial monitor, but the child is not seeing anything at all coming in.
Hardware
Both boards are externally powered by 5V DC and grounded. They are grounded to each other. The Nano's Tx pin is connected to the Rx2 pin of the WROOM32, and the Nano's Rx pin is connected to the Tx2 pin of the WROOM32.
Firmware
I have a complex pair of scripts for controlling motors through Blynk software. The child MCU was needed to get more output pins.
The relevant simplification of the parent script is:
Oh I see, so Serial is used through the USB port, and Serial1 is used on the Tx/Rx pins? I've tried to replace the two instances of "Serial" with "Serial1" in my code, but I see no change when I monitor what's being received by the child. Is there another change I need to make besides this? I've searched for example scripts of Serial1 being used on the Nano ESP32 but could find none.
Can you please post a copy of your circuit, a picture of a hand drawn circuit in jpg, png?
Hand drawn and photographed is perfectly acceptable.
Please include ALL hardware, power supplies, component names and pin labels.
Hey Tom, thank you for your response! Hopefully you can invest some time in this, because it will take a while to include what you asked for.
I'm monitoring the serial using a USB on the WROOM32. As I understand it, the WROOM32 has two hardware serial (Rx/Tx [Serial in the code] and Rx2/Tx2 [Serial2 in the code]). Before making this circuit, I did a serial comm test where I connected two WROOM32s over Rx2/Tx2 [Serial2] and monitored over USB [Serial] and it worked perfectly. I assume it would also work the same way here, which is why I'm assuming the problem lies in the communication between the Nano ESP32 and the WROOM32, not in the multi-serial interactions within the WROOM32 itself.
As far as circuit and photos, I will get that to you shortly!
Tom! Sorry something came up. Here are the schematics and photos. I'll try to explain well enough, but let me know if you need any clarification. Thanks!
This is the schematic for the interaction in question. From left to right: motor drivers, battery, 5 V stepdown converter, WROOM32, Nano ESP32. Just the logic connections are shown for the drivers. 5V powers the MCUs. Rx/Tx on the Nano is connected to Tx2/Rx2 on the WROOM. WROOM is sending two logic outputs to each of the five drivers.
This is the schematic for part of my circuit controlled solely by the Nano. The battery and stepdown here are the same devices as in the first schematic. Not sure if any of the other devices may be relevant; from left to right: motor encoders, battery, 5 V stepdown, 5-3.3 V stepdown, 5-3.3 V logic level converters, Nano ESP32, motor drivers, motors.
Hey Tom, I was getting too far behind schedule with this that I ended up finding another workaround. All is good now
(The workaround is that I'm Blynk software to control the MCUs over virtual pins, and I initially just wanted one Blynk program communicating with the parent MCU, with the parent transferring necessary data to the child, but I instead just made a second Blynk program for the child which adds just a few extra button presses for the user to switch between them.)