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

Fix for ros 7.13 wireless #332

Merged
merged 3 commits into from
Feb 14, 2024
Merged

Fix for ros 7.13 wireless #332

merged 3 commits into from
Feb 14, 2024

Conversation

slackr31337
Copy link

@slackr31337 slackr31337 commented Dec 8, 2023

Proposed change

Update to coordinator for RouterOS > 7.12 with new wifi packages

Type of change

  • Bugfix
  • New feature
  • Code quality improvements to existing code or addition of tests
  • Documentation

Additional information

Checklist

  • The code change is tested and works locally.
  • The code has been formatted using Black.
  • Tests have been added to verify that the new code works.
  • Documentation added/updated if required.

@tomaae
Copy link
Owner

tomaae commented Dec 17, 2023

Did you test this with wifi/wifi-qcom/wifi-qcom-ac modules disabled or not installed?
Not sure how it works in 7.13, but integration may crash in that case.

@SkeLLLa
Copy link

SkeLLLa commented Dec 18, 2023

@tomaae
I just have such device, where neither wifi, nor old wireless package installed. So in the package list there are no packages except routeros.

On routeros >=7.13, if you have no extra wifi packages, the route interface/wifi/registration-table is available, so this fix should work fine. I can doublecheck it on real device through hacs after merging to master or releasing some beta version.

@L2jLiga
Copy link
Contributor

L2jLiga commented Dec 19, 2023

Checked on my CCR1008-8G-1S-1S+

ROS 7.13.0
no wireless package

image

@slackr31337
Copy link
Author

Did you test this with wifi/wifi-qcom/wifi-qcom-ac modules disabled or not installed? Not sure how it works in 7.13, but integration may crash in that case.

Yes, I have tested this on a CRS309-1G-8S+ with only the routeros package installed.

@L2jLiga L2jLiga mentioned this pull request Jan 3, 2024
@Yamaha0014
Copy link

Hi is it possible upload corrected file coordinator.py ? On pastebin or another service?

@slackr31337
Copy link
Author

slackr31337 commented Jan 11, 2024

Hi is it possible upload corrected file coordinator.py ? On pastebin or another service?

https://raw.githubusercontent.com/slackr31337/homeassistant-mikrotik_router/ros-7.13/custom_components/mikrotik_router/coordinator.py

@ilwalti
Copy link

ilwalti commented Jan 11, 2024

Nope...

Logger: homeassistant.setup
Source: setup.py:251
First occurred: 13:57:29 (1 occurrences)
Last logged: 13:57:29

Setup failed for custom integration 'mikrotik_router': Unable to import component: cannot import name 'CONF_SENSOR_NETWATCH_TRACKER' from 'custom_components.mikrotik_router.const' (/config/custom_components/mikrotik_router/const.py)
Traceback (most recent call last):
File "/usr/src/homeassistant/homeassistant/setup.py", line 251, in _async_setup_component
component = integration.get_component()
^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/usr/src/homeassistant/homeassistant/loader.py", line 822, in get_component
ComponentProtocol, importlib.import_module(self.pkg_path)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/usr/local/lib/python3.11/importlib/init.py", line 126, in import_module
return _bootstrap._gcd_import(name[level:], package, level)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "", line 1204, in _gcd_import
File "", line 1176, in _find_and_load
File "", line 1147, in _find_and_load_unlocked
File "", line 690, in _load_unlocked
File "", line 940, in exec_module
File "", line 241, in _call_with_frames_removed
File "/config/custom_components/mikrotik_router/init.py", line 16, in
from .coordinator import MikrotikData, MikrotikCoordinator, MikrotikTrackerCoordinator
File "/config/custom_components/mikrotik_router/coordinator.py", line 33, in
from .const import (
ImportError: cannot import name 'CONF_SENSOR_NETWATCH_TRACKER' from 'custom_components.mikrotik_router.const' (/config/custom_components/mikrotik_router/const.py)

You have also to add in const.py these two lines:

CONF_SENSOR_NETWATCH_TRACKER = "sensor_netwatch"
DEFAULT_SENSOR_NETWATCH_TRACKER = False

after line 60

@erkedocara
Copy link

erkedocara commented Jan 11, 2024

this custom repo didn't worked for me Hap ax 3 ros 7.13
image
image

@VolodymyrLykhachov
Copy link

It works for me after adding:
CONF_SENSOR_NETWATCH_TRACKER = "sensor_netwatch"
DEFAULT_SENSOR_NETWATCH_TRACKER = False
after line 60
to /config/custom_components/mikrotik_router/const.py

@sermayoral
Copy link
Contributor

sermayoral commented Jan 13, 2024

You can also switch the mikrotik custom component to master branch in HACS, after that update the coordinator.py file of this branch and restart HA.

@M0DDer
Copy link

M0DDer commented Jan 14, 2024

It works for me after adding: CONF_SENSOR_NETWATCH_TRACKER = "sensor_netwatch" DEFAULT_SENSOR_NETWATCH_TRACKER = False after line 60 to /config/custom_components/mikrotik_router/const.py

With this changes and replace with file at the top of the page all work's fine even at 7.14 beta 6

@im-kulikov
Copy link

it works without any changes for me 👍

@jajera
Copy link

jajera commented Jan 20, 2024

it worked for me with on hap ax2 after changing to this.

CONF_SENSOR_NETWATCH_TRACKER = "sensor_netwatch"

modified version is at my forked copy https://github.com/jajera/homeassistant-mikrotik_router

@namadori
Copy link

@tomaae any timeframe when this pull request will be merged? It's almost 2 months that the solution to #332 is ready and it seems to have been successfully tested by different users.

@sidewinder94
Copy link

I can also confirm that it does fix the issue.

Running HaOS 11.4, with a CRS310-8G+2S+ on firmware 7.13.3 and the wireless package disabled.

Any ETA for merging this ?

@tomasz-soltysik
Copy link

tomasz-soltysik commented Feb 3, 2024

@tomaae if this is not planner for merge in upcomming days, could we get this tagged as beta, so that it is easier to get it and also test in different setups?

Copy link

@petr-kozak petr-kozak left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

nice

@slackr31337
Copy link
Author

Is there anything I need to do or am I holding up this merge?

@petr-kozak
Copy link

petr-kozak commented Feb 5, 2024 via email

@rinners
Copy link

rinners commented Feb 14, 2024

It works for me after adding: CONF_SENSOR_NETWATCH_TRACKER = "sensor_netwatch" DEFAULT_SENSOR_NETWATCH_TRACKER = False after line 60 to /config/custom_components/mikrotik_router/const.py

Was able to add router, but now showing wireless clients on all APs as "0"

@ilwalti
Copy link

ilwalti commented Feb 14, 2024

Since 2 days ago there is a new (small) problem: every 2/3 minutes, both of my Mikrotik with 7.13.4 OS are marked as non up to date in logfile. The problem resolves itself in a few seconds, but it's annoying...
Another router with 6.x RouterOS have no issues.
AFAIK, the problem isn't between HA and the router, but between HA and Mikrotik repository, because in integration I see the second line, called "Latest version" to become unknown...
(see the attached screenshots)

Screenshot 2024-02-14 110103
Screenshot 2024-02-14 110615

Any ideas?

@namadori
Copy link

Since 2 days ago there is a new (small) problem: every 2/3 minutes, both of my Mikrotik with 7.13.4 OS are marked as non up to date in logfile.

I think you should report this as a separate issue, this is the PR for a different fix and it will get lost once the PR is merged.

@ilwalti
Copy link

ilwalti commented Feb 14, 2024

I think you should report this as a separate issue, this is the PR for a different fix and it will get lost once the PR is merged.

Makes sense. Thanks.

@tomaae tomaae merged commit 5feb9ad into tomaae:master Feb 14, 2024
1 check passed
@github-actions github-actions bot locked and limited conversation to collaborators Feb 22, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.