Hi. Until today I was using OpenWrt 19.07 or 18.06. It was old, but did everything I wanted. In particular, I was able to get notifications when my phone connected and disconnected from the WiFi, which I used as signals into my home automation to indicate (in part) whether I was home or away. Specifically, I used /usr/sbin/hostapd_cli -iwlan<n> -a"/usr/bin/my_lua_script" & to get a kick whenever a device connected or disconnected.
Today I decided to bite the bullet and upgrade to 24.10, which has gone mostly OK, but I've lost my kick. I discovered that hostapd_cli was not install by default, and installed it, but now I get Failed to connect to hostapd - wpa_ctrl_open: No such file or directory.
Can anyone give me a pointer on how to run my Lua Script when a device connects and disconnects from the WiFi? Perhaps I'm missing something in the installation or configuration for hostapd? Perhaps they are too old and there is a better way? Any pointers would be very welcome.
Thanks. Instead of original command, I can now run hostapd_cli -B -iphy<n>-ap0 -a/usr/bin/monitor4mqtt. It seems to work better, though not perfect yet. I suspect I also need to tweak my lua script (tomorrows job ), but your help has definitely pushed me on a step - Thank you.
For completeness, the last gotcha was that hostapd_cli now calls my script with an extra argument on an AP-STA-CONNECT than it used to. Easy change to my script and everything is working as it used to. Thanks.