Piezo beeper on Mikrotik devices with OpenWrt

Hey everyone,
I'm configuring a Mikrotik RB951Ui-2HnD device with OpenWrt installed and for the past couple of hours I've been trying to access the piezo beeper in the device with no success. I'm using packages version for-15.05 so I can't use the beep package. However I've installed kmod_gpio_beeper and tried to manually access all GPIOs in the range 0-20 but that didn't work either.

Has anyone had any experience with OpenWrt on Mikrotik devices and managed to use the beeper? I honestly have no clue about how to progress with this.

I've got a RB2011 model but it seems that no buzzer is defined in the RB2011 or RB95x models,

even if there are only 20 GPIO on a system doesn't mean that their numbering is 0-19 ( or 1-20 )
for instance, my RB2011 says this for gpio numbers :

cat /sys/kernel/debug/gpio
gpiochip0: GPIOs 0-31, parent: platform/ath79-gpio, ath79-gpio:
 gpio-14  (                    |NAND nCE            ) out hi
 gpio-21  (                    |SFP LOS             ) in  hi

gpiochip1: GPIOs 489-511, ath9k-phy0:
 gpio-490 (                    |ath9k-phy0          ) in  hi

You could try and look at the PCB to see where the buzzer is connected and what kind of buzzer it is ( if it has a part number on it )

Depending on the buzzer that was used on the system it might require PWM and might not make any sounds if just given a Logical high signal

it looks like gpio_beeper simply sets the pin high or low / acts as beeper enable .

There was a recent thread on beepers and, as I recall, the OP had problems finding anything packaged to use the beeper driver. C code may be required if your search doesn’t turn up anything. The beeper kmod is available for current OpenWrt.

Getting off of the unsupported v15 should be a top priority. It’s kernel, wireless protocols, and third-party software have multiple, actively exploited, severe security flaws.

@rzetelskik, welcome to the community!

I know you can control/toggle it in the bootloader on the RB433AH - if this information helps.

I also agree wtih @jeff, you should upgrade.

root@OpenWrt:~# cat /sys/kernel/debug/gpio
gpiochip0: GPIOs 0-31, parent: platform/ath79-gpio, ath79-gpio:
 gpio-4   (                    |rb4xx:yellow:user   ) out hi    
 gpio-5   (                    |NAND RDY            ) in  hi    
 gpio-7   (                    |reset_switch        ) in  hi    

gpiochip1: GPIOs 32-40, parent: spi/spi0.1, spi-rb4xx-cpld, can sleep:
 gpio-32  (                    |rb4xx:green:led1    ) out hi    
 gpio-33  (                    |rb4xx:green:led2    ) out hi    
 gpio-34  (                    |rb4xx:green:led3    ) out hi    
 gpio-35  (                    |rb4xx:green:led4    ) out hi    
 gpio-37  (                    |NAND ALE            ) out lo    
 gpio-38  (                    |NAND CLE            ) out lo    
 gpio-39  (                    |NAND NCE            ) out hi    
 gpio-40  (                    |rb4xx:green:led5    ) out lo

Thank you so much for your replies.

Unfortunately, upgrading is not really an option as the software has to be backward compatible with ~4000 devices and I won't be able to upgrade all of them.
What my device says for gpio numbers:

cat /sys/kernel/debug/gpio
GPIOs 0-22, ath79:
gpio-2 (POE power ) out hi
gpio-3 (rb:green:act ) out lo
gpio-4 (rb:green:port3 ) out lo
gpio-11 (rb:green:wlan ) out lo
gpio-12 (rb:green:port2 ) out lo
gpio-13 (rb:green:port1 ) out hi
gpio-14 (NAND nCE ) out hi
gpio-16 (rb:green:port5 ) out hi
gpio-20 (USB power ) out hi
gpio-21 (rb:green:port4 ) out lo

What I'm meant to do is to run the buzzer after a successful burning of the device, so I' m not sure if the boot loader could be of any help but I'll take a look at this along with the PCB regardless.

Again, I really appreciate your suggestions.

If anything, that you are running a commercial-scale deployment makes the need to upgrade at least the devices you can even more compelling. As Chaos Calmer was from 2015 and has been EOL for years, it has multiple, well-known, actively exploited, severe security vulnerabilities in Linux, wireless protocols, and third-party libraries (including TLS) and applications. So many that it isn't even worth the time to start to list them.

Current OpenWrt is "backward compatible" with Chaos Calmer as far as operation goes. The configuration has improved since then, as well as new protocols and features being added, but it is still interoperable with "ancient" Chaos Calmer devices.

5 Likes

RB2011UiAS makes a clicking sound when GPIO 22 is toggled, Buzzer may be on there but seems to need PWM to make sounds... will know as soon as I figure out how to PWM on these ( no gpio_pwm module anymore )

EDIT : Buzzer on RB2011 devices on GPIO 22
I used bit banged PWM to generate a signal ( via this package ) and it sounds perfect for chiptunes

2 Likes

Hi, Please tell us how you compiled gpio-pwm-ar9331 under AR9344.
Do you have a .ipk file.

Hi @AZAONE , I cloned that Git repo into my "openwrt/package" directory, then selected it in menuconfig and built it like the github page readme explains.

I can't upload the .ipk here - the forum doesn't allow it ( untrustworthy individuals might give you malicious software )

1 Like