Well, I’m new at Mikrotik and fail at basic steps.
I created a new user group with the appropriate permissions (this is a user just for polling data) and assigned a newly created user to it. When I’m trying to login as that user I’m getting a “You have connected to a router. Administrative access only.” error. I already tried rebooting the router (it’s a wAP LR8 running RouterOS 7.15.3).
But I can’t find any way to disable administrative access only.
I didn’t understand what this user group should have access to. in any case also post a
/user export
Here you go:
[admin@MikroTik] > /user export
# 2024-08-13 21:55:53 by RouterOS 7.15.3
# software id = AVLF-40P9
#
# model = RBwAPR-2nD
# serial number = HDE0839JBE7
/user group
add comment="for Homepage and HomeAssistant" name=Polling policy=reboot,read,write,policy,test,api,!local,!telnet,!ssh,!ftp,!winbox,!password,!web,!sniff,!sensitive,!romon,!rest-api
/user
add comment="system default user" group=full name=admin
add comment="for Home Assistant and HomePage widget" group=Polling name=polling_user
[admin@MikroTik] >
what should you do with home assistant? do you want to connect to the router with a plugin and access the statistics? in that case you must enter the api in the user permissions as well as in /ip service and specify the correct port
Yes, it’s exactly that, just to display statistics. Isn’t the api included in the permissions (there is no ! in front of api)?
How do I configure /ip service and what port must be used?
enable api permissions for the user and in ip service enable the service. You always see the api port in ip service
Getting closer, I had only api permission added but I’ve just added rest-api permission, too, so at least this works now:
curl -k -u polling_user http://192.168.50.88/rest/ip/address
Enter host password for user 'polling_user':
[{".id":"*4","actual-interface":"ether1","address":"192.168.88.0/24","disabled":"false","dynamic":"false","interface":"ether1","invalid":"false","network":"192.168.88.0"},{".id":"*5","actual-interface":"ether1","address":"192.168.50.88/24","disabled":"false","dynamic":"true","interface":"ether1","invalid":"false","network":"192.168.50.0"}]%
API port seems to be 8728, but adding this or not in the Homepage container config files makes no difference. It still doesn’t work, I’m getting the following error:
API Error: HTTP Error
URL: http://192.168.50.88/rest/system/resource