A buzzer or beeper is an audio signalling device tipically used for alarms or timers. They need an oscillating circuit to make them work. Fortunatelly there are in the market buzzers with the oscillating circuit already built in. These buzzers with the oscillating circuit included are usually called:
They are commonly made with a piezoelectric buzzer plus the oscillating circuit. They work with a DC power source and the typical current consumption is about 10 mA.
The drawback of these active buzzers is they make beeps with a fixed frequency, about 2.3 kHz.
We can connect the buzzer to a LED GPIO driven on the router. Depending on the type of LED, active low or high, we will use a PNP or NPN transistor to feed the active buzzer. Almost any transistor should work since a buzzer doesn't require much current to work.
Most routers use use active LOW leds connected to GPIOs. Check both pins of the led, if one is connected to Vcc then it's an active low LED, if connected to GND then it's active HIGH.
It could be also possible to connect directly the buzzer in parallel with the led. This can be possible if the buzzer doesn't need more than about 2mA to work.
It's also possible to atach the buzzer directly to the gpio, but the buzzer shouldn't draw more than 4 mA
If you draw more current from the GPIO beyond its capacity, you could damage the SoC.
Since the buzzer is connected to a configurable LED on the router, they will be controlled together. Just configure the LED where the buzzer is soldered via Luci web interface, or use the sys filesystem interface.
echo timer > /sys/class/leds/MYLED/trigger echo oneshot > /sys/class/leds/MYLED/trigger echo 1 > /sys/class/leds/MYLED/shot echo morse > /sys/class/leds/MYLED/trigger echo "SOS" > /sys/class/leds/MYLED/message echo 1 > /sys/class/leds/MYLED/brightness echo 0 > /sys/class/leds/MYLED/brightness