An error occurred during send TCP : Other Socket error (32)' #480
martin2day2
started this conversation in
General
Replies: 2 comments 1 reply
-
The try - except now does not print the pull stack trace and error. use logging.exception like here: https://stackoverflow.com/questions/4508849/how-to-log-python-exception
with out more information it is hard to debug? how often do you send water temperature? |
Beta Was this translation helpful? Give feedback.
1 reply
-
Hi,
I see you use threading which complicates things. The connection is lost
which can happen on a network / wifi connection.
Some cleanup must probably be done before (re) connection. On network
failure sleep a few seconds and try again later.
- Probably A new connection must be build to the PLC on connection loss.
I do not know enough of you code and context.
Every x time you do an update also a new connexion is needed. Now I assume
one connection is made and used for ours and is lost. If you make and close
a connection each time this is probably more reliable.
Cheers,
Stephan.
…On Tue, Dec 12, 2023, 16:30 martin2day2 ***@***.***> wrote:
Hello,
okay i change the code.
Today i get enother error:
Dec 12 15:26:43 raspberrypi python3[26512]: self.run()
Dec 12 15:26:43 raspberrypi python3[26512]: File "/usr/lib/python3.9/threading.py", line 892, in run
Dec 12 15:26:43 raspberrypi python3[26512]: self._target(*self._args, **self._kwargs)
Dec 12 15:26:43 raspberrypi python3[26512]: File "/home/martin/app.py", line 61, in heater
Dec 12 15:26:43 raspberrypi python3[26512]: self.plc.db_write(db_number=201, start=0, data=self.wdata)
Dec 12 15:26:43 raspberrypi python3[26512]: File "/home/martin/.local/lib/python3.9/site-packages/snap7/client/__init__.py", line 24, in f
Dec 12 15:26:43 raspberrypi python3[26512]: check_error(code, context="client")
Dec 12 15:26:43 raspberrypi python3[26512]: File "/home/martin/.local/lib/python3.9/site-packages/snap7/common.py", line 89, in check_error
Dec 12 15:26:43 raspberrypi python3[26512]: raise RuntimeError(error)
Dec 12 15:26:43 raspberrypi python3[26512]: RuntimeError: b' ISO : An error occurred during recv TCP : Connection timed out'
i have allready an try befor the self.plc.db_write(db_number=201, start=0,
data=self.wdata)...
What can i do here?
Martin
—
Reply to this email directly, view it on GitHub
<#480 (reply in thread)>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/AAAOSMLXXBGFTDFU6BDKLNDYJB2BTAVCNFSM6AAAAABAOSRKBSVHI2DSMVQWIX3LMV43SRDJONRXK43TNFXW4Q3PNVWWK3TUHM3TQMZSGIYTM>
.
You are receiving this because you commented.Message ID:
***@***.***>
|
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
-
Hello,
i use a Pi with python to send data from my heatpump to my S7-300.
The program works good but after some hours of working i get an error:
this is how my program is looks like.
Please help me to get my code work.
What does the fault mean?
Have a nice day
Martin
Beta Was this translation helpful? Give feedback.
All reactions