kvj / hass_openwrt

Home Assistant integration with OpenWrt devices
MIT License
114 stars 20 forks source link

openwrt 22.03 stable release Device [openwrt] async_update_data error: rpc error: 2 #11

Open amirudon opened 2 years ago

amirudon commented 2 years ago

could not connect to openwrt 22.03

home assistant giving error: Device [openwrt] async_update_data error: rpc error: 2

logs from home assistant:

This error originated from a custom integration.

Logger: custom_components.openwrt.coordinator Source: custom_components/openwrt/ubus.py:121 Integration: OpenWrt (documentation, issues) First occurred: 9:33:48 AM (23 occurrences) Last logged: 9:59:08 AM

Device [openwrt] async_update_data error: rpc error: 2 Traceback (most recent call last): File "/config/custom_components/openwrt/coordinator.py", line 250, in async_update_data result["wan"] = await self.update_wan_info() File "/config/custom_components/openwrt/coordinator.py", line 215, in update_wan_info response = await self._ubus.api_call( File "/config/custom_components/openwrt/ubus.py", line 41, in api_call return await self._api_call(rpc_method, subsystem, method, params) File "/config/custom_components/openwrt/ubus.py", line 121, in _api_call raise ConnectionError(f"rpc error: {result[0]}") ConnectionError: rpc error: 2

BosakS commented 1 year ago

Same error: 2023-02-12 00:50:54.069 ERROR (MainThread) [custom_components.openwrt.coordinator] Device [OpenWrt] async_update_data error: rpc error: 2 Traceback (most recent call last): File "/config/custom_components/openwrt/coordinator.py", line 252, in async_update_data result["wan"] = await self.update_wan_info() File "/config/custom_components/openwrt/coordinator.py", line 217, in update_wan_info response = await self._ubus.api_call( File "/config/custom_components/openwrt/ubus.py", line 41, in api_call return await self._api_call(rpc_method, subsystem, method, params) File "/config/custom_components/openwrt/ubus.py", line 121, in _api_call raise ConnectionError(f"rpc error: {result[0]}") ConnectionError: rpc error: 2

JorgenEvens commented 1 year ago

In my case this was caused by entering the interface names rather than the actual device names for WAN and WLAN devices.

You can find the device names by hovering over the icons shown for an interface. image