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

I/O Error on init #18

Open
yoFra opened this issue Mar 21, 2024 · 0 comments
Open

I/O Error on init #18

yoFra opened this issue Mar 21, 2024 · 0 comments

Comments

@yoFra
Copy link

yoFra commented Mar 21, 2024

Using your Installation and Configuration information you give, I have 2 errors.
It seems that the custom components doesn't have access to SMBus.

First one for Binary sensor

Error while setting up waveshare_ups_hat platform for binary_sensor

Traceback (most recent call last):
File "/usr/src/homeassistant/homeassistant/helpers/entity_platform.py", line 350, in _async_setup_platform
await asyncio.shield(awaitable)
File "/usr/local/lib/python3.12/concurrent/futures/thread.py", line 58, in run
result = self.fn(*self.args, **self.kwargs)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/config/custom_components/waveshare_ups_hat/sensor.py", line 56, in setup_platform
add_entities([WaveshareUpsHat(name,unique_id,max_soc,battery_capacity)], True)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/config/custom_components/waveshare_ups_hat/sensor.py", line 72, in __init__
self._ina219 = INA219(addr=0x42)
^^^^^^^^^^^^^^^^^
File "/config/custom_components/waveshare_ups_hat/ina219.py", line 70, in __init__
self.set_calibration_32V_2A()
File "/config/custom_components/waveshare_ups_hat/ina219.py", line 153, in set_calibration_32V_2A
self.write(_REG_CALIBRATION,self._cal_value)
File "/config/custom_components/waveshare_ups_hat/ina219.py", line 80, in write
self.bus.write_i2c_block_data(self.addr,address,temp)
File "/usr/local/lib/python3.12/site-packages/smbus2/smbus2.py", line 643, in write_i2c_block_data
ioctl(self.fd, I2C_SMBUS, msg)
OSError: [Errno 5] I/O error

And a 2nd one for sensor

Error while setting up waveshare_ups_hat platform for sensor

Traceback (most recent call last):
File "/usr/src/homeassistant/homeassistant/helpers/entity_platform.py", line 350, in _async_setup_platform
await asyncio.shield(awaitable)
File "/usr/local/lib/python3.12/concurrent/futures/thread.py", line 58, in run
result = self.fn(*self.args, **self.kwargs)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/config/custom_components/waveshare_ups_hat/sensor.py", line 56, in setup_platform
add_entities([WaveshareUpsHat(name,unique_id,max_soc,battery_capacity)], True)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/config/custom_components/waveshare_ups_hat/sensor.py", line 72, in __init__
self._ina219 = INA219(addr=0x42)
^^^^^^^^^^^^^^^^^
File "/config/custom_components/waveshare_ups_hat/ina219.py", line 70, in __init__
self.set_calibration_32V_2A()
File "/config/custom_components/waveshare_ups_hat/ina219.py", line 153, in set_calibration_32V_2A
self.write(_REG_CALIBRATION,self._cal_value)
File "/config/custom_components/waveshare_ups_hat/ina219.py", line 80, in write
self.bus.write_i2c_block_data(self.addr,address,temp)
File "/usr/local/lib/python3.12/site-packages/smbus2/smbus2.py", line 643, in write_i2c_block_data
ioctl(self.fd, I2C_SMBUS, msg)
OSError: [Errno 5] I/O error

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

1 participant