-
Notifications
You must be signed in to change notification settings - Fork 951
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
ssl.SSLWantReadError: The operation did not complete (read) when using ModbusTlsClient #2184
Comments
Seems you are addressing a slave that do not exist:
so the server sends an exception response. the client sees slave_id as broadcast therefore it demands a proper response with the length, however it receives an exception which is a lot shorter, and thus closes the connection and raises an exception. So in total please try with slave_ids that are defined. |
I was trying all defined slave_id but the server doesn't recognize its value. It always tries to get values from slave id 0, it looks like the server doesn't receive correctly slave id. |
Did you define the slave content ? without that the server does not know the client, Please see our examples, |
slave_id is broadcast, which the server must accept if it only have one slave defined, not accepting that signals you did not define any slaves in the server. |
I mean id=0 is special because its broadcast |
@janiversen thanks for your assistance.
Yes, I defined a content for each slave I have a problem only when using TLS ( |
Yes because you cannot use slave id 0 ! |
I don't use slave id 0
and logs when I run
It always sends the same packet. |
Please add the server log. |
It is correct it is the same packet, BUT the client code behaves differently with broadcast than with real ids. If the server log still contains "requested slave does not exist" then something is wrong on the server side. |
|
I just made a test, and the server is responding correctly, The "requested slave does not exist" suggest you have done something wrong with the content definition. My server log (example is unmodified)
Client_async log:
however there are a problem with the sync client, I will investigate.
Important I cannot produce your "slave does not exist" ! |
In my case, I run an async server and sync client.
I reproduce it too. I haven't tried the async server and async client yet. |
But please remember you need to solve the "slave does not exist", independent of the bug in the sync client. |
Yeah, I rewrote my client using |
Look at examples/server_async.py + helper.py, that have a correct setup. |
I figured out why I was receiving |
But the issue is still reproducible when I'm using an async server and sync client. Client logs:
Server logs:
|
As I wrote, that is something I will investigate |
Versions
Pymodbus Specific
Description
I'm starting the async tls modbus server using certificates from the example folder and function
StartAsyncTlsServer
with defining a few slaves. After that, I tried to read some slaves using the client (ModbusTlsClient) and received the exceptionModbus Error: The operation did not complete (read) (_ssl.c:2633)
.I read slave 1
python client.py --slave_id 1 --address 0 --count 1
Code and Logs
Client code is following:
Server logs
Client logs
The text was updated successfully, but these errors were encountered: