I upgraded one of my AccessPoints to 19.07-rc1. The firmware runs nicely - but one thing changed - which is not so nicely - but I think there is no way back
On 18.06 I could query my connected clients with this simple shell-script I created:
aps="192.168.1.1 192.168.1.2"
for ap in $aps;
do
tmpfile=$(mktemp /tmp/getwifi_clients.sh-cookie-$ap.XXXXXX)
curl -s --cookie-jar $tmpfile -k -d "luci_username=root&luci_password=MYPASS" https://$ap/cgi-bin/luci
curl -s --cookie $tmpfile -k https://$ap/cgi-bin/luci/admin/network/wireless_assoclist | grep -oE '"bssid":"[[:xdigit:]]{2}(:[[:xdigit:]]{2}){5}"' | grep -oE '[[:xdigit:]]{2}(:[[:xdigit:]]{2}){5}'
rm -f $tmpfile
done
But in 19.07 the script /cgi-bin/luci/admin/network/wireless_assoclist is not availible.
I have seen, that now the information is gotten from /cgi-bin/luci/admin/ubus
Can someone help to update my script or point me to some docs. The ubus seams to me more complicated than before.
I use this information's for my smarthome as a presence check.
I think you are using a quite convoluted way to obtain that information... Instead of querying the web app and parsing the output, I would try to call "iw" or "ubus" directly.
I don't like to call it with ssh... web would be really simple to connect remotely.... specially I can transfer the code to a python code, which my smarthome project uses.
but I are really close to a solution with the new interface....
the command to run is a little to complex, to put it in the command field.. so I have to make a script.
as an example:
#!/bin/sh
(
iw dev wlan2g station dump
iw dev wlan5g station dump
) | grep -oE '[[:xdigit:]]{2}(:[[:xdigit:]]{2}){5}'
the generated link is not the same on multiple devices, so I have to drop my loop and call for every ap a single curl command...
no auth is done...? with auth I also need more code on the calling side...
however... at least my version seams also not so bad at all
I think about it, maybe I switch to luci-app-commands - I always have it installed - but I use it to trigger wps-pbc command from webinterface (after login).