socialwifi / RouterOS-api

Python API to RouterBoard devices produced by MikroTik.
MIT License
251 stars 100 forks source link

Use RouterOS-api to get RSSI #75

Closed Brasswyrm closed 2 years ago

Brasswyrm commented 2 years ago

I am trying to use this API to write a Python script that can monitor the RSSI value of a wireless wire link. On the routerOS terminal, this command works to return the RSSI to the terminal:

put ([/interface w60g once as-value]->"rssi")

Is there a way to do a similar command in the API and output the result to a Python variable?

doghousedean commented 2 years ago

I've spent a while trying to figure this out but managed it eventually

I have a LHGLTE6 and this works for me

>>> stats = api.get_resource("/interface/lte").call("info", {"number": '0', "once":'', ".proplist": 'rssi'})
>>> stats
[{'rssi': '-63'}]