Hi everyone, I have connnected an apc220 to an esp32-Wroom and another apc220 to the Uno. But it has 1 problem: I only receive data when I turn off the esp32.
On the esp32 I have this code:
It sends a number to mySerial wich I have connected to the HardwareSerial 2 (RXD2 = GPIO16 and TXD2 = GPIO 17). The apc220 RX is connected to GPIO17 and TX is connected to GPIO16.
This is the code I run on the Uno:
When I run the code on the esp32, this comes in the Serial monitor:
I expect to receive the numbers on the Uno like this, but instead I get nothing.
But when I unplug the esp32 it does this:
It just prints all the data that is send.
I don't know what the problem is. But if I add this to the code on the esp32 in the loop() function: Serial.println(mySerial.readString()); it does work but very slow.
I have changed the module settings so they're the same: 433100 3 9 3 0. The esp32 is powered by a breadboard power supply with 3.3v. But I get the same problem by powering the esp32 with a usb-c.
At the start of your post you say that you are "turning off" the ESP32, but later on where you post the Serial Monitor output you say "when I unplug the esp32", so which is it? If unplug, then where from?
It's kinda both. So when it is connected to the breadboard power supply, it has a button where I turn it on and off.
But the same problem occurs when the esp32 is unplugged from the usb-c.
And you're right because it is a bit confusing if I keep switching the statements.
Well it might confuse things if you have both power sources connected at the same time. I was trying to establish whether the ESP was really being powered down or whether it was inadvertently receiving power from somewhere else. You see, as kmon said, if you power off the ESP, then it can no longer be transmitting, so from where are you still getting numbers on the UNO receiver?
That's what i thought when I first got this problem, like it only recieves the input if the esp32 is off.
Maybe it has something to do with the Uno's code? But to me it looks right.
What I was thinking when I asked about power supply, if you had power on APC still when disconnecting Esp, maybe APC transmitted what it had in buffer. But according to your wiring that's not possible...
Can't be esp32.
Either transmitting APC sends the whole buffer when you disconnect power or receiving APC gives the whole buffer to Uno when the transmitter stops transmitting....
Doesn't sound like normal behavior.
You could connect enable pins to high.