tomaae / homeassistant-mikrotik_router

Mikrotik router integration for Home Assistant
Apache License 2.0
302 stars 51 forks source link

[Bug] Integration doesn't work with RouterOS 7.13 Beta #328

Open Foroxon opened 10 months ago

Foroxon commented 10 months ago

Describe the issue

Integration doesn't work

How to reproduce the issue

Steps to reproduce the behavior:

  1. Upgrade Router OS to 7.13 beta2 on device

Expected behavior

It should work like on Router OS <7.13

Software versions

Diagnostics data

No

Traceback/Error logs

Logger: custom_components.mikrotik_router.mikrotikapi Source: custom_components/mikrotik_router/mikrotikapi.py:95 Integration: Mikrotik Router (documentation, issues) First occurred: 14 листопада 2023 р. о 21:42:42 (660 occurrences) Last logged: 12:16:05

Mikrotik 192.168.86.2 error while building list for path /caps-man/registration-table : no such command or directory (caps-man), no such command prefix

L2jLiga commented 10 months ago

Did you tried to install "wireless" package as a workaround? Since CAPsMAN now moved to this package it should work well

YaoFei509 commented 10 months ago

Did you tried to install "wireless" package as a workaround? Since CAPsMAN now moved to this package it should work well

wireless package will confilict with new wifi-qcom package. So it's better check whether CAPSMAX exists.

L2jLiga commented 10 months ago

So in wifi-qcom CAPsMAN renamed to CAPsMAX? If so, then integration now have to check both in order to keep compatibility and provide new functionality

Foroxon commented 10 months ago

So in wifi-qcom CAPsMAN renamed to CAPsMAX? If so, then integration now have to check both in order to keep compatibility and provide new functionality

wifi-qcom is just a driver for wifi hardware and does not add any interfaces.

So, as I understand "wireless" package was renamed to "wifi", so now CAPsMAN can be found on interface wifi capsman

Screenshot 2023-11-22 at 11 18 25
L2jLiga commented 10 months ago

For ROS < 7.13: /caps-man For ROS >= 7.13: /interface/wifi/capsman when wireless package installed

Is it correct?

Foroxon commented 10 months ago

Yes. But also it was totally rewritten. So there is no more /interface/wifi/capsman/registration-table as it was on /caps-man/registration-table. Now it's common for local managed wifi and CAPsMAN managed wifi and located in /interface/wifi/registration-table. It may be similar for other old caps-man functions.

Edit: also we do not need to install additional wireless package to have /interface/wifi/capsman. Now it's included to base RouterOS package.

L2jLiga commented 10 months ago

I'm glad that I decided to stay on 7.12.1 😅

GlenWi commented 10 months ago

I have this exact issue also.

2023-11-25 19:17:10.751 WARNING (SyncWorker_3) [homeassistant.components.mikrotik.hub] Mikrotik 192.168.88.1 failed to retrieve data. cmd=[/caps-man/interface/print] Error: no such command or directory (caps-man), no such command prefix 2023-11-25 19:17:10.753 WARNING (SyncWorker_3) [homeassistant.components.mikrotik.hub] Mikrotik 192.168.88.1 failed to retrieve data. cmd=[/interface/wireless/print] Error: no such command or directory (wireless), no such command prefix 2023-11-25 19:17:10.754 WARNING (SyncWorker_3) [homeassistant.components.mikrotik.hub] Mikrotik 192.168.88.1 failed to retrieve data. cmd=[/interface/wifiwave2/print] Error: no such command or directory (wifiwave2), no such command prefix 2023-11-25 19:17:14.211 ERROR (SyncWorker_5) [custom_components.mikrotik_router.mikrotikapi] 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 2023-11-25 19:17:29.026 ERROR (SyncWorker_0) [custom_components.mikrotik_router.mikrotikapi] 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 2023-11-25 19:17:42.597 ERROR (SyncWorker_8) [custom_components.mikrotik_router.mikrotikapi] 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 2023-11-25 19:18:05.791 ERROR (SyncWorker_2) [custom_components.mikrotik_router.mikrotikapi] 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 2023-11-25 19:18:49.419 ERROR (SyncWorker_9) [custom_components.mikrotik_router.mikrotikapi] 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 2023-11-25 19:20:12.635 ERROR (SyncWorker_7) [custom_components.mikrotik_router.mikrotikapi] 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 2023-11-25 19:21:35.120 ERROR (SyncWorker_5) [custom_components.mikrotik_router.mikrotikapi] 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 2023-11-25 19:22:57.413 ERROR (SyncWorker_6) [custom_components.mikrotik_router.mikrotikapi] 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 2023-11-25 19:24:20.032 ERROR (SyncWorker_6) [custom_components.mikrotik_router.mikrotikapi] 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

2023-11-25 19:25:42.635 ERROR (SyncWorker_7) [custom_components.mikrotik_router.mikrotikapi] 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 2023-11-25 19:27:05.064 ERROR (SyncWorker_9) [custom_components.mikrotik_router.mikrotikapi] 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 2023-11-25 19:27:40.629 ERROR (SyncWorker_9) [custom_components.mikrotik_router.mikrotikapi] 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 2023-11-25 19:27:48.116 ERROR (SyncWorker_6) [custom_components.mikrotik_router.mikrotikapi] 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 2023-11-25 19:28:00.331 ERROR (SyncWorker_6) [custom_components.mikrotik_router.mikrotikapi] 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 2023-11-25 19:28:22.802 ERROR (SyncWorker_0) [custom_components.mikrotik_router.mikrotikapi] 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 2023-11-25 19:28:27.241 ERROR (SyncWorker_4) [custom_components.mikrotik_router.mikrotikapi] 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 2023-11-25 19:29:05.370 ERROR (SyncWorker_2) [custom_components.mikrotik_router.mikrotikapi] 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 2023-11-25 19:29:49.701 ERROR (SyncWorker_7) [custom_components.mikrotik_router.mikrotikapi] 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 2023-11-25 19:31:12.221 ERROR (SyncWorker_10) [custom_components.mikrotik_router.mikrotikapi] 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 2023-11-25 19:32:34.805 ERROR (SyncWorker_1) [custom_components.mikrotik_router.mikrotikapi] 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

tomaae commented 10 months ago

yea, I never touch betas. specially with mikrotik, they often change major things mid betas. good to know about this tho, if it makes it to at least RC, I will implement it.

GlenWi commented 10 months ago

Hi Tomaae, Yes, It's on RC2 now so I expect it will be in.

slackr31337 commented 10 months ago

I added a PR to fix this. (Fix for ros 7.13 wireless #332)

Lieta2 commented 9 months ago

7.13 stable was released today. Before 7.13 these existed: /interface/wireless/ /caps-man/interface/ Starting from 7.13: /interface/wifi/ /interface/wifi/capsman /interface/wifiwave2 is alias to /interface/wifi

fragtion commented 9 months ago

The wireless package is now optional. Integration setup should be possible without wireless/capsman, but that is not so. Setup fails to initialize the device...: image Routeros v7.13 stable

M0DDer commented 9 months ago

I'm waiting for update

VladimirV01 commented 9 months ago

I have the same issue.

Upgraded to ROS 7.13 and the integration does not work.

Yamaha0014 commented 9 months ago

Hi, After ugraded to 7.13 integration not connect to router. My router C53UiG+5HPaxD2HPaxD (Mikrotik AX3), We wait for update integration. Thenks for Your great job.

vheneraliuk commented 9 months ago

Why does it take so long to fix this issue? I can't use this integration for about two months now.

GlenWi commented 9 months ago

Same here. Maybe it's a difficult problem to solve? It looks pretty embedded in Mikrotik's roadmap as 7.14 beta is using the same structure now.

M0DDer commented 8 months ago

It Works even at 7.14 !

With this file, added manualy from (you need to replace file) custom_components/mikrotik_router/coordinator.py

and this changes (you need to add 2 lines) [custom_components/mikrotik_router/coordinator.py](https://github.com/tomaae/homeassistant-mikrotik_router/pull/332/files/1bbedfaa8b411553876b8cb9454d925bb284a2b2#diff-4a39d7d77d0cdde5dca3c20452a70e10c9b684d6b94524b0e46a71389d109572)

Работает даже в 7.14 !

Скачать и заменить файл custom_components/mikrotik_router/coordinator.py

Добавить две строчки в другой файл [custom_components/mikrotik_router/coordinator.py](https://github.com/tomaae/homeassistant-mikrotik_router/pull/332/files/1bbedfaa8b411553876b8cb9454d925bb284a2b2#diff-4a39d7d77d0cdde5dca3c20452a70e10c9b684d6b94524b0e46a71389d109572)

ranrinc commented 8 months ago

It Works even at 7.14 !

With this file, added manualy from (you need to replace file) custom_components/mikrotik_router/coordinator.py

and this changes (you need to add 2 lines) [custom_components/mikrotik_router/coordinator.py](#332 (comment))

Работает даже в 7.14 !

Скачать и заменить файл custom_components/mikrotik_router/coordinator.py

Добавить две строчки в другой файл [custom_components/mikrotik_router/coordinator.py](#332 (comment))

Which coordinator.py do I need to download/replace 1st or 2nd one? TIA

L2jLiga commented 8 months ago

Actually you have 2 more options to install version from #332

Option 1 - Like HACS manual install Just follow [HACS manual install instruction](https://github.com/claytonjn/hacs/blob/master/docs/installation/manual.md), except steps 2 and 3 download zip file from this specific branch on repo [short link](https://github.com/slackr31337/homeassistant-mikrotik_router/tree/ros-7.13) via "Code" -> "Download zip" ![image](https://github.com/tomaae/homeassistant-mikrotik_router/assets/11780854/69bbdacd-1624-46c3-93bf-cff10895c6d0)
Option 2 - Install via Shell ```shell ~/config$ cd custom_components/ ~/config/custom_components$ rm -Rf mikrotik_router ~/config/custom_components$ curl https://codeload.github.com/slackr31337/homeassistant-mikrotik_router/zip/refs/heads/ros-7.13 -o master.zip ~/config/custom_components$ unzip master.zip ~/config/custom_components$ mv homeassistant-mikrotik_router-ros-7.13/custom_components/mikrotik_router/ . ~/config/custom_components$ rm -Rf homeassistant-mikrotik_router-ros-7.13/ ~/config/custom_components$ rm -Rf master.zip ~/config/custom_components$ ls -l total 4 drwxrwxr-x 3 user user 4096 Dec 27 14:28 mikrotik_router ```
mrbaja commented 8 months ago

After using @M0DDer 's fix, integration is working again, however number of wired clients is not working, it always reports 0. Is anyone else having the same issue?

GlenWi commented 8 months ago

Yes, I have the same issue - 3 wired clients but the integration says 0

FrankGiesecke commented 7 months ago

Is there any working solution for this issue?

I have two MikroTik machines, one "RB5009UG+S+" an one "hAP ax lite LTE6".
Both integrations run the same error:

2024-02-22 13:32:03.123 ERROR (SyncWorker_2) [custom_components.mikrotik_router.mikrotikapi] Mikrotik xxx.xxx.xxx.xxx error while building list for path /caps-man/registration-table : no such command or directory (caps-man), no such command prefix

But the integration of RB5009 seems to works.
All interfaces are queries and the entities will be available in HA.

But the integration of the hAP doesn't.

Both routers are running on RouterOS v7.13.5

FrankGiesecke commented 7 months ago

More strange things: After restarting my HA instance, both integrations won't work.

tomaae commented 7 months ago

are you on latest master?

FrankGiesecke commented 7 months ago

No, I'm on v2.1.4

FrankGiesecke commented 7 months ago

@tomaae please, can you explain how to switch to Master in HACS? I‘ve tried to select master from the version dropdown, but it doesn‘t affect the version to install.

tomaae commented 7 months ago

it no longer works, HACS decided letting zip distributed integrations to install master was a bug. You will have to download and install it manually

FrankGiesecke commented 7 months ago

@tomaae Thanks for your reply. Install it manually work. Now I can connect to my MikroTik. 🙏

FrankGiesecke commented 7 months ago

@tomaae Did you plan to release a new version?

tomaae commented 7 months ago

of course, but I need time. new version wont be just about mikrotik features

Yamaha0014 commented 7 months ago

Today Mikrotik relase new stable version 7.14, has anyone already tested if the integration still works?

nico282 commented 7 months ago

of course, but I need time. new version wont be just about mikrotik features

Sorry I don’t understand. You are going to leave the non working version of the integration as the latest release? Why?

Roving-Ronin commented 7 months ago

Today Mikrotik relase new stable version 7.14, has anyone already tested if the integration still works?

@Yamaha0014 Updated CCR2004 to 7.14 and HA 2024.2.4 appears to be working fine with it.

FrankGiesecke commented 7 months ago

of course, but I need time. new version wont be just about mikrotik features

Oh, but why?
The current version is broken and can no longer be used with up-to-date MikroTik devices.
IMHO: It would make sense to release a new version. This will avoid new users to run into problems.

Yamaha0014 commented 7 months ago

Today Mikrotik relase new stable version 7.14, has anyone already tested if the integration still works?

@Yamaha0014 Updated CCR2004 to 7.14 and HA 2024.2.4 appears to be working fine with it.

Ok, Ax3 working, too. B. R. Yamaha0014

Axotopia commented 7 months ago

RB5009UPr+S+ working w/ RouterOS 7.14 L009UiGS-2HaxD still getting ..'Failed setup, will retry'

shaarkys commented 7 months ago

Interesting, I have 1x RB960PGS on 7.15beta4 and it works well (CAPSMAN), and two AP cAPGi-5HaxD2HaxD managed by CAPSMAN on version 7.15beta4 - first works, the other two fails with error :

error while building list for path /caps-man/registration-table

Not sure it helps with anything but it't not just about RouterOS version.

I'm on version 2.1.4 btw - that did not work, so installed ZIP from the GitHUB and it works now.

lafriks commented 6 months ago

Any chance of new version release?

Korvenwin commented 6 months ago

I'm using Mikrotik 7.14.1 and HAss 2024.3.1 and I'm having same issue.

It works fine until I removed it and then added again.

I suspect that it was because he integration was configured while RouterOS was on v6.x and after updating to 7.x it worked.

Now as a new setup with v7.14 it can't start the configuration.

I would be very very grateful to @tomaae if he/she could find some time to fix this error. The integration is GREAT

fencer commented 6 months ago

installed this today and got stuck because of this issue.

tomaae commented 6 months ago

I'm using Mikrotik 7.14.1 and HAss 2024.3.1 and I'm having same issue.

It works fine until I removed it and then added again.

I suspect that it was because he integration was configured while RouterOS was on v6.x and after updating to 7.x it worked.

Now as a new setup with v7.14 it can't start the configuration.

I would be very very grateful to @tomaae if he/she could find some time to fix this error. The integration is GREAT

pretty sure it already works on master

Korvenwin commented 6 months ago

I'm still getting this:

"Mikrotik 192.168.X.X error while building list for path /caps-man/registration-table : no such command or directory (caps-man), no such command prefix"

tomaae commented 6 months ago

are you sure you are on most recent master version?

Korvenwin commented 6 months ago

I'm using most recent version on HACS: v2.1.4

tomaae commented 6 months ago

yes, I'm talking about master, not v2.1.4

Korvenwin commented 6 months ago

Please, let me know how to install master. In my HACS it doesn't appear.

lafriks commented 6 months ago

Same for me, does not seems to be able to select master as install version in HACS

tomaae commented 6 months ago

HACS decided to remove that option. Only way to get master is to install it manually. Another option is to wait for release.