Skip to content

Failed to load integration when router does not have WiFi #47

@harsh2029

Description

@harsh2029

I have a NanoPi R5S as a router and external WiFi access points. This router does not have WiFi and hence no iwinfo or hostapd installed. When I load the integration, it always tries to read the network.wireless path which is obviously not valid and results in Access Denied (-32002) error code.

2025-08-04 22:06:18.121 DEBUG (MainThread) [custom_components.openwrt.ubus] Logging in to Ubus...
2025-08-04 22:06:18.121 DEBUG (MainThread) [custom_components.openwrt.ubus] New API call to [https://nanopier5s.lan/ubus] with data: {"jsonrpc": "2.0", "id": 5, "method": "call", "params": ["00000000000000000000000000000000", "session", "login", {"username": "hass", "password": "0123456789"}]}
2025-08-04 22:06:18.231 DEBUG (MainThread) [custom_components.openwrt.ubus] Raw JSON response from [https://nanopier5s.lan/ubus]: {'jsonrpc': '2.0', 'id': 5, 'result': [0, {'ubus_rpc_session': '34665a665726b7e479d7736b811163f1', 'timeout': 300, 'expires': 299, 'acls': {'access-group': {'hass': ['read', 'write'], 'unauthenticated': ['read']}, 'file': {'*': ['*']}, 'ubus': {'hostapd.*': ['wps_start', 'wps_cancel'], 'luci': ['getFeatures'], 'mwan3': ['status'], 'network.device': ['status'], 'session': ['access', 'login'], 'system': ['board', 'reboot']}, 'uci': {'*': ['read', 'write']}}, 'data': {'username': 'hass'}}]}
2025-08-04 22:06:18.231 DEBUG (MainThread) [custom_components.openwrt.ubus] Login result: {'ubus_rpc_session': '34665a665726b7e479d7736b811163f1', 'timeout': 300, 'expires': 299, 'acls': {'access-group': {'hass': ['read', 'write'], 'unauthenticated': ['read']}, 'file': {'*': ['*']}, 'ubus': {'hostapd.*': ['wps_start', 'wps_cancel'], 'luci': ['getFeatures'], 'mwan3': ['status'], 'network.device': ['status'], 'session': ['access', 'login'], 'system': ['board', 'reboot']}, 'uci': {'*': ['read', 'write']}}, 'data': {'username': 'hass'}}
2025-08-04 22:06:18.231 DEBUG (MainThread) [custom_components.openwrt.ubus] New API call to [https://nanopier5s.lan/ubus] with data: {"jsonrpc": "2.0", "id": 6, "method": "call", "params": ["34665a665726b7e479d7736b811163f1", "network.wireless", "status", {}]}
2025-08-04 22:06:18.272 DEBUG (MainThread) [custom_components.openwrt.ubus] Raw JSON response from [https://nanopier5s.lan/ubus]: {'jsonrpc': '2.0', 'id': None, 'error': {'code': -32002, 'message': 'Access denied'}}
2025-08-04 22:06:18.272 ERROR (MainThread) [custom_components.openwrt.ubus] api_call RPC error: {'code': -32002, 'message': 'Access denied'}
2025-08-04 22:06:18.273 DEBUG (MainThread) [custom_components.openwrt.coordinator] Finished fetching openwrt data in 0.413 seconds (success: False)
2025-08-04 22:06:18.273 WARNING (MainThread) [homeassistant.config_entries] Config entry 'nanopier5s - nanopier5s.lan' for openwrt integration could not authenticate: Access denied
2025-08-04 22:06:18.273 DEBUG (MainThread) [custom_components.openwrt.config_flow] Input: {'id': 'nanopier5s', 'address': 'nanopier5s.lan', 'username': 'hass', 'https': True, 'verify_cert': False, 'port': 0, 'path': '/ubus', 'interval': 30, 'wps': False, 'password': '0123456789'}

It would be great if integration has an option to add router without WiFi interface.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions