Skip to content

Commit e9ab05a

Browse files
Merge pull request #79 from brainelectronics/bugfix/yet-another-ctrl-pin-timing-issue
Add single char wait time after flush to avoid RTU control pin timing issue
2 parents 481efde + 9fb326c commit e9ab05a

File tree

4 files changed

+10
-3
lines changed

4 files changed

+10
-3
lines changed

changelog.md

+6-1
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,10 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
1515
<!-- ## [Unreleased] -->
1616

1717
## Released
18+
## [2.3.7] - 2023-07-19
19+
### Fixed
20+
- Add a single character wait time after flush to avoid timing issues with RTU control pin, see #68 and #72
21+
1822
## [2.3.6] - 2023-07-19
1923
### Added
2024
- Add contribution guideline, see #67
@@ -303,8 +307,9 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
303307
- PEP8 style issues on all files of [`lib/uModbus`](lib/uModbus)
304308

305309
<!-- Links -->
306-
[Unreleased]: https://github.com/brainelectronics/micropython-modbus/compare/2.3.6...develop
310+
[Unreleased]: https://github.com/brainelectronics/micropython-modbus/compare/2.3.7...develop
307311

312+
[2.3.7]: https://github.com/brainelectronics/micropython-modbus/tree/2.3.7
308313
[2.3.6]: https://github.com/brainelectronics/micropython-modbus/tree/2.3.6
309314
[2.3.5]: https://github.com/brainelectronics/micropython-modbus/tree/2.3.5
310315
[2.3.4]: https://github.com/brainelectronics/micropython-modbus/tree/2.3.4

package.json

+1-1
Original file line numberDiff line numberDiff line change
@@ -38,5 +38,5 @@
3838
]
3939
],
4040
"deps": [],
41-
"version": "2.3.6"
41+
"version": "2.3.7"
4242
}

umodbus/serial.py

+2
Original file line numberDiff line numberDiff line change
@@ -274,8 +274,10 @@ def _send(self, modbus_pdu: bytes, slave_addr: int) -> None:
274274
# 360-400us @ 9600-115200 baud (measured) (ESP32 @ 160/240MHz)
275275
self._uart.write(modbus_adu)
276276
send_finish_time = time.ticks_us()
277+
277278
if self._has_uart_flush:
278279
self._uart.flush()
280+
time.sleep_us(self._t1char)
279281
else:
280282
sleep_time_us = (
281283
self._t1char * len(modbus_adu) - # total frame time in us

umodbus/version.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
#!/usr/bin/env python3
22
# -*- coding: UTF-8 -*-
33

4-
__version_info__ = ("2", "3", "6")
4+
__version_info__ = ("2", "3", "7")
55
__version__ = '.'.join(__version_info__)

0 commit comments

Comments
 (0)