← index #8794Issue #5263
Related · high · value 0.701
QUERY · ISSUE

UART sendbreak bug

openby AeroSynthopened 2022-06-21updated 2022-06-28

There is a bug with the uart.sendbreak() method with V1.17 (haven't checked the latest)

The manual states the break signal lasts 13 bits. It actually is 11.
This has caused errors with external sensors that utilize the SDI-12 protocol. .The line needs to go for at least 12ms. Now, it is 9.167 ms. Even 13 bits is not long enough.
A good solution is to add a property where you can specify how many bits you can use.
SDI-12 is popular in agriculture and other industrial applications. (www.sdi-12.org)

CANDIDATE · ISSUE

ESP32 Uart TX-error using UART.sendbreak()

closedby ImoogDiopened 2019-10-27updated 2019-10-28
port-esp32

I'm using the UART-class to send messages over serial line.
Any message is terminated with the 'BREAK'-signal.
It works so far sending more then 1 char's.
But in that special case sending only 1 char terminated with the UART.sendbreak() call,
the leading char will be overwritten or destructed.
Also the call UART.wait_tx_done(100) before sending the BREAK-signal doesn't help.
Only the call: time.sleep(0.002) before UART.sendbreak() will help a bit.
Used code:
...
uart1 = UART(1, baudrate=9600)
while True:
uart1.write('A')
while uart1.wait_tx_done(100) == False:
pass
# !! sleep required for 1Char- and break-send !!
time.sleep(0.002)
uart1.sendbreak()
time.sleep(1)

Used environment:
ESP32 on Wipy3.0
See attached plots for the resulting streams.
Can you fix this problem in further releases?
uart_tx_failed
uart_tx_OK_withsleep

Keyboard

j / / n
next pair
k / / p
previous pair
1 / / h
show query pane
2 / / l
show candidate pane
c
copy suggested comment
r
toggle reasoning
g i
go to index
?
show this help
esc
close overlays

press ? or esc to close

copied