nodemcu / nodemcu-firmware

Lua based interactive firmware for ESP8266, ESP8285 and ESP32
https://nodemcu.readthedocs.io
MIT License
7.64k stars 3.12k forks source link

softuart not working #3516

Closed angrycans closed 2 years ago

angrycans commented 2 years ago

Expected behavior

on:data print data

Actual behavior

on:data not print data

Test code

-- Create new software UART with baudrate of 9600, D2 as Tx pin and D3 as Rx pin
s = softuart.setup(9600, 2, 3)
-- Set callback to run when 10 characters show up in the buffer
s:on("data", 10, function(data)
  print("Lua handler called!")
  print(data)
end)

NodeMCU startup banner

NodeMCU 3.0.0.0 built with Docker provided by frightanic.com branch: release commit: f25dc56d3c6213b8ac7ce46d1293466137746eae release: 3.0.0-release_20211229 +1 release DTS: 202112300746 SSL: false build type: float LFS: 0x10000 bytes total capacity modules: adc,bit,dht,file,gpio,i2c,mqtt,net,node,ow,softuart,spi,tmr,uart,u8g2,websocket,wifi build 2022-05-13 03:05 powered by Lua 5.1.4 on SDK 3.0.1-dev(fce080e)

Hardware

ESP8266 nodemcu v3