Basic Infos
Platform
- Hardware: [ESP-07]
- Core Version: [latest git hash or date]
- Development Env: [Arduino IDE]
- Operating System: [Windows]
Settings in IDE
- Module: [Nodemcu v1.0 (ESP12E Module) ]
- Flash Mode: [Not a Option]
- Flash Size: [4MB]
- lwip Variant: [v2 Lower Memory]
- Reset Method: [nodemcu]
- Flash Frequency: [Not a Option]
- CPU Frequency: [80Mhz]
- Upload Using: [SERIAL]
- Upload Speed: [115200] (serial upload only)
Problem Description
Nodemcu Serial.available(); function is not able to send total bytes available on serial it just send 1.
#include "Arduino.h"
void setup()
{
Serial.begin(9600);
}
String tmp = "";
void loop()
{
while (Serial.available() > 0)
{
Serial.println("data in buffer : ");
Serial.print(Serial.available());
Serial.println("\n");
tmp = Serial.readString();
}
if (tmp.length() > 4)
{
Serial.println("Data : " + tmp);
Serial.println("Data length : " + String(tmp.length()));
Serial.flush();
tmp = "";
}
}
Debug Messages
⸮R⸮⸮�⸮��⸮data in buffer :
1
Data : hi hi hi
Data length : 10
⸮R⸮⸮�⸮⸮�R⸮⸮fgFj⸮data in buffer :
1
Data : hihihih
Data length : 9
Basic Infos
Platform
Settings in IDE
Problem Description
Nodemcu
Serial.available();function is not able to send total bytes available on serial it just send 1.MCVE Sketch
Debug Messages