Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add single char wait time after flush to avoid RTU control pin timing issue #79

Merged
merged 1 commit into from
Jul 19, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 6 additions & 1 deletion changelog.md
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,10 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
<!-- ## [Unreleased] -->

## Released
## [2.3.7] - 2023-07-19
### Fixed
- Add a single character wait time after flush to avoid timing issues with RTU control pin, see #68 and #72

## [2.3.6] - 2023-07-19
### Added
- Add contribution guideline, see #67
Expand Down Expand Up @@ -303,8 +307,9 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
- PEP8 style issues on all files of [`lib/uModbus`](lib/uModbus)

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

[2.3.7]: https://github.com/brainelectronics/micropython-modbus/tree/2.3.7
[2.3.6]: https://github.com/brainelectronics/micropython-modbus/tree/2.3.6
[2.3.5]: https://github.com/brainelectronics/micropython-modbus/tree/2.3.5
[2.3.4]: https://github.com/brainelectronics/micropython-modbus/tree/2.3.4
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -38,5 +38,5 @@
]
],
"deps": [],
"version": "2.3.6"
"version": "2.3.7"
}
2 changes: 2 additions & 0 deletions umodbus/serial.py
Original file line number Diff line number Diff line change
Expand Up @@ -274,8 +274,10 @@ def _send(self, modbus_pdu: bytes, slave_addr: int) -> None:
# 360-400us @ 9600-115200 baud (measured) (ESP32 @ 160/240MHz)
self._uart.write(modbus_adu)
send_finish_time = time.ticks_us()

if self._has_uart_flush:
self._uart.flush()
time.sleep_us(self._t1char)
else:
sleep_time_us = (
self._t1char * len(modbus_adu) - # total frame time in us
Expand Down
2 changes: 1 addition & 1 deletion umodbus/version.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
#!/usr/bin/env python3
# -*- coding: UTF-8 -*-

__version_info__ = ("2", "3", "6")
__version_info__ = ("2", "3", "7")
__version__ = '.'.join(__version_info__)