ebaauw / homebridge-p1

Homebridge plugin for DSMR end-consumer (P1) interface
Apache License 2.0
53 stars 11 forks source link

Homebridge P1 doesn't receive data after restarting ser2net #58

Closed ebaauw closed 2 years ago

ebaauw commented 2 years ago

Somehow, Homebridge P1 doesn't receive any data from ser2net, after set2net has been restarted (or the USB P1 cable has been re-inserted?). It notices the connection is lost when ser2net restarts, and, by design, reconnects after a minute. The connection to ser2net seems to be successful (confirmed by netstat on both servers), but no data is received. This causes Homebridge P1 to break the connection and try again after a minute, by design. Only after restarting Homebridge, Homebridge P1 is once again receiving data.

Oddly, when severing and restoring the network connection between the server running Homebridge P1 and the server running ser2net, data is received once the connection has been restored.

ebaauw commented 2 years ago

Actually, first data event is received from the socket, but somehow the pipe to the SerialPort.parsers.Readline parser no longer works, causing the socket to block. Creating a new parser instance solves the issue.