forked from sfera-labs/exo-sense-py-modbus
-
Notifications
You must be signed in to change notification settings - Fork 51
Add asyncio support #56
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
Open
GimmickNG
wants to merge
121
commits into
brainelectronics:develop
Choose a base branch
from
GimmickNG:mpmodbus-compatibility
base: develop
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Changes from all commits
Commits
Show all changes
121 commits
Select commit
Hold shift + click to select a range
3e94e82
Move system imports to separate file
GimmickNG d89130f
Refactor TCP and Modbus classes
GimmickNG f54f4de
Add asyncio support
GimmickNG 5a6b8bf
Merge branch 'develop' into mpmodbus-compatibility
GimmickNG 0642b8a
Rename async folder to asynchronous
GimmickNG bfd4e21
fix flake8 errors, add docstrings, fix async serial
GimmickNG 1fe6adb
Updated changelog to add #5 and #11
GimmickNG d867a47
Modify changelog - from code review
GimmickNG 8f11675
Make request parameter optional
GimmickNG 0cd100c
Make changes based on code review
GimmickNG 6c3632d
Update changelog to reflect reverted breaking change
GimmickNG a0ced88
Add async examples
GimmickNG d2e6d0a
Refactored serial/RTU to match TCP
GimmickNG 86021c6
Fix setup.py to include async package
GimmickNG 1b1dfde
Add header to async examples
GimmickNG 4353498
Fix unused import, incorrect formatting
GimmickNG 9427597
Fix flake8 formatting error
GimmickNG e7246e4
Merge branch 'brainelectronics:develop' into mpmodbus-compatibility
GimmickNG 26355df
Fix overload decorator
GimmickNG 114e448
Merge branch 'brainelectronics:develop' into mpmodbus-compatibility
GimmickNG 829ca17
Auto-connect TCP client in constructor
GimmickNG 7b3b49c
Add auto-connect note to async tcp client
GimmickNG f803842
Move async TCP examples to separate files
GimmickNG f66fdd8
Fix examples and async tcp server
GimmickNG 50b9bb3
Delete pycache files
GimmickNG 05ebce4
Delete pycache files
GimmickNG c2ab8a2
Remove duplicate function
GimmickNG 2b538f8
Fix trailing whitespace
GimmickNG d0614db
Refactor, add async RTU and multi-server examples
GimmickNG 17647cf
Delete async_examples.py
GimmickNG cf44c22
Remove redundant common files
GimmickNG c2c9dd6
do not use relative imports in examples
GimmickNG 6f557cc
use fully qualified names for common
GimmickNG 8fad878
Make changes by @beyonlo, fix RTU set_params
GimmickNG 85486d0
fix flake8 error
GimmickNG b8a712d
Updated async serial server + examples
GimmickNG deed1b5
modify callback traces to help in debugging
GimmickNG 2cd997d
revert change to _process_read_access
GimmickNG d098627
add exit function
GimmickNG 6ef64c9
fix flake8 error
GimmickNG 0fb6951
fix broken import
GimmickNG 385aca4
use registers in example.json for tests
GimmickNG 8a74346
flake8 ignore redefinition
GimmickNG 8e55144
change gitignore
GimmickNG e4acfd6
use req_handler for process() in async RTU
GimmickNG d36a8c3
fix async serial host example
GimmickNG da4cc3c
add debug logging statements
GimmickNG 22196af
debugging: narrowing logging
GimmickNG eebb5a5
debug serial.py
GimmickNG c10f592
debug: print entire request
GimmickNG f7c503d
debug: narrow logging statements
GimmickNG ba4b299
Fix index-out-of-bounds issue when reading slave response
wpyoga 547d0a8
Simplify calculation of inter-frame delay
wpyoga 06aeda0
Fix receive long slave response by waiting longer
wpyoga c7cd786
Fix receive missing initial bytes by blocking instead of polling
wpyoga e4bdeea
replace machine idle with time sleep_us for MicroPython below v1.20.0…
brainelectronics c0de0bd
update changelog
brainelectronics b5416a9
remove flush function from machine UART fake
brainelectronics b9a3901
Merge pull request #75 from wpyoga/fix-timing
brainelectronics 1858fae
add missing empty line in several files
brainelectronics 45b5492
validate package.json content on each test workflow run
brainelectronics 9217dae
add precommit hook, contributes to #67
brainelectronics 8d1bec0
Use sync read
GimmickNG 96a3064
add basic contribution guideline, see #67
brainelectronics 0424460
validate package.json and package version file before running all tests
brainelectronics 2646996
update changelog, package version and package.json
brainelectronics 15d90a0
replace upip ulogging installation with ulogging file in tests folder
brainelectronics 481efde
Merge pull request #78 from brainelectronics/feature/improve-contribu…
brainelectronics 9fb326c
Add single char wait time after flush to avoid RTU control pin timing…
brainelectronics e9ab05a
Merge pull request #79 from brainelectronics/bugfix/yet-another-ctrl-…
brainelectronics c0a5467
sleep if no data available
GimmickNG 14f0ca1
#56: add asyncio support
GimmickNG 8816948
#56: add asyncio tests, refactor sync tests
GimmickNG 3ca7759
Merge remote-tracking branch 'origin/mpmodbus-compatibility' into asy…
GimmickNG 9d76ee9
fix broken imports
GimmickNG 37de00f
debugging: reraise on exception for rtu example
GimmickNG da02956
fix local variable reference error
GimmickNG ec4b728
return request after process
GimmickNG 9b6b3f7
update async serial send to match sync version
GimmickNG 36df0ac
use time.sleep_us where applicable
GimmickNG ddcd134
add hybrid sleep
GimmickNG 889096f
change import name and type
GimmickNG 2cb2dea
add timeout option for rtu client
GimmickNG afb0ffd
add read timeout param for sync rtu, move to common
GimmickNG 7f153fa
change delay, _uart_read_timeout to be in ms
GimmickNG 85da811
repeat tests when timeout occurs
GimmickNG b5fad0a
add async server restart example
GimmickNG 353260e
fix error calling create_servers
GimmickNG 8ff6326
add logging to pack and unpack
GimmickNG fc186b4
fix struct pack error
GimmickNG c652e05
add extra/custom args for testing
GimmickNG c25c1a9
use await for uart streamwriter
GimmickNG cab9132
test using sync write for uart
GimmickNG b30f90b
revert safe_struct, refactor common functions
GimmickNG 392e82e
refactor examples to use pipeline
GimmickNG 1517427
add on_pre_set_cb callback
GimmickNG 1a6e95c
#69: add write beyond limit test + cleanup tests
GimmickNG 4f6806d
fix formatting, add debug logs, add client_connect todo
GimmickNG 813d8a6
add more logging
GimmickNG b5dfbf7
add more logging
GimmickNG 46e3929
add more logging
GimmickNG 327907b
fix MRO for async classes
GimmickNG 5e91a6d
fix MRO for AsyncRTUServer
GimmickNG 4079fe5
inherit from sync version instead of being mixin
GimmickNG 6759430
add on_tcp_connect and on_tcp_disconnect callbacks
GimmickNG e891a2e
add example which updates registers in background
GimmickNG fd694b5
Improve uart_read_frame (#5)
hmaerki ad38bb7
fix on_connect_cb and on_disconnect_cb for async
GimmickNG a7d6517
change t1char_ms timing in async rtu
GimmickNG e29ca16
add inet_ntop compatibility function
GimmickNG 2cbe3cf
remove unused print statements
GimmickNG 77ec202
add type parameter to inet_ntop
GimmickNG fb5911a
add reference
GimmickNG dfa3062
update example for multi-valued registers
GimmickNG bce10d3
fix flake8 errors
GimmickNG 7ea5124
fix more flake8 errors
GimmickNG a77db08
change multi client examples to share registers
GimmickNG 2b4a1d3
fix flake8 errors
GimmickNG d79f8e9
fix imports, rtu server init errors
GimmickNG 6c15435
revert changes to examples
GimmickNG a62dbe0
increase version, add changelog notes, address review comments
GimmickNG File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -3,4 +3,4 @@ | |
# changed to https due to RTD build issue | ||
# see https://github.com/readthedocs/readthedocs.org/issues/4043 | ||
# url = [email protected]:brainelectronics/python-modules.git | ||
url = https://github.com/brainelectronics/python-modules.git | ||
url = https://github.com/brainelectronics/python-modules.git |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,39 @@ | ||
--- | ||
|
||
# To install pre-commit hooks, install `pre-commit` and activate it here: | ||
# pip3 install pre-commit | ||
# pre-commit install | ||
# | ||
default_stages: | ||
- commit | ||
- push | ||
- manual | ||
|
||
repos: | ||
- repo: https://github.com/pre-commit/pre-commit-hooks | ||
rev: v2.3.0 | ||
hooks: | ||
- id: check-yaml | ||
- id: trailing-whitespace | ||
args: [--markdown-linebreak-ext=md] | ||
- repo: https://github.com/PyCQA/flake8 | ||
rev: 5.0.4 | ||
hooks: | ||
- id: flake8 | ||
- repo: https://github.com/brainelectronics/micropython-package-validation | ||
rev: 0.5.0 | ||
hooks: | ||
- id: upy-package | ||
args: | ||
- "--setup_file=setup.py" | ||
- "--package_changelog_file=changelog.md" | ||
- "--package_file=package.json" | ||
- "--validate" | ||
- repo: https://github.com/brainelectronics/changelog2version | ||
rev: 0.10.0 | ||
hooks: | ||
- id: changelog2version | ||
args: | ||
- "--changelog_file=changelog.md" | ||
- "--version_file=umodbus/version.py" | ||
- "--validate" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
You can keep the changelog as it is right now, I'll add the necessary changes after the merge :)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Should I revert the changes? These were after I pulled from upstream and resolved the merge conflicts, I think if I change it back now, then there'll be problems when this pull request is auto-merged by github.