- Sun Mar 17, 2019 6:55 am
#81159
Hi there, I joined this forum because I got stuck in a similar problem.
I have nodeMCU ESP12. I try to read UART input at pin D7, 4800 bps.
(Data will be transmitted via WiFi, already working.)
My code:
uart.setup(1, 4800, 8, uart.PARITY_NONE, uart.STOPBITS_2, 1)
uart.alt(1) -- switch to pin D7 für RX
tmr.alarm(2, 500, tmr.ALARM_SINGLE, function() end) -- delay
uart.on("data", 1, function(data)
tmr.alarm(2, 500, tmr.ALARM_SINGLE, function() end -- delay
gpio.write(LED_PIN, gpio.LOW) -- blink indicates RX input
D=D..string.byte(data)
end, 0)
I have set D7 to
gpio.mode(7,gpio.INT)
I can see the LOW-RX with the oscilloscope, and the LED blinks, but no RX-input.
I have read in German and English manual contradictory statements.
I have read many many snippets an proposals, but did not find a solution for this problem.
My status / my questions:
Can I use D7 as UART-RX ?
Are there different solutions, RX-input connected to pin RX, code like this:
uart.alt(0)
uart.setup(0, 4800, 8, uart.PARITY_NONE, uart.STOPBITS_2, 1)
Any experience with ESP32? Tried but no success.
Any success with I2C-UART: SC16IS750? Tried but no success.
A WORKING sample for this issue would be great!
I hope anybody has experience with ESP8266-UART. - Thank you very much!
OM1