USB soundstick - play a song upon clients join to wifi AP

Hi, i would like to hear a warning sound (play an mp3 file) when somebody connects to my wifi. my router tp-link archer c7 v4 has 2 USB connector. it is more or less clear how to install a usb soundstick and components to play a song. what is not clear how to watch for new clients and trigger the songplay on newly connected clients. (kind a doorbell project)

Orthogonal to your actual question this will be less fun than it sounds at first, with power-saving clients that come and go constantly.

may be some filtering option in the watchman part (by mac address/time)?

Does contain anything which might help?

it looks to me something else. (hotplug a device and it will do a script depends of type of device, block-storage / iface up-down, especially the "net" part has no any info provided. smells like windows "autoplay" to me.

Watch the logs with "logread -f" and wait for "hostapd" messages?

1 Like

how about this way: i create a web-server (lighthttpd) on the router. offer an intercom.apk (4.7MB) for download and install. my guest then could ring me up and speak over android phone PTT (unless the guest has no clue to install from different source other than the playstore). next time skip install, just use the intercom. (suppose my phone is hooked on the router all the time i'm expecting guests - iphones not expected)


  • How does this involve OpenWrt?
  • How will you force them to install the app upon connection to the AP (Captive Portal)?

This now sounds like a VoIP app you plan to have available on your advised some Android security features prevent installing form non-Play sources. If the device is being Administratively Controlled, it may not have the ability to enable non-Play-Store installs.

I believe this app could be customized to run a Local Server.

It sounds like you need a VoIP security doorbell or CCTV door control (e.g. Ring).

Just had another idea. It's not exactly what you asked, but it might be a starting point.

dnsmasq has the ability to call a Lua script, triggered by DHCP lease changes - see

You might be able to whip up something which makes a noise when an IP address is issued by dnsmasq...

1 Like

This is probably the most convoluted use-case I have ever seen around here...

1 Like

yap, captive portal + got somewhere how to set MIME type for the apk to trigger android install (understood it will not go if install from different source is disabled).

try to find some use of my router. ok, my high-end smartphone kept only to check the time.

vandalism - if a 100 euro street button to rebuy -, wire to button is out, don't wanna change batteries.
later on i can extend the range anywhere.

one suggestion would be:

Set wifi IP within specific range, create a watchdog to check syslog for new wifi ip range and execute comand to ring the usb sound stick or send you a mail, or execute script to light. (LED on router). opkg install crelay might be of help for various external source. Or even send a mail to you mac sitting somewhere in the house and on the mac enable applescript to ring a bell from reception of the mail, mail server setup locally so will function even without internet

tools here will surely be of help too :
but will need more capable computer than only the router to be on in the house

I've got to agree with @eduperez on this one!

Case 1 -- I don't know you and you want me to install an untrusted Android app on my phone. :face_with_raised_eyebrow: Umm, no. Even if it's trusted, umm, no.

Case 2 -- I do know you and I've got my phone in my hands. Well, I dial your number and...

1 Like

If only someone would invent QR codes or NFC tags to deal with rotating access credentials...

1 Like

To be helpful -- watch the logs for connect and/or probe requests.

Your proposal for what you do with it from there is what most are "amused" about.

@liklev -

What is your ultimate goal here and what is your application space? Is this a home network? A business like a cafe/retail store/hotel? Are you trying to control access to the network or just get notification of a new user? Do you want a notification to be once per new user, but never again for any given user, or are you looking for it to tell you every time any user joins? Are you trying to comply with any local/federal laws/rules about guest internet access, policies on a business level, or just your own network idea?

There are all sorts of ways you can achieve the goals of access control and/or notifications, including things like splash screens, vouchers and the like -- some of them easy on OpenWRT, others maybe not as much (but with options from other software environments).

EDIT: As I look at your original post, it seems like you're trying to setup something of a doorbell. Is that the goal? Still not exactly sure what the purpose of this is (except for the "because I can" mentality)... if you're literally talking about a doorbell, you'd be better off with a commercial smart doorbell product (i.e Nest Hello or Ring) or hacking something together like an Amazon Dash button + RPi or something... anything that does not require guests to do something special/unusual such as installing apps to connect with you.

1 Like

Among scenario I encounter:
12 arpent of ungated/unfenced land with part wifi coverage, relatives and friends usually comes, pir motion sensors on main entrance to inform me when users are coming. If nobody comes through main entrance but a "friend" only parked nearby and access wifi or trying some hacking into my network my pir motion will not ring. which was among my needed solution as suggested above but I opt for mail+applescript which is very easy as apple mac already onsite and powered on most of the time

So what is the primary goal? Protecting your network from hackers (and/or just people leaching off your connection)? Or is there something else?

please elaborate.
apart from the usb sound stick and openwrt what other devices do you have that can help?
Theres surely lot of existing solution around as psherman states. sticking with the actual hardware config stated, mostly the openwrt forum and openwrt wiki will help your find your way to your solution. else in the wild web you will get it.

@ZOzo - Sorry, I saw your response (#17) and I got confused -- I thought it was the OP's response to my question about the goals. My mistake.


@ZOzo -- was this for me or the OP?