homeassistant-mikrotik_router icon indicating copy to clipboard operation
homeassistant-mikrotik_router copied to clipboard

[Bug] Wireless clients always shows 0

Open DIMMonchik opened this issue 2 years ago • 30 comments

Describe the issue

Wireless clients always shows 0.

How to reproduce the issue

Expected behavior

Screenshots

Software versions

  • Home Assistant version: 2023.10.1
  • Mikrotik Router integration version: 2.1.4
  • Mikrotik Hardware: hAP ac^2
  • RouterOS version: 7.11.2 (stable)

Diagnostics data

Traceback/Error logs

Additional context

DIMMonchik avatar Oct 12 '23 07:10 DIMMonchik

pretty sure I seen someone reporting this already. do you have host tracking enabled?

tomaae avatar Oct 13 '23 13:10 tomaae

pretty sure I seen someone reporting this already. do you have host tracking enabled?

https://drive.google.com/file/d/1bjrSpBEMembYDgHJ3HZed5ZnBKmUIww0/view?usp=sharing

It seems to be all inclusive

DIMMonchik avatar Oct 13 '23 14:10 DIMMonchik

ok, can you attach integration diagnostics data?

tomaae avatar Oct 13 '23 15:10 tomaae

config_entry-mikrotik_router-82bc866e19f82f6526cf6c88002acda9.json.txt

ok, can you attach integration diagnostics data?

DIMMonchik avatar Oct 14 '23 11:10 DIMMonchik

thats because you dont have any wireless clients on that device. "wireless": {}, "wireless_hosts": {},

tomaae avatar Oct 23 '23 21:10 tomaae

thats because you dont have any wireless clients on that device. "wireless": {}, "wireless_hosts": {},

2023-10-24_08-42-29

DIMMonchik avatar Oct 24 '23 05:10 DIMMonchik

I cannot repro:

image

Unfortunately the docu says little about what sensor in the config is for what, but if I am not mistaken your need "Port tracker sensors" enabled to get these statistics.

Zarox666 avatar Oct 26 '23 10:10 Zarox666

I cannot repro:

image

Unfortunately the docu says little about what sensor in the config is for what, but if I am not mistaken your need "Port tracker sensors" enabled to get these statistics.

I have this option enabled

DIMMonchik avatar Oct 26 '23 14:10 DIMMonchik

Only other Sensor that I have enabled besides Device Tracker is "Environmental Variable Sensors". Have you tried this?

Might not sound very logic at first, but as it gives the overall number of Wifi Clients, not seperated by the different Ports, Interfaces or Networks, it must be a very global source sensor.

Zarox666 avatar Oct 26 '23 21:10 Zarox666

Only other Sensor that I have enabled besides Device Tracker is "Environmental Variable Sensors". Have you tried this?

Might not sound very logic at first, but as it gives the overall number of Wifi Clients, not seperated by the different Ports, Interfaces or Networks, it must be a very global source sensor.

when this sensor is turned on, the integration stops working

DIMMonchik avatar Oct 27 '23 06:10 DIMMonchik

image

That sounds, that there is something seriously wrong. Have you tried uninstalling/reinstalling the integration?

Zarox666 avatar Oct 27 '23 06:10 Zarox666

Same here, I never get wifi clients in homeassistant with this integration ( 2 years ago), I think is same diferent configuration in mikrotik like dhcp manual config or arp, but I dont know... I need investigate how get the wifi clients to found the problem.

jfjeronimo avatar Oct 29 '23 13:10 jfjeronimo

Hi,

I solved it yesterday, I made a couple of changes in Mikrotik and reload the mikrotik integration in HA and works.

1, Fix permissions in mikrotik following tutorial ( I had too much permissions, strange but... ) image

2, Remove Acl by Mac in Wireless devices (really useless today).

And.. ready!

image

I hope help you @DIMMonchik !!

jfjeronimo avatar Oct 30 '23 15:10 jfjeronimo

Hi,

I solved it yesterday, I made a couple of changes in Mikrotik and reload the mikrotik integration in HA and works.

1, Fix permissions in mikrotik following tutorial ( I had too much permissions, strange but... ) image

2, Remove Acl by Mac in Wireless devices (really useless today).

And.. ready!

image

I hope help you @DIMMonchik !!

unfortunately this is not my case

DIMMonchik avatar Oct 31 '23 15:10 DIMMonchik

No idea what is happening in your case. Can you run integration in debug? we should find out more that way.

tomaae avatar Nov 04 '23 23:11 tomaae

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs.

github-actions[bot] avatar Nov 19 '23 01:11 github-actions[bot]

This issue was closed because it has been stalled for 5 days with no activity.

github-actions[bot] avatar Nov 27 '23 01:11 github-actions[bot]

I have the same issue with RouterOS 7.12, 7.12.1 and alos 7.13. I'm using CapsMan for all Wireless devices, and in the "Registration Table" I have ~10 Devices.

HA-Settings: image image

Mikrotik-Group-Permissions: image

Has someone an idea, what's the reason? br

VolleyTom8 avatar Dec 15 '23 16:12 VolleyTom8

I need those debugs to figure out whats wrong also include diagnostics taken right after debugs (in same ha session)

tomaae avatar Dec 18 '23 00:12 tomaae

Hallo,Could you Tell me which Logs you Need, because I‘m New With HomeAssistant.BR TomAm 18.12.2023 um 01:22 schrieb Tomaae @.***>: I need those debugs to figure out whats wrong

—Reply to this email directly, view it on GitHub, or unsubscribe.You are receiving this because you commented.Message ID: @.***>

VolleyTom8 avatar Dec 18 '23 05:12 VolleyTom8

Sure. First, follow instruction here to enable debug logs for integration and restart home assistant afterwards: https://github.com/tomaae/homeassistant-mikrotik_router?tab=readme-ov-file#enabling-debug

Let it run for about 2 minutes, then download diagnostics: https://github.com/tomaae/homeassistant-mikrotik_router?tab=readme-ov-file#diagnostics

Download /config/home-assistant.log file from you HA.

Afterwards revert debug config changes and restart HA again.

tomaae avatar Dec 18 '23 06:12 tomaae

I activated the logging and downloaded the file. Could I mail this directly to you, because there a IP/MAC/etc. inside. BR Tom

VolleyTom8 avatar Dec 18 '23 08:12 VolleyTom8

I activated the logging and downloaded the file. Could I mail this directly to you, because there a IP/MAC/etc. inside. BR Tom

I had a look at the logs and found the following:

2023-12-20 21:23:55.231 ERROR (MainThread) [custom_components.mikrotik_router.coordinator] Unexpected error fetching MyRouter-AC3 data: '*1'
Traceback (most recent call last):
  File "/usr/src/homeassistant/homeassistant/helpers/update_coordinator.py", line 300, in _async_refresh
    self.data = await self._async_update_data()
                ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/config/custom_components/mikrotik_router/coordinator.py", line 599, in _async_update_data
    await self.hass.async_add_executor_job(self.get_wireless)
  File "/usr/local/lib/python3.11/concurrent/futures/thread.py", line 58, in run
    result = self.fn(*self.args, **self.kwargs)
             ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/config/custom_components/mikrotik_router/coordinator.py", line 1967, in get_wireless
    self.ds["wireless"][uid][tmp] = self.ds["wireless"][
                                    ^^^^^^^^^^^^^^^^^^^^
KeyError: '*1'

Hope this helps. br Tom

VolleyTom8 avatar Dec 20 '23 20:12 VolleyTom8

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs.

github-actions[bot] avatar Jan 04 '24 01:01 github-actions[bot]

Do you need something Else from my Site?

VolleyTom8 avatar Jan 04 '24 05:01 VolleyTom8

it might be related to this issue: a Chateau running 7.12 only shows wireless clients at the 2ghz wireless interface, and the clients from the 5ghz are not included in the wireless count

mainTAP avatar Jan 05 '24 21:01 mainTAP

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs.

github-actions[bot] avatar Jan 20 '24 01:01 github-actions[bot]

Hello, I also don't see the wireless clients. I tried enabling the Enviromental Variable Sensor (which is probably the fix) but that breaks the integration and gives me this error in the log:

Logger: custom_components.mikrotik_router.mikrotikapi
Source: custom_components/mikrotik_router/mikrotikapi.py:95
Integration: Mikrotik Router ([documentation](https://github.com/tomaae/homeassistant-mikrotik_router), [issues](https://github.com/tomaae/homeassistant-mikrotik_router/issues))
First occurred: February 2, 2024 at 22:52:07 (37 occurrences)
Last logged: 01:37:40

    Mikrotik 192.168.88.1 error while building list for path /caps-man/registration-table : no such command or directory (caps-man), no such command prefix
    Mikrotik 192.168.88.1 error while building list for path /system/script/environment : not enough permissions (9)

I have AX3 using RouterOS 7.13.3 with the wifi-qcom package

fineryx avatar Feb 03 '24 00:02 fineryx

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs.

github-actions[bot] avatar Feb 17 '24 01:02 github-actions[bot]

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs.

github-actions[bot] avatar Mar 04 '24 01:03 github-actions[bot]