Page 1 of 1

LTE Network mode check

Posted: Thu Jan 30, 2020 1:48 pm
by seanet
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
  }

Re: LTE Network mode check

Posted: Fri Jan 31, 2020 1:15 am
by SiB
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"

Re: LTE Network mode check

Posted: Sat Feb 01, 2020 8:33 am
by seanet
:)
thanks Sir
i will try :D

Re: LTE Network mode check

Posted: Wed Dec 30, 2020 9:15 am
by scarletmichelle
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"
Your music is great, I like it and can I download it ???

Re: LTE Network mode check

Posted: Tue Feb 23, 2021 1:54 am
by SiB
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.

Re: LTE Network mode check

Posted: Tue Feb 23, 2021 11:06 am
by Jotne