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

UNKNOWN ip address error after switching to access point as operation mode #46

Closed
mousawm opened this issue Mar 3, 2022 · 7 comments
Closed
Labels
bug Something isn't working

Comments

@mousawm
Copy link

mousawm commented Mar 3, 2022

Version of the custom_component

1.1.0

Configuration

core-2022.3.0
supervisor-2022.01.1
HACS 1.23.0

Describe the bug

I'm using Deco X68 with this integration and every thing was working fine, until I changed the operation mode from wireless router to access point.

after the changing to access point, I started getting this error:

Exception in _async_process_device_data when dispatching 'device_tracker_connected_device_registered': ({'ip': 'UNKNOWN', 'mac': 'B4-C9-B9-A0-69-FE', 'host_name': '192.168.121.113'},) Traceback (most recent call last): File "/usr/src/homeassistant/homeassistant/components/dhcp/init.py", line 373, in _async_process_device_data self.async_process_client(ip_address, hostname, _format_mac(mac_address)) File "/usr/src/homeassistant/homeassistant/components/dhcp/init.py", line 177, in async_process_client made_ip_address = make_ip_address(ip_address) File "/usr/local/lib/python3.9/ipaddress.py", line 53, in ip_address raise ValueError('%r does not appear to be an IPv4 or IPv6 address' % ValueError: 'UNKNOWN' does not appear to be an IPv4 or IPv6 address

192.168.121.113 in the main router IP address.

Debug log


Exception in _async_process_device_data when dispatching 'device_tracker_connected_device_registered': ({'ip': 'UNKNOWN', 'mac': 'B4-C9-B9-A0-69-FE', 'host_name': '192.168.121.113'},) Traceback (most recent call last): File "/usr/src/homeassistant/homeassistant/components/dhcp/__init__.py", line 373, in _async_process_device_data self.async_process_client(ip_address, hostname, _format_mac(mac_address)) File "/usr/src/homeassistant/homeassistant/components/dhcp/__init__.py", line 177, in async_process_client made_ip_address = make_ip_address(ip_address) File "/usr/local/lib/python3.9/ipaddress.py", line 53, in ip_address raise ValueError('%r does not appear to be an IPv4 or IPv6 address' % ValueError: 'UNKNOWN' does not appear to be an IPv4 or IPv6 address 

@amosyuen
Copy link
Owner

amosyuen commented Mar 3, 2022

Ah realized that I am setting the host_name incorrectly, it's always set to the main router IP address for all devices. Could you give more info about that device which is failing? The one with mac B4-C9-B9-A0-69-FE. e.g. Is it a phone? Is it disconnected? How is it normally connected (wired vs wireless)?

It seems like the deco is returning UNKNOWN for the ip address which seems unusual. I can try setting it to null for 'UNKNOWN' value, but either way it seems strange that the value is UNKNOWN.

@amosyuen amosyuen added the bug Something isn't working label Mar 4, 2022
@mousawm
Copy link
Author

mousawm commented Mar 4, 2022

Hi,
The device that failing is the main router, the mac address is for camera, this camera is connected to ethernet ccable and wifi the mac address for wifi connection
Screenshot_2022-03-04-20-18-16-805_com tplink tpm5
Screenshot_2022-03-04-20-18-08-311_com tplink tpm5

After the latest update I get this error now:

This error originated from a custom integration.

Logger: custom_components.tplink_deco
Source: custom_components/tplink_deco/api.py:293
Integration: TP-Link Deco (documentation, issues)
First occurred: 6:11:08 PM (3 occurrences)
Last logged: 8:18:21 PM

List Clients C0-06-C3-F2-39-80 client response error: 403, message='Forbidden', url=URL('http://192.168.121.113/cgi-bin/luci/;stok=f0aed60e82995d40e8e116f8c32a438f/admin/client?form=client_list')
List Clients C0-06-C3-F2-39-80 client response error: 403, message='Forbidden', url=URL('http://192.168.121.113/cgi-bin/luci/;stok=e0a4858e0f4092d3b5abf80b81d2236f/admin/client?form=client_list')
List Devices client response error: 403, message='Forbidden', url=URL('http://192.168.121.113/cgi-bin/luci/;stok=97e690f4dde5ac7ce975b498e6f2cfcd/admin/device?form=device_list')

@mousawm
Copy link
Author

mousawm commented Mar 5, 2022

also this errors are appearing:

This error originated from a custom integration.

Logger: custom_components.tplink_deco
Source: custom_components/tplink_deco/api.py:293
Integration: TP-Link Deco (documentation, issues)
First occurred: 5:45:16 AM (1 occurrences)
Last logged: 5:45:16 AM

List Devices client response error: 403, message='Forbidden', url=URL('http://192.168.121.113/cgi-bin/luci/;stok=3bfca4eebdc16c3256e45b144e3f8b0b/admin/device?form=device_list')
Logger: homeassistant.helpers.event
Source: components/dhcp/__init__.py:177
First occurred: 5:26:55 AM (1 occurrences)
Last logged: 5:26:55 AM

Error while processing event <Event state_changed[L]: entity_id=device_tracker.camera_wifi, old_state=None, new_state=<state device_tracker.camera_wifi=home; source_type=router, ip=UNKNOWN, mac=B4-C9-B9-A0-69-FE, connection_type=band2_4, interface=main, down_kilobytes_per_s=0.0, up_kilobytes_per_s=0.0, deco_device=living_room, icon=mdi:lan-connect, friendly_name=camera wifi @ 2022-03-05T05:26:55.545861+03:00>> for domain device_tracker
Traceback (most recent call last):
  File "/usr/src/homeassistant/homeassistant/helpers/event.py", line 408, in _async_dispatch_domain_event
    hass.async_run_hass_job(job, event)
  File "/usr/src/homeassistant/homeassistant/core.py", line 530, in async_run_hass_job
    cast(Callable[..., _R], hassjob.target)(*args)
  File "/usr/src/homeassistant/homeassistant/components/dhcp/__init__.py", line 320, in _async_process_device_event
    self._async_process_device_state(event.data["new_state"])
  File "/usr/src/homeassistant/homeassistant/components/dhcp/__init__.py", line 340, in _async_process_device_state
    self.async_process_client(ip_address, hostname, _format_mac(mac_address))
  File "/usr/src/homeassistant/homeassistant/components/dhcp/__init__.py", line 177, in async_process_client
    made_ip_address = make_ip_address(ip_address)
  File "/usr/local/lib/python3.9/ipaddress.py", line 53, in ip_address
    raise ValueError('%r does not appear to be an IPv4 or IPv6 address' %
ValueError: 'UNKNOWN' does not appear to be an IPv4 or IPv6 address
Logger: homeassistant.util.logging
Source: util/logging.py:114
First occurred: 5:26:55 AM (1 occurrences)
Last logged: 5:26:55 AM

Exception in _async_process_device_data when dispatching 'device_tracker_connected_device_registered': ({'ip': 'UNKNOWN', 'mac': 'B4-C9-B9-A0-69-FE', 'host_name': None},) Traceback (most recent call last): File "/usr/src/homeassistant/homeassistant/components/dhcp/__init__.py", line 373, in _async_process_device_data self.async_process_client(ip_address, hostname, _format_mac(mac_address)) File "/usr/src/homeassistant/homeassistant/components/dhcp/__init__.py", line 177, in async_process_client made_ip_address = make_ip_address(ip_address) File "/usr/local/lib/python3.9/ipaddress.py", line 53, in ip_address raise ValueError('%r does not appear to be an IPv4 or IPv6 address' % ValueError: 'UNKNOWN' does not appear to be an IPv4 or IPv6 address

amosyuen added a commit that referenced this issue Mar 7, 2022
@amosyuen
Copy link
Owner

amosyuen commented Mar 7, 2022

Added code to handle UNKNOWN issue in latest release v2.0.1.

403 error may indicate that the credentials you are using do not have permissions. Did you follow the README to use the admin account? https://github.com/amosyuen/ha-tplink-deco#configuration-important-please-read

@mousawm
Copy link
Author

mousawm commented Mar 7, 2022

Added code to handle UNKNOWN issue in latest release v2.0.1.

403 error may indicate that the credentials you are using do not have permissions. Did you follow the README to use the admin account? https://github.com/amosyuen/ha-tplink-deco#configuration-important-please-read

yea I'm using admin account.

aha I see that this error appears when I open the Deco app, using the owner account.

This error originated from a custom integration.

Logger: custom_components.tplink_deco
Source: custom_components/tplink_deco/api.py:293
Integration: TP-Link Deco (documentation, issues)
First occurred: 2:16:54 PM (1 occurrences)
Last logged: 2:16:54 PM

List Devices client response error: 403, message='Forbidden', url=URL('http://192.168.121.113/cgi-bin/luci/;stok=d08670f7235975633eb467232e4cfae1/admin/device?form=device_list')

unfortunately when I use manager account I lose the option to reboot all devices in one click :(

@amosyuen
Copy link
Owner

amosyuen commented Mar 7, 2022

Yeah, unfortunately that's a restriction of the deco only allowing admin to log in on web portal and only allowing one session.

It does look like the web admin portal has the ability to reboot specific devices or all devices. So that is a feature I could look into adding in the future. Though let's track that in a different issue. Could you open an issue for that?

Could you confirm whether the UNKNOWN ip address issue is fixed?

@amosyuen amosyuen changed the title Error after switching to access point as operation mode UNKNOWN ip address error after switching to access point as operation mode Mar 7, 2022
@mousawm
Copy link
Author

mousawm commented Mar 8, 2022

Yeah, unfortunately that's a restriction of the deco only allowing admin to log in on web portal and only allowing one session.

It does look like the web admin portal has the ability to reboot specific devices or all devices. So that is a feature I could look into adding in the future. Though let's track that in a different issue. Could you open an issue for that?

Could you confirm whether the UNKNOWN ip address issue is fixed?

the issue have been fixed thank you, I'll open a feature request to add restart all devices option.

sure I'll open a feature request.

I'll close the issue as it been resolved :)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants