gianfrdp / SDM120C

sdm120c ModBus Mini Smart Meter
GNU General Public License v2.0
72 stars 37 forks source link

Readme Fix + unneeded code removed + Timeout Fix + Log messages Fix + error messages #3

Closed The-Drake closed 8 years ago

The-Drake commented 8 years ago

Please evaluate this simple pull request with some little fixes. :)

The-Drake commented 8 years ago

More fixes, this time bugfixing too. I expecially love timeout/retry patch. Please give it a look.

Eg, if you have one powered-off meter, now sdm exit at 1st reading timeout (configurable with -j parameter) while preserving -z retries for other errors (CRC, etc...). It should improve reading stability while shortening global timeout error time.

I have -w 5 -z 15 -j 2 in my default config for pooler485. w5 is for rs485 line sharing with aurora, z15 gives me more retry for a working meter and get almost only OK read on noisy buses, j2 is the default.

If a powered off a meter, sdm120c was locking serial port for 15*2 secs (=30 secs) before giving up. Aurora uses a global timeout parameter, but similar result is obtained by my proposed patch for sdm120c.

I hope you appreciate it. :)

/drk