Detect new WiFi connection event

Is it possible to detect when new WiFi client connects to Mikrotik AP ?

I want to have some event happening, when my phone comes close enough to Mikrotik AP. I would like Mikrotik to send a TCP or UDP message, or URL GET/POST request.

Thank you

Before anything else, keep in mind that “coming close” and “connecting” are two different events.

I don’t think there’s a way to detect if a device is within range (but not connected).

As for detecting whether a device has connected, the only way you can do that is via the API protocol, which in turn means having a separate device connect to your router (or have a VM at the router, which would consume tons of memory our of it…).

With your API client, you’d call what in CLI would’ve been

/interface wireless registration-table print follow

and keep the program turned on to monitor the results.

As new devices connect, new items are added at the registration table, and are thus presented to the API client. Once the item is received, you can do whatever you want based on it, be it an HTTP request, a DB connection, or whatever else you may imagine.

you could do something like a scheduled check of ( [ /interface wireless registration-table find where mac-address=$“mac_alert” ] ) and /tool fetch $“url_alert”

Hotspot also has an on login/on logout script function in the user profile

For Wireless event you can use Logging action to Remote host. But you must implement your own UDP listener.