Skip to content
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

WARNING:Modbus connection failed WARNING:Failed to scrape inverter, sleeping until next scan #90

Open
kisa72 opened this issue Dec 31, 2022 · 1 comment

Comments

@kisa72
Copy link

kisa72 commented Dec 31, 2022

Hi,

I have seen the previous questions/answers relating to the discussuions #34 and #48, and although I downgraded pymodbus, I still get the warnings for more than half the attempts to connect to the inverter and it normally occurs in sequences of say 5-6 failed attempts in a row.

One thing I found that may provide a reason is that it only occurs when I'm running my code in Debian Linux on my Laptop (which doubles as my Plex server).

When I run the same code in parallel on my Windows 11 PC through PYCharm, I'm lucky to get 1 in 30 attempts produce a warning.

Linux
45714.653348
WARNING:Modbus connection failed
WARNING:Failed to scrape inverter, sleeping until next scan
45773.712014
WARNING:Modbus connection failed
WARNING:Failed to scrape inverter, sleeping until next scan
45832.740916
WARNING:Modbus connection failed
WARNING:Failed to scrape inverter, sleeping until next scan
45891.819905
WARNING:Modbus connection failed
WARNING:Failed to scrape inverter, sleeping until next scan
45958.880418
WARNING:Modbus connection failed
WARNING:Failed to scrape inverter, sleeping until next scan

Windows
48417.061711
now.minute 26
48476.695655
now.minute 27
48536.333087
now.minute 28
48596.128118
now.minute 29
48655.688589
now.minute 30

The 'now.minute' is a print statement in both the Linux and Windows codes, but because the Linux one failed to connect, it restarts it's main loop and doesn't get to my 'now.minute' print statement.

I think this is quite significant and seems to point at an underlying Linux related issue.

Understanding the lower level communication methods/libraries of Linux or Windows is beyond my knowledge, but if someone has any ideas of why the same code is failing (50% of the time) on a Linux machine compared to never on a Windows machine, I'd be keen to understand why and it may resolve some others issues as as well.

Thanks,

KISA

@michael-robbins
Copy link
Contributor

What's your sync frequency? I've seen it sometimes get really flaky when it's set like <10s

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants