Mikrotik Binding API error with RouterOS 7.18

ROS 7.18 seemingly changed something. First of all Mikrotik is now logging all logins and logouts of openhab, didnt do that before.

But also openhab is spamming my log with stack-traces (see below). Is there anything I can try or do? The items are still filled with values and there are no errors shown in the things. So seems “just” like an issue that is in the logs. But its hard to see anything else in the log.

ERROR: RouterOS cache refresh failed in mikrotik:routeros:Mikrotik_hEX_refresh_E50UG due to Mikrotik API error

... 13 more
2025-03-12 09:06:01.474	
	at me.legrange.mikrotik.impl.ApiConnectionImpl$SyncListener.getResults(ApiConnectionImpl.java:474) ~[?:?]
2025-03-12 09:06:01.474	
Caused by: me.legrange.mikrotik.ApiConnectionException: Command timed out after 60000 ms
2025-03-12 09:06:01.474	
	at java.lang.Thread.run(Thread.java:840) [?:?]
2025-03-12 09:06:01.474	
	at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:635) [?:?]
2025-03-12 09:06:01.474	
	at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1136) [?:?]
2025-03-12 09:06:01.474	
	at java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.run(ScheduledThreadPoolExecutor.java:305) [?:?]
2025-03-12 09:06:01.474	
	at java.util.concurrent.FutureTask.runAndReset(FutureTask.java:305) [?:?]
2025-03-12 09:06:01.474	
	at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:539) [?:?]
2025-03-12 09:06:01.474	
	at org.openhab.binding.mikrotik.internal.handler.MikrotikRouterosBridgeHandler.scheduledRun(MikrotikRouterosBridgeHandler.java:190) ~[?:?]
2025-03-12 09:06:01.474	
	at org.openhab.binding.mikrotik.internal.handler.MikrotikRouterosBridgeHandler.performRefresh(MikrotikRouterosBridgeHandler.java:202) ~[?:?]
2025-03-12 09:06:01.474	
	at org.openhab.binding.mikrotik.internal.model.RouterosDevice.refresh(RouterosDevice.java:167) ~[?:?]
2025-03-12 09:06:01.474	
	at org.openhab.binding.mikrotik.internal.model.RouterosDevice.updateResources(RouterosDevice.java:347) ~[?:?]
2025-03-12 09:06:01.474	
	at me.legrange.mikrotik.impl.ApiConnectionImpl.execute(ApiConnectionImpl.java:75) ~[?:?]
2025-03-12 09:06:01.474	
	at me.legrange.mikrotik.impl.ApiConnectionImpl.execute(ApiConnectionImpl.java:117) ~[?:?]
2025-03-12 09:06:01.474	
	at me.legrange.mikrotik.impl.ApiConnectionImpl$SyncListener.access$100(ApiConnectionImpl.java:436) ~[?:?]
2025-03-12 09:06:01.474	
	at me.legrange.mikrotik.impl.ApiConnectionImpl$SyncListener.getResults(ApiConnectionImpl.java:482) ~[?:?]
2025-03-12 09:06:01.474	
me.legrange.mikrotik.MikrotikApiException: Command timed out after 60000 ms
1 Like

I’m encountering the same errors. I attempted to remove and reinstall/recreate the binding, things, and items, but it didn’t resolve the issue.

It looks like the error originates from this line: mikrotik-java/src/main/java/me/legrange/mikrotik/impl/ApiConnectionImpl.java at ec5f6650816e5e63a00fbb0ae3aa511493df3a65 · GideonLeGrange/mikrotik-java · GitHub

All commands from here: openhab-addons/bundles/org.openhab.binding.mikrotik/src/main/java/org/openhab/binding/mikrotik/internal/model/RouterosDevice.java at main · openhab/openhab-addons · GitHub (line 56-64) return results, except for

/interface/wifi/registration-table/print
and
/interface/wireless/registration-table/print

I’m using CapsMan and only have the wireless package installed (not the wifi-qcom or wifi-qcom-ac). The router I’m connecting to doesn’t have any internal wifi interfaces.

It began after I upgraded from version 7.17.1 to 7.18.
Didn’t see anything obvious here: MikroTik Routers and Wireless - Software

Running OpenHAB 4.3.3 release build, “official” Mikrotik binding from the store.

In my case presence detection is extremely slow, It takes (openhab/the binding) forever to detect that my phone is connected to the wifi. This used to be within a minute or so. (I have no wifi issues, my phone connects as it used to)

[edit:]

Completely missed this issue: support api 7.18 · Issue #89 · GideonLeGrange/mikrotik-java · GitHub

[edit]

There seems to be a fix: Fix of !empty response introduced in RouterOS 7.18 by dangelcz · Pull Request #90 · GideonLeGrange/mikrotik-java · GitHub Now how do we get this fix into the binding?

1 Like

I also have the error.
As an addendum: On my Raspberry Pi 4, one CPU core is permanently 100% utilized by the binding.
As soon as I deactivate the binding, the load goes down immediately.

1 Like

oh thanks for pointing out the load-issue, I was wondering why my USV is reporting a higher load and also why my total power consumption was rising. At least found that culprit. I will disable the binding for now.

No problem.
Do you also have the following in the log when binding is deactivated?
[ERROR] [andler.MikrotikRouterosBridgeHandler] - RouterOS device is null in scheduledRun ?
Comes up every 10 seconds for me.
I only have one MikroTik router.

Update: After a reboot of openhab, the Error is gone.

same here, before reboot every 10 seconds that error message, now after reboot the log is finally coming back to a normal state