-
Notifications
You must be signed in to change notification settings - Fork 1k
serial2TCP forwarding example #1116
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
Conversation
with : - signal to stop gracefully - asyncio.run() to make it easier for people who don't know much about asyncio
|
This looks good, I will review it soon. Would you like to add another PR that updates the general fowarder with your signal and async,run idea ? |
|
Please solve the pylint/flake8 error. |
|
you can run the checks locally: |
|
please do not suppress pylint messages ! they are there for a reason. |
|
I just left the if it is not acceptable, I will delete the pull request |
I have not done a review yet I am primarily waiting to CI to give green light, and I am not sure why you threaten to delete the PR ! unused-argument can easily be avoided and I hardly believe the graceful shutdown depends on a pylint disable ! That being said unused-argument is something we accept if there are a good reason to have it. |
janiversen
left a comment
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.
The code looks quite good, but there are a couple of formal issues.
examples/serial_forwarder.py
Outdated
| usage : | ||
| python3 serial_forwarder.py --log DEBUG --port "/dev/ttyUSB0" --baudrate 9600 --server_ip "192.168.1.27" --server_port 5020 --slaves 1 2 3 | ||
|
|
||
| sudo python3 serial_forwarder.py --port "/dev/ttyUSB0" --baudrate 9600 --server_ip "192.168.1.27" --server_port=502 --slaves 1 2 3 |
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.
This is a duplicate, please remove. If the code needs a sudo something needs to be corrected.
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.
To what i know, the default Modbus port number is 502
if you want to run on port 502, you need to use sudo
Ports below 1024 are restricted - only apps with root privileges can listen on those. I think this is the general rule on Linux/Unix
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 are quite right depending on which system you are on. But independent you have already documented how to call it, so there are really no need to repeat it.
I dont know a better and more appropriate way to do it but if you know one, I am interested I have a similar problem when using click in some projects. Pylint is not happy and I have to add |
|
Thanks for the PR, please keep more coming. |
with :