-
Notifications
You must be signed in to change notification settings - Fork 956
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
Serial asyncio client does not recover after device goes online #385
Comments
Could be similar to #349 |
The issue can be simulated with the scripts To reproduce the problem
The
The
|
I was able to reproduce this with your provided code and was able to work around it using
|
thanks, it will take me 2 days to test it or so. |
There is still an issue with long running tasks. This can be simulated with the following
It seems, that despite task cancellation, In my case, inverter is offline for 15+ hours at the moment, which will probably accumulate 54000+ transactions, so I will never receive any data. |
Is there any other additional data to be provided to push this issue forward? |
@wrobell sorry, I got offtrack with other activities. I will try to see if I can work on this over the weekend or in up coming weeks . |
Can you try this with 2.2.0 |
I am in the process of testing. I would like to note that with newer versions of socat, the speed needs to be prefixed with
|
The initial testing with the scripts above looks promising. Testing now with the real device. |
Unfortunately, there is still something wrong with the asyncio data read:
If I switch to standard serial client:
It seems like the async client tries to decode the frame too early? |
I see the same behaviour in our setup. I was hoping that disabling the strict mode to relax the intra character timing requirements could fix the issue. However, creating the client with the |
2. Fix examples 3. Fix #494 - handle_local_echo 4. Fix #500 -- asyncio serial client with already running loop 5. Fix #486 - Pass serial args for asyncio serial client 6. Fix #490 - Typo in decode_data for socker_framer 7. Fix #385 - Support timeouts to break out of responspe await when server goes offline 8. Misc updates
Fixed with e402d9f#diff-90d825c299aa37cc31eb357be29777fbR731. Now |
* Closes #491 * 1. update requirements 2. Fix examples 3. Fix #494 - handle_local_echo 4. Fix #500 -- asyncio serial client with already running loop 5. Fix #486 - Pass serial args for asyncio serial client 6. Fix #490 - Typo in decode_data for socker_framer 7. Fix #385 - Support timeouts to break out of responspe await when server goes offline 8. Misc updates * #516 custom data block fix
* 1. update requirements 2. Fix examples 3. Fix #494 - handle_local_echo 4. Fix #500 -- asyncio serial client with already running loop 5. Fix #486 - Pass serial args for asyncio serial client 6. Fix #490 - Typo in decode_data for socker_framer 7. Fix #385 - Support timeouts to break out of responspe await when server goes offline 8. Misc updates * #516 custom data block fix * Fix broadcast error with REPL client #515 * Fix #509 Wrong unit ID referenced in framers * Update documentation for serial forwarder example. Fixes #525 * Fix unit tests, support python 3.8 for tests, renamed: pymodbus/server/asyncio.py -> pymodbus/server/async_io.py and pymodbus/client/asynchronous/asyncio -> pymodbus/client/asynchronous/async_io * Ignore python3 code syntax while reporting coverage * Fix tests failing on python 3.6 and osx * Fix typo in makefile * Fix test execution errors specific to python3.6 * Osx travis issue - Fix trial 1 * Travis reverting xcode to 8.x for mac osx
Versions
Pymodbus Specific
Description
The Growatt 1500-s is a solar panel inverter. I am connecting to it via USB to serial cable.
When there is not enough energy from the solar panels, the inverter shuts down. The serial device still exists, you can send data, but you cannot receive anything. Once the inverter gets online, I would expect to receive the data, but pymodbus seems to hang.
I am trying to read data in the following manner
This works when the inverter is online. When the inverter goes offline, the
await
statements hangs. Unfortunately it never recovers. I would expect it to work again once the inverter goes online again.I have also tried to change the
read
coroutine intoThis did not help either.
Below are the debug logs from pymodbus for the 2nd version of
read
. As you can see, at some stage the inverter starts responding, pymodbus is receiving data, but unfortunately theclient.protocol.read_inout_registers
does not return any dataThe text was updated successfully, but these errors were encountered: