Facebook  -  Twitter      

Questo forum fa uso dei cookie
Questo forum utilizza i cookie per memorizzare i dettagli del tuo login o della tua ultima visita. I cookie sono piccoli files di testo salvati nel computer; i cookie da noi utilizzati sono relativi unicamente ai servizi da noi forniti direttamente o dai banner pubblicitari. I cookie su questo forum salvano inoltre i dettagli relativi alle discussioni lette e alle tue preferenze personali. Sei pregato di selezionare il tasto OKAY se sei consapevole della presenza di questi files e ci autorizzi ad utilizarli per le informazioni specificate.

Indipendentemente dalla tua scelta un cookie verrà salvato per memorizzare nel tuo pc la risposta a questo form. Puoi modificare le impostazioni relative ai cookie nelle preferenze del tuo browser.

  • 0 voto(i) - 0 media
  • 1
  • 2
  • 3
  • 4
  • 5
[Mikrotik] SXT 5HnD Alignment Script

#1
Information 
Codice:
# Mikrotik RB411/433 "Lights and Sound" alignment script

Codice:
# written by Mark Shumate Feb 2009

Codice:
# Edited by enuro12 Mar 2011

Codice:
#

Codice:
# NOTE: I have replaced user-led with led5. That is the

Codice:
# only modification over the original script. I've tested

Codice:
# this on v5.2 of RouterOS on my SXT 5HnD.

Codice:
#

Codice:
# This script recognizes 9 different "signal levels"

Codice:
# and 3 assoc. statuses (connected, searching, other)

Codice:
# Currently, "signal levels" indicate the SNR/margin

Codice:
# measurement. Higher signal-to-noise measurements

Codice:
# correspond to higher levels. So level 8 would be

Codice:
# the best, below 1 would be the worst. The better

Codice:
# the signal-to-noise, the more LEDs you get, and

Codice:
# the faster the beeps get. Only 4 LEDs are used,

Codice:
# (the 5th being left alone, for NAND access ind.)

Codice:
# with intermediate signal levels resulting in a

Codice:
# combination of solid and flashing LEDs, shown

Codice:
# here:

Codice:
#

Codice:
# >= Level 8 : 4 solid (100ms beeps)

Codice:
# >= Level 7 : 3 solid, 4th flashing (300ms beeps)

Codice:
# >= Level 6 : 3 solid (500ms beep cycle)

Codice:
# >= Level 5 : 2 solid, 3rd flashing (700ms beeps)

Codice:
# >= Level 4 : 2 solid (900ms beeps)

Codice:
# >= Level 3 : 1 solid, 2nd flashing (1100ms beeps)# >= Level 2 : 1 solid (1300ms beeps)

Codice:
# >= Level 1 : 1 flashing (1500ms beeps)

Codice:
# <  Level 1 : no LEDs, beeps only (1700ms beeps)

Codice:
#

Codice:
# The led5 (green LED above the blue power LED)

Codice:
# is used to display the association status. If the

Codice:
# wireless interface is associated, the led5 is

Codice:
# solid. If the wireless interface is actively

Codice:
# searching, but not yet associated, the led5 is

Codice:
# blinking twice a second, with a pause while a

Codice:
# rising trill of 3 beeps is played. If the wireless

Codice:
# interface is neither associated, nor searching

Codice:
# (like disabled, or something weird) then the light

Codice:
# will flicker rapidly every 2 seconds, and a

Codice:
# falling trill of 2 beeps is played.


Codice:
# Finally, the script plays startup (rising) and

Codice:
# shutdown (falling) tones.


Codice:
# For reference, the delay times associated with the

Codice:
# different signal levels are shown here:

Codice:
#:local lnsdelaytime 100ms;  <---signals at/above lvl 8

Codice:
#:local lnsdelaytime 300ms;  <---signals between 7 and 8

Codice:
#:local lnsdelaytime 500ms;  <---signals between 6 and 7

Codice:
#:local lnsdelaytime 700ms;  <---signals between 5 and 6#:local lnsdelaytime 900ms:  <---signals between 4 and 5

Codice:
#:local lnsdelaytime 1100ms; <---signals between 3 and 4

Codice:
#:local lnsdelaytime 1300ms; <---signals between 2 and 3

Codice:
#:local lnsdelaytime 1500ms; <---signals between 1 and 2

Codice:
#:local lnsdelaytime 1750ms; <---signals below lvl 1

Codice:
#:local lnsdelaytime 2000ms; <---signal not available


Codice:
# default delaytime

Codice:
:local lnsdelaytime "2000ms";


Codice:
# name of wireless interface to monitor (default wlan1)

Codice:
:local lnsintname "wlan1";


Codice:
# frequency (as in pitch) of beep (recommend 700 - 1000)

Codice:
:local lnsbeepfreq 800;


Codice:
# Here, the different signal levels are assigned to

Codice:
# signal-to-noise measurements. I haven't really tweaked

Codice:
# these yet to be in line with field testing, so they

Codice:
# may need quite a bit of adjusting.

Codice:
:local lnslevel8 70;

Codice:
:local lnslevel7 65;:local lnslevel6 60;

Codice:
:local lnslevel5 55;

Codice:
:local lnslevel4 50;

Codice:
:local lnslevel3 45;

Codice:
:local lnslevel2 40;

Codice:
:local lnslevel1 35;


Codice:
# The (veery approximate, heh) running time of the script

Codice:
# is set here. I am too lazy right now to do this a

Codice:
# better way...besides, who cares if the thing beeps or

Codice:
# flashes a couple extra minutes right?!? :)

Codice:
:local lnsrunningtime 60m;


Codice:
# Here, we set how long the script will beep. NOTE that

Codice:
# startup/shutdown tones will still be played.

Codice:
# I like this feature when using an access point where

Codice:
# the LEDs are clearly visible. If you don't want this

Codice:
# feature, set it to the same as $lnsrunningtime

Codice:
# (above).

Codice:
:local lnsbeeptime 10m;


Codice:
# figure out beep cutoff time :local lnsrunbeepdiff;

Codice:
:set lnsrunbeepdiff ($lnsrunningtime - $lnsbeeptime);



Codice:
# initialize LEDs, play starting tones

Codice:
:delay 50ms;

Codice:
:led led5=no led4=no led3=no led2=no led1=no;

Codice:
:delay 50ms;

Codice:
:beep frequency=($lnsbeepfreq - 300) length=50ms;

Codice:
:delay 50ms;

Codice:
:beep frequency=($lnsbeepfreq - 200) length=50ms;

Codice:
:delay 50ms;


Codice:
# main monitoring cycle

Codice:
:while ($lnsrunningtime > 0s) do={

Codice:
 /interface wireless monitor "$lnsintname" once do={

Codice:
   :if ($"status" = "connected-to-ess") do={

Codice:
     :if ($"signal-to-noise" >= $lnslevel8) do={

Codice:
       :set lnsdelaytime 100ms;

Codice:
       :if ($lnsrunningtime > $lnsrunbeepdiff) do={

Codice:
         :beep frequency=$lnsbeepfreq length=($lnsdelaytime / 2);

Codice:
       }

Codice:
       :led led5=yes led4=yes led3=yes led2=yes led1=yes;

Codice:
       :delay $lnsdelaytime;

Codice:
     }

Codice:
     :if ($"signal-to-noise" >= $lnslevel7 && $"signal-to-noise" < $lnslevel8) do={

Codice:
       :set lnsdelaytime 300ms;

Codice:
       :if ($lnsrunningtime > $lnsrunbeepdiff) do={:beep frequency=$lnsbeepfreq length=($lnsdelaytime / 2);

Codice:
       }

Codice:
       :for i from=1 to=3 do={

Codice:
         :led led5=yes led4=no led3=yes led2=yes led1=yes;

Codice:
         :delay ($lnsdelaytime / 6);

Codice:
         :led led5=yes led4=yes led3=yes led2=yes led1=yes;

Codice:
         :delay ($lnsdelaytime / 6);

Codice:
       }

Codice:
     }

Codice:
     :if ($"signal-to-noise" >= $lnslevel6 && $"signal-to-noise" < $lnslevel7) do={

Codice:
       :set lnsdelaytime 500ms;

Codice:
       :led led5=yes led4=no led3=yes led2=yes led1=yes;

Codice:
       :if ($lnsrunningtime > $lnsrunbeepdiff) do={

Codice:
         :beep frequency=$lnsbeepfreq length=($lnsdelaytime / 2);

Codice:
       }

Codice:
       :delay $lnsdelaytime;

Codice:
     }

Codice:
     :if ($"signal-to-noise" >= $lnslevel5 && $"signal-to-noise" < $lnslevel6) do={

Codice:
       :set lnsdelaytime 700ms;

Codice:
       :if ($lnsrunningtime > $lnsrunbeepdiff) do={

Codice:
         :beep frequency=$lnsbeepfreq length=($lnsdelaytime / 2);

Codice:
       }

Codice:
       :for i from=1 to=3 do={

Codice:
         :led led5=yes led4=no led3=no led2=yes led1=yes;

Codice:
         :delay ($lnsdelaytime / 6);:led led5=yes led4=no led3=yes led2=yes led1=yes;

Codice:
         :delay ($lnsdelaytime / 6);

Codice:
       }

Codice:
     }

Codice:
     :if ($"signal-to-noise" >= $lnslevel4 && $"signal-to-noise" < $lnslevel5) do={

Codice:
       :set lnsdelaytime 900ms;

Codice:
       :led led5=yes led4=no led3=no led2=yes led1=yes;

Codice:
       :if ($lnsrunningtime > $lnsrunbeepdiff) do={

Codice:
         :beep frequency=$lnsbeepfreq length=($lnsdelaytime / 2);

Codice:
       }

Codice:
       :delay $lnsdelaytime;

Codice:
     }

Codice:
     :if ($"signal-to-noise" >= $lnslevel3 && $"signal-to-noise" < $lnslevel4) do={

Codice:
       :set lnsdelaytime 1100ms;

Codice:
       :if ($lnsrunningtime > $lnsrunbeepdiff) do={

Codice:
         :beep frequency=$lnsbeepfreq length=($lnsdelaytime / 2);

Codice:
       }

Codice:
       :for i from=1 to=3 do={

Codice:
         :led led5=yes led4=no led3=no led2=no led1=yes;

Codice:
         :delay ($lnsdelaytime / 6);

Codice:
         :led led5=yes led4=no led3=no led2=yes led1=yes;

Codice:
         :delay ($lnsdelaytime / 6);

Codice:
       }

Codice:
     }

Codice:
     :if ($"signal-to-noise" >= $lnslevel2 && $"signal-to-noise" < $lnslevel3) do={:set lnsdelaytime 1300ms;

Codice:
       :led led5=yes led4=no led3=no led2=no led1=yes;

Codice:
       :if ($lnsrunningtime > $lnsrunbeepdiff) do={

Codice:
         :beep frequency=$lnsbeepfreq length=($lnsdelaytime / 2);

Codice:
       }

Codice:
       :delay $lnsdelaytime;

Codice:
     }

Codice:
     :if ($"signal-to-noise" >= $lnslevel1 && $"signal-to-noise" < $lnslevel2) do={

Codice:
       :set lnsdelaytime 1500ms;

Codice:
       :if ($lnsrunningtime > $lnsrunbeepdiff) do={

Codice:
         :beep frequency=$lnsbeepfreq length=($lnsdelaytime / 2);

Codice:
       }

Codice:
       :for i from=1 to=3 do={

Codice:
         :led led5=yes led4=no led3=no led2=no led1=no;

Codice:
         :delay ($lnsdelaytime / 6);

Codice:
         :led led5=yes led4=no led3=no led2=no led1=yes;

Codice:
         :delay ($lnsdelaytime / 6);

Codice:
       }

Codice:
     }

Codice:
     :if ($"signal-to-noise" < $lnslevel1) do={

Codice:
       :set lnsdelaytime 1700ms;

Codice:
       :if ($lnsrunningtime > $lnsrunbeepdiff) do={

Codice:
         :beep frequency=$lnsbeepfreq length=($lnsdelaytime / 2);

Codice:
       }

Codice:
       :led led5=yes led4=no led3=no led2=no led1=no;:delay $lnsdelaytime;

Codice:
     }

Codice:
   } else={

Codice:
     :if ($"status" = "searching-for-network") do={

Codice:
       :set lnsdelaytime 2000ms;

Codice:
       :led led5=no led4=no led3=no led2=no led1=no;

Codice:
       :if ($lnsrunningtime > $lnsrunbeepdiff) do={

Codice:
         :beep frequency=$lnsbeepfreq length=100ms;

Codice:
       }

Codice:
       :delay 100ms;

Codice:
       :if ($lnsrunningtime > $lnsrunbeepdiff) do={

Codice:
         :beep frequency=($lnsbeepfreq + 100) length=75ms;

Codice:
       }

Codice:
       :delay 75ms;

Codice:
       :if ($lnsrunningtime > $lnsrunbeepdiff) do={

Codice:
         :beep frequency=($lnsbeepfreq + 200) length=50ms;

Codice:
       }

Codice:
       :delay 50ms;

Codice:
       :for i from=1 to=4 do={

Codice:
         :led led5=no;

Codice:
         :delay ($lnsdelaytime / 8)

Codice:
         :led led5=yes;

Codice:
         :delay ($lnsdelaytime / 8)

Codice:
       }

Codice:
       :set lnsdelaytime ($lnsdelaytime + (50ms + 75ms + 100ms));

Codice:
     } else={:set lnsdelaytime 2000ms;

Codice:
       :led led5=no led4=no led3=no led2=no led1=no;

Codice:
       :if ($lnsrunningtime > $lnsrunbeepdiff) do={

Codice:
         :beep frequency=($lnsbeepfreq - 150) length=150ms;

Codice:
       }

Codice:
       :delay 150ms;

Codice:
       :if ($lnsrunningtime > $lnsrunbeepdiff) do={

Codice:
         :beep frequency=($lnsbeepfreq - 350) length=100ms;

Codice:
       }

Codice:
       :delay 100ms;

Codice:
       :for i from=1 to=4 do={

Codice:
         :led led5=yes;

Codice:
         :delay 50ms;

Codice:
         :led led5=no;

Codice:
         :delay 50ms;

Codice:
       }

Codice:
       :delay 1550ms;:set lnsrunningtime ("$lnsrunningtime" - "$lnsdelaytime");

Codice:
}


Codice:
# shut off LEDs, play shutdown tones

Codice:
:delay 50ms;

Codice:
:led led5=no led4=no led3=no led2=no led1=no;

Codice:
:delay 50ms;

Codice:
:beep frequency=($lnsbeepfreq - 200) length=50ms;

Codice:
:delay 50ms;

Codice:
:beep frequency=($lnsbeepfreq - 300) length=50ms;

Codice:
:delay 50ms;

Cita messaggio


[-]
Condividi/Segnala (Mostra tutti)
Facebook Linkedin Twitter

Discussioni simili
Discussione Autore Risposte Letto Ultimo messaggio
Exclamation Script: Notifica sovraccarico CPU hamtarociaoo 1 903 10-09-2016, 01:18
Ultimo messaggio: hunte88
Information [Mikrotik] Semi-Automating CPE ROS/Firmware/script updates and setting changes berryberry 0 712 17-06-2015, 11:54
Ultimo messaggio: berryberry
Information [Mikrotik] Yet Another Alignment Script With LEDs And Sound berryberry 0 982 17-06-2015, 11:07
Ultimo messaggio: berryberry
  [Mikrotik] Improved auto upgrade script v3.X berryberry 0 590 17-06-2015, 10:53
Ultimo messaggio: berryberry
Information [Mikrotik] Automated Upgrade/Downgrade script V3.9+ berryberry 0 569 17-06-2015, 10:51
Ultimo messaggio: berryberry
Information [Mikrotik] Auto upgrade script V3.x berryberry 0 367 17-06-2015, 10:34
Ultimo messaggio: berryberry
Information [Mikrotik] LED Antenna Alignment berryberry 0 401 16-06-2015, 12:01
Ultimo messaggio: berryberry
Information [Mikrotik] Monitor logs, send email alert / run script berryberry 0 715 16-06-2015, 10:55
Ultimo messaggio: berryberry
Information [Mikrotik] Resilience /Monitoring -ECMP Failover Script berryberry 0 529 16-06-2015, 09:45
Ultimo messaggio: berryberry
Information [Mikrotik] Resilience/Monitoring- Monitoring Script berryberry 0 415 16-06-2015, 08:56
Ultimo messaggio: berryberry

Digg   Delicious   Reddit   Facebook   Twitter   StumbleUpon  


Utenti che stanno guardando questa discussione:
1 Ospite(i)


Powered by MyBB, © 2002-2017 MyBB Group.