Data received through UART is split
Posted: Sun Mar 12, 2017 10:30 am
Hi
I am using the default UART on the nodeMCU board with the latest build from master branch.
The problem I am facing is that when I receive data, it gets split.
Here's the code:
When I send 6382548 from the serial terminal to the esp, it prints the following:
receive from uart: 6
receive from uart: 382548
Similarly for every data that is received on the esp through UART.
If I send 445, the esp receives 4 and 45 separately and unregisters the callback.
Could someone please help me with this problem?
Thanks
I am using the default UART on the nodeMCU board with the latest build from master branch.
The problem I am facing is that when I receive data, it gets split.
Here's the code:
Code: Select all
uart.on("data", 0, function(data)
print("receive from uart:", data)
if data==45 then
uart.on("data") -- unregister callback function
end
end, 0)
When I send 6382548 from the serial terminal to the esp, it prints the following:
receive from uart: 6
receive from uart: 382548
Similarly for every data that is received on the esp through UART.
If I send 445, the esp receives 4 and 45 separately and unregisters the callback.
Could someone please help me with this problem?
Thanks