-
Notifications
You must be signed in to change notification settings - Fork 48
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
Handle control pin timing #73
Conversation
Hey @beyonlo and @panther50500 , let's give it a try :) https://test.pypi.org/project/micropython-modbus/2.3.5rc82.dev73/ |
Thank you @brainelectronics for this PR. Sorry for the long time to test, but I was a bit sick. I'm feeling better now, and I will to test it in this week (probably tomorrow). Just to be aligned: I will test this PR with the examples (sync and async) from @GimmickNG. In my opinion, now that this lib is more stable, I think that is a good idea that we use always the same example for the tests, where the examples can to do complete tests, like as those does. If you agree, maybe is a good idea, on the future, to put that examples as official examples for sync and async. What do you think? |
@beyonlo I hope your getting better! No worries, just take your time. I agree to use the sync and async examples for testing. I hope to get that PR merged soon, as I have several systems out in the wild with automatic updates, I have to ensure all changes are working as expected. I'm quite sure that this change will work the same way on sync and async, but you never know. Let's see |
@brainelectronics The Reports: Test1: Test2: Test3: Do not have differences between Test 2 (Slave new version) and Test 3. I was thinking that this new version could fix the Ps1: Slave RTU: $ mpremote run rtu_client_example.py
MicroPython infos: (sysname='esp32', nodename='esp32', release='1.20.0', version='v1.20.0 on 2023-04-26', machine='ESP32S3 module (spiram) with ESP32S3')
Used micropthon-modbus version: 2.3.5-rc82.dev73
Using pins (17, 18) with UART ID 1
Setting up registers ...
Register setup done
Serving as RTU client on address 10 at 115200 baud
my_coil_get_cb, called on getting COILS at 123, currently: [1, False, False, False, False, False, False, False, False, False, False, False]
my_coil_set_cb, called on setting COILS at 123 to: [False]
my_coil_get_cb, called on getting COILS at 123, currently: [False, False, False, False, False, False, False, False, False, False, False, False] Master RTU: $ mpremote run rtu_host_example.py
MicroPython infos: (sysname='esp32', nodename='esp32', release='1.20.0', version='v1.20.0 on 2023-04-26', machine='ESP32S3 module (spiram) with ESP32S3')
Used micropthon-modbus version: 2.4.0-rc82.dev56
Using pins (17, 18) with UART ID 1
Requesting and updating data on RTU client at address 10 with 115200 baud
Status of COIL 123: [False, False, False, False, False, False, False, False, False, False, False, False]
Result of setting COIL 123 to True
Status of COIL 123: [False, False, False, False, False, False, False, False, False, False, False, False]
Traceback (most recent call last):
File "<stdin>", line 53, in <module>
File "examples/common/host_tests.py", line 159, in run_sync_host_tests
File "umodbus/common.py", line 197, in read_holding_registers
File "umodbus/serial.py", line 473, in _send_receive
File "umodbus/serial.py", line 435, in _validate_resp_hdr
OSError: invalid response CRC |
see #75 The "culprit" is actually
|
Fixed
ticks_diff
to get correct time to lower control pin after sending the frame, see Control Pin problem (remained to HIGH after several time of communication) #72