Community discussions

MikroTik App
 
seanet
newbie
Topic Author
Posts: 35
Joined: Fri Mar 01, 2013 11:26 pm

LTE Network mode check

Thu Jan 30, 2020 1:48 pm

Hi
i want to create script to do some actions after checking lte interface network mode
For example if "gsm,3g,lte" is checked do /beep

but it does't work correctly.but i don't know why ?
:global a
/interface lte print once do={
  :set a $network-mode
  }
:if ($a = "gsm,3g,lte") do={
  :beep frequency=50 length=2
  }
 
User avatar
SiB
Forum Guru
Forum Guru
Posts: 1888
Joined: Sun Jan 06, 2013 11:19 pm
Location: Poland

Re: LTE Network mode check

Fri Jan 31, 2020 1:15 am

first try your command in CLI, just in terminal to discover that print and once are not existing together. Use TAB key in CLI.
Next with working one command build more complex structure. Use simple commands as possible.

put [interface lte get lte1 network-mode ]
lte
if (1=1) do={put OK} else={put NOK}
OK
if ([interface lte get lte1 network-mode ] = "lte") do={put OK} else={put NOK}
OK
if ([interface lte get lte1 network-mode ] = "lte") do={/system script run music}

And bonus:
Beeps are for play a music "Star Wars -- The Imperial March" or "A_Bit_of_Sounds"
 
seanet
newbie
Topic Author
Posts: 35
Joined: Fri Mar 01, 2013 11:26 pm

Re: LTE Network mode check

Sat Feb 01, 2020 8:33 am

:)
thanks Sir
i will try :D
 
User avatar
SiB
Forum Guru
Forum Guru
Posts: 1888
Joined: Sun Jan 06, 2013 11:19 pm
Location: Poland

Re: LTE Network mode check

Tue Feb 23, 2021 1:54 am

scarletmichelle
Your music is great, I like it and can I download it ???
If your RouterBoard have got a speaker (beep commands play a music) then you go into this commands lines and can use them as Script and play anytime you want.
But you not download them as .mp3 etc.
 
User avatar
Jotne
Forum Guru
Forum Guru
Posts: 3291
Joined: Sat Dec 24, 2016 11:17 am
Location: Magrathean

Re: LTE Network mode check

Tue Feb 23, 2021 11:06 am

Who is online

Users browsing this forum: UkRainUa and 32 guests