@/dev
I tried use another ESP8266 and the result is the same... Only TX working...
This is my sketch on ESP8266, he gets data from Arduino UNO, and when i connect wire to TX so, it's working, but, when i connect wire to RX it doesn't work.... So strange.. becouse, when i change pins (21,22) --> (22,21) , the result is the same.. only TX working...
/*
Software serial multple serial test
Receives from the two software serial ports,
sends to the hardware serial port.
In order to listen on a software port, you call port.listen().
When using two software serial ports, you have to switch ports
by listen()ing on each one in turn. Pick a logical time to switch
ports, like the end of an expected transmission, or when the
buffer is empty. This example switches ports when there is nothing
more to read from a port
The circuit:
Two devices which communicate serially are needed.
* First serial device's TX attached to digital pin 10(RX), RX to pin 11(TX)
* Second serial device's TX attached to digital pin 8(RX), RX to pin 9(TX)
Note:
Not all pins on the Mega and Mega 2560 support change interrupts,
so only the following can be used for RX:
10, 11, 12, 13, 50, 51, 52, 53, 62, 63, 64, 65, 66, 67, 68, 69
Not all pins on the Leonardo support change interrupts,
so only the following can be used for RX:
8, 9, 10, 11, 14 (MISO), 15 (SCK), 16 (MOSI).
created 18 Apr. 2011
modified 19 March 2016
by Tom Igoe
based on Mikal Hart's twoPortRXExample
This example code is in the public domain.
*/
#include <SoftwareSerial.h>
// software serial #1: RX = digital pin 10, TX = digital pin 11
// software serial #2: RX = digital pin 8, TX = digital pin 9
// on the Mega, usae other pins instead, since 8 and 9 don't work on the Mega
SoftwareSerial portTwo(21,22);
void setup() {
// Open serial communications and wait for port to open:
Serial.begin(9600);
portTwo.begin(9600);
// Start each software serial port
}
void loop() {
while (portTwo.available() > 0) {
char c=portTwo.read();
Serial.print(c);
}
}