homeassistant-solax-modbus icon indicating copy to clipboard operation
homeassistant-solax-modbus copied to clipboard

[Bug]: 'Solis' - 'S6-EH3P10K-H-EU' Could not exclusively lock port

Open Gregy opened this issue 10 months ago • 5 comments

Describe the bug

After upgrade to 2024.03.07 I started getting Failed to connect [Errno 11] Could not exclusively lock port /dev/ttyUSB0: [Errno 11] Resource temporarily unavailable error. The data gathering becomes spotty eventually stopping.

Reloading the integration doesn't fix the problem. Restarting HASS does and interesting error message is generated during restart.

2024-03-27 22:19:02.566 WARNING (Thread-2 (_do_shutdown)) [homeassistant.util.executor] Thread[SyncWorker_27] is still running at shutdown: File "/usr/local/lib/python3.12/threading.py", line 1030, in _bootstrap
    self._bootstrap_inner()
  File "/usr/local/lib/python3.12/threading.py", line 1073, in _bootstrap_inner
    self.run()
  File "/usr/local/lib/python3.12/threading.py", line 1010, in run
    self._target(*self._args, **self._kwargs)
  File "/usr/local/lib/python3.12/concurrent/futures/thread.py", line 89, in _worker
    work_item = work_queue.get(block=True)

Is it possible there is some runaway thread holding the lock?

Integration Version

2024.03.8

Homeassistant core version

2024.3.3

Inverter brand

Solis

Plugin used

plugin_solis.py

Serial prefix

10330602

Connection Method

RS485 USB adapter

Detailed Error Log

https://gist.github.com/Gregy/dd5e09717575696f8229bc3241c838a5

Additional context

No response

Gregy avatar Mar 27 '24 21:03 Gregy

After downgrade to 2024.03.6 I can still see communication errors in the logs but not locking issues and the integration seems to be able to recover.

https://gist.github.com/Gregy/8f982e87e9c0839bcf86b58f93aa8f4e

Gregy avatar Mar 28 '24 09:03 Gregy

I have tested 2024.03.8 which doesn't solve the issue.

Gregy avatar Mar 31 '24 10:03 Gregy

Are you trying to access the USB device with anything else at the same time? Like the built in Modbus Integration?

wills106 avatar Mar 31 '24 11:03 wills106

No, there is nothing else. But I use relatively short update interval of 4s. Could that be the trigger?

I am testing what is the last version I can run without any errors in the logs. The 2023.12.5 is rock solid, I will continue to go up until I hit issues.

Gregy avatar Mar 31 '24 18:03 Gregy

The first release which causes random connection dropouts and modbus errors is 2024.02.6. 2024.02.5 is stable.

Gregy avatar Apr 01 '24 06:04 Gregy