It turns out that Mikrotik can be voiced even without a tweeter or just a programmable beeper (which, by the way, the RBM33G does not have).
I used a Chinese clone of the mp3/wav player module Catalex YX5300/YX6300. It can be connected to the serial port of any Mikrotik board.
I used serial1 RBM33G. The module is conveniently located inside the router case. You can connect speakers to its audio output.
On the module’s flash card we record the necessary sounds and voice messages about events on the router (for example, “reboot”, “attempt of unauthorized entry”, “client connection” and any to your taste. Using my function you can voice or music any events on the router, calling a function from your scripts.Please do not criticize the code too much, this is the first trial version and all commands work.
Many thanks and my thanks to Amm0 for the idea and help in using the ppp client to transfer commands and data to the serial port
and big thanks to Chupaka for his string to byte code conversion function fByteToEscapeChar (from his JSON-parser)
Catalex serial MP3/WAV player module https://majicdesigns.github.io/MD_YX5300/index.html
https://arduinoplusplus.wordpress.com ... ex-module/
https://www.youtube.com/watch?v=HSLKefx1VK4
# Examples:
# $SMP play - start play
# $SMP stop
# $SMP volume 20 - set volume 20
# $SMP playfile 01 02 - play file 002XXX.mp3 in folder 01
I used a Chinese clone of the mp3/wav player module Catalex YX5300/YX6300. It can be connected to the serial port of any Mikrotik board.
I used serial1 RBM33G. The module is conveniently located inside the router case. You can connect speakers to its audio output.
On the module’s flash card we record the necessary sounds and voice messages about events on the router (for example, “reboot”, “attempt of unauthorized entry”, “client connection” and any to your taste. Using my function you can voice or music any events on the router, calling a function from your scripts.Please do not criticize the code too much, this is the first trial version and all commands work.
Many thanks and my thanks to Amm0 for the idea and help in using the ppp client to transfer commands and data to the serial port
and big thanks to Chupaka for his string to byte code conversion function fByteToEscapeChar (from his JSON-parser)
Catalex serial MP3/WAV player module https://majicdesigns.github.io/MD_YX5300/index.html
https://arduinoplusplus.wordpress.com ... ex-module/
https://www.youtube.com/watch?v=HSLKefx1VK4
Code:
## serial-MP3-player Catalex YX6300 FUNCTION v 1.0 Sertik 25/12/2023# for ports serial0 or serial1 RBM33G## ! the port must be freed in advance from the console, etc. and configured for an exchange rate of 9600 b/s!# the port is set in global SMPport. If not specified, the serial1 port is set# almost all commands without parameters, except:# playfile [folder number] [file number], for example [$SMP playfile 01 01]# playCycle [file number in folder] - cyclic playback of the file# folderCycle [folder number] - cyclic playback of a folder:global SMP do={# check/set port:global SMPport; :if ([:len $SMPport]=0) do={:set SMPport "serial1"}:if (($SMPport="serial0") or ($SMPport="serial1")) do={# convert number to code:local fBy do={:set $1 [:tonum $1] :return [[:parse "(\"\\$[:pick "0123456789ABCDEF" (($1 >> 4) & 0xF)]$[:pick "0123456789ABCDEF" ($1 & 0xF)]\")"]]}# some commands Catalex YX6300:global ArrayComSMP { "play"="\0D" "pause"="\0E" "stop"="\16" "next"="\01" "previous"="\02" "volumeUP"="\04" "volumeDW"="\05" "sleep"="\0A" "wakeup"="\0B" "reset"="\0C" "shuffle"="\18" "playfile"="\0F\11" "volume"="\06\11" "playCycle"="\08\11" "folderCycle"="\17\11" "TF"="09\11"}:local param "\11\11\11\EF":if ([:len $1]=0) do={:return "no set name command"}:local cmd ($ArrayComSMP->$1):if ([:len $cmd]=0) do={:return "bad command"}# command for selecting the playback source (optional):if ($cmd="TF") do={:set $2 02}:put "Execute command Serial MP3 Player: $1"# flipping parameter $2 - > $3 for commands with one parameter and calculating \byte by parameters:local a1 $2:local b1 $3:if ([:len $3]=0) do={:set b1 $2; :set a1 "\11"}:if ($a1="\11") do={} else={:set a1 [$fBy $a1]}:set b1 [$fBy $b1]# if the command is longer than one byte, then it needs parameters:if ([:len $cmd]>1) do={:set param ("$a1"."$b1"."\EF")}# remove the ppp client interface just in case it was left:if ([/interface ppp-client find name="scripttemp"]) do={/interface ppp-client remove [/interface ppp-client find name="scripttemp"]}# sending a command to the serial-MP3-player device via ppp-client/interface ppp-client add name="scripttemp" dial-on-demand=no port=$SMPport modem-init=("\7E\FF\06"."$cmd"."$param") null-modem=yes disabled=no:delay 1s/interface ppp-client remove [/interface ppp-client find name="scripttemp"]:return []} else={:return "bad port in global variable SMPport: $SMPport"}}
# Examples:
# $SMP play - start play
# $SMP stop
# $SMP volume 20 - set volume 20
# $SMP playfile 01 02 - play file 002XXX.mp3 in folder 01
Statistics: Posted by Sertik — Mon Dec 25, 2023 11:59 am