dhruv_electro
Advanced Member level 4
Hardware
Hardware: ESP-12E
Core Version: 2.3.0
Settings in IDE
Module: Generic ESP8266 Module (ESP-12E)
Flash Size: 4MB/1MB
CPU Frequency: 80Mhz
Flash Mode: qio
Flash Frequency: 80Mhz
Upload Using: SERIAL
Reset Method: nodemcu
System Setup
I am using ESP-12E, a separate power supply and programing it with Serial to TTL in Arduino Eclipse Plug-in called Sloeber. I am using terminal.exe as my Serial Monitor. I have connected second Serial To TTL on D15-D13, for Serial.swap() UART.
Problem Description
I want to use Serial.swap() and send my application data on D15-D13 after boot-up in binary form. But after Serial.swap(), it can not send 0x00 data on UART. I have tried two sketches, which involves cases of not using and using of "Serial.swap()". I tried to send 0x00 0x01 0x02 in loop in both cases. Codes and Outputs are as follows:
Sketch 1 (successful)
Output at terminal.exe in HEX mode
Sketch 2 (problem)
Output 2 in terminal.exe in Hex mode
The problem is when I use Serial.swap() it does not send the 0x00 data on UART. Am I missing something? Please help.
Hardware: ESP-12E
Core Version: 2.3.0
Settings in IDE
Module: Generic ESP8266 Module (ESP-12E)
Flash Size: 4MB/1MB
CPU Frequency: 80Mhz
Flash Mode: qio
Flash Frequency: 80Mhz
Upload Using: SERIAL
Reset Method: nodemcu
System Setup
I am using ESP-12E, a separate power supply and programing it with Serial to TTL in Arduino Eclipse Plug-in called Sloeber. I am using terminal.exe as my Serial Monitor. I have connected second Serial To TTL on D15-D13, for Serial.swap() UART.
Problem Description
I want to use Serial.swap() and send my application data on D15-D13 after boot-up in binary form. But after Serial.swap(), it can not send 0x00 data on UART. I have tried two sketches, which involves cases of not using and using of "Serial.swap()". I tried to send 0x00 0x01 0x02 in loop in both cases. Codes and Outputs are as follows:
Sketch 1 (successful)
Code:
//The setup function is called once at startup of the sketch
void setup()
{
Serial.begin(115200);
}
// The loop function is called in an endless loop
void loop()
{
for(uint8_t i=0;i<3;i++)
{
Serial.write(i);
delay(1000);
}
}
Output at terminal.exe in HEX mode
Code:
00 01 02 00 01 02 00 01 02 00 01 02
Sketch 2 (problem)
Code:
//The setup function is called once at startup of the sketch
void setup()
{
Serial.begin(115200);
// Swap serial port to continue on other uart.
Serial.swap();
}
// The loop function is called in an endless loop
void loop()
{
for(uint8_t i=0;i<3;i++)
{
Serial.write(i);
delay(1000);
}
}
Output 2 in terminal.exe in Hex mode
Code:
01 02 01 02 01 02 01 02
The problem is when I use Serial.swap() it does not send the 0x00 data on UART. Am I missing something? Please help.