Hi,
almost 2 years ago I developed a small Lazarus program that reads electric consumptions data from an Eastron SDM-120C and transmits those data to a local python program that sends those data via MQTT to Cayenne "MyDevices" web service.
The "thing" has worked correctly for all this time, now the error in the subject started to appear.
The Lazarus program, the python program and Raspbian were not updated or modified during all this time.
The communication between the Lazarus program and the python program is made through TCP where the python program acts as server.
The component that I used is the "TTCPClient", Lazarus is the v2.0 (the one present in the Raspbian Buster repository).
The error "stream write error" appears after some minutes (never after the same amount of time) but I can't find the reason why, apparently it's all ok.
The thing that I'm sure of is that the python program is running and "listening" for a client to connect (I can read it on the screen).
When the error appears I have to close and execute the Lazarus program again, it works for 10/15 minutes and then back again the error.
The sequence is:
- data are read from the SDM120C
- data are sent to the python program via TCP (port 9000)
- connection is closed
- delay of 2 seconds then the cycle repeats
what should I check?
Surely something happened but, at the moment, I have no idea what happened.
Thank you, regards.
Roberto