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] Yet Another Alignment Script With LEDs And Sound

#1
Information 
Codice:
# Mikrotik RB411/433 "Lights and Sound" alignment script
# written by Mark Shumate Feb 2009
#
# NOTE: This script may work on other platforms, I
# don't have anything but RB411/433 here in front of
# me. The beeps will probably work on practically any
# wireless AP type Routerboard, but maybe the script
# would have to be edited? Dunno if it complains when
# you reference LEDs that don't exist...
#
# This script recognizes 9 different "signal levels"
# and 3 assoc. statuses (connected, searching, other)
# Currently, "signal levels" indicate the SNR/margin
# measurement. Higher signal-to-noise measurements
# correspond to higher levels. So level 8 would be
# the best, below 1 would be the worst. The better
# the signal-to-noise, the more LEDs you get, and
# the faster the beeps get. Only 4 LEDs are used,
# (the 5th being left alone, for NAND access ind.)
# with intermediate signal levels resulting in a
# combination of solid and flashing LEDs, shown
# here:
#
# >= Level 8 : 4 solid (100ms beeps)# >= Level 7 : 3 solid, 4th flashing (300ms beeps)
# >= Level 6 : 3 solid (500ms beep cycle)
# >= Level 5 : 2 solid, 3rd flashing (700ms beeps)
# >= Level 4 : 2 solid (900ms beeps)
# >= Level 3 : 1 solid, 2nd flashing (1100ms beeps)
# >= Level 2 : 1 solid (1300ms beeps)
# >= Level 1 : 1 flashing (1500ms beeps)
# <  Level 1 : no LEDs, beeps only (1700ms beeps)
#
# The user-LED (green LED above the blue power LED)
# is used to display the association status. If the
# wireless interface is associated, the user-LED is
# solid. If the wireless interface is actively
# searching, but not yet associated, the user-LED is
# blinking twice a second, with a pause while a
# rising trill of 3 beeps is played. If the wireless
# interface is neither associated, nor searching
# (like disabled, or something weird) then the light
# will flicker rapidly every 2 seconds, and a
# falling trill of 2 beeps is played.

# Finally, the script plays startup (rising) and
# shutdown (falling) tones.

# For reference, the delay times associated with the
# different signal levels are shown here:
#:local lnsdelaytime 100ms;  <---signals at/above lvl 8
# default delaytime
:local lnsdelaytime "2000ms";

# name of wireless interface to monitor (default wlan1)
:local lnsintname "wlan1";

# frequency (as in pitch) of beep (recommend 700 - 1000)
:local lnsbeepfreq 800;

# Here, the different signal levels are assigned to
# signal-to-noise measurements. I haven't really tweaked
# these yet to be in line with field testing, so they
# may need quite a bit of adjusting.
:local lnslevel8 70;
:local lnslevel7 65;
:local lnslevel6 60;
:local lnslevel5 55;
:local lnslevel4 50;
:local lnslevel3 45;
:local lnslevel2 40;
:local lnslevel1 35;

# The (veery approximate, heh) running time of the script
# is set here. I am too lazy right now to do this a # better way...besides, who cares if the thing beeps or
# flashes a couple extra minutes right?!? :)
:local lnsrunningtime 60m;

# Here, we set how long the script will beep. NOTE that
# startup/shutdown tones will still be played.
# I like this feature when using an access point where
# the LEDs are clearly visible. If you don't want this
# feature, set it to the same as $lnsrunningtime
# (above).
:local lnsbeeptime 10m;

# figure out beep cutoff time
:local lnsrunbeepdiff;
:set lnsrunbeepdiff ($lnsrunningtime - $lnsbeeptime);


# initialize LEDs, play starting tones
:delay 50ms;
:led user-led=no led4=no led3=no led2=no led1=no;
:delay 50ms;
:beep frequency=($lnsbeepfreq - 300) length=50ms;:delay 50ms;
:beep frequency=($lnsbeepfreq - 200) length=50ms;
:delay 50ms;

# main monitoring cycle
:while ($lnsrunningtime > 0s) do={
 /interface wireless monitor "$lnsintname" once do={
   :if ($"status" = "connected-to-ess") do={
     :if ($"signal-to-noise" >= $lnslevel8) do={
       :set lnsdelaytime 100ms;
       :if ($lnsrunningtime > $lnsrunbeepdiff) do={
         :beep frequency=$lnsbeepfreq length=($lnsdelaytime / 2);
       }
       :led user-led=yes led4=yes led3=yes led2=yes led1=yes;
       :delay $lnsdelaytime;
     }
     :if ($"signal-to-noise" >= $lnslevel7 && $"signal-to-noise" < $lnslevel8) do={
       :set lnsdelaytime 300ms;
       :if ($lnsrunningtime > $lnsrunbeepdiff) do={
         :beep frequency=$lnsbeepfreq length=($lnsdelaytime / 2);
       }
       :for i from=1 to=3 do={
         :led user-led=yes led4=no led3=yes led2=yes led1=yes;
         :delay ($lnsdelaytime / 6);
         :led user-led=yes led4=yes led3=yes led2=yes led1=yes;:delay ($lnsdelaytime / 6);
       }
     }
     :if ($"signal-to-noise" >= $lnslevel6 && $"signal-to-noise" < $lnslevel7) do={
       :set lnsdelaytime 500ms;
       :led user-led=yes led4=no led3=yes led2=yes led1=yes;
       :if ($lnsrunningtime > $lnsrunbeepdiff) do={
         :beep frequency=$lnsbeepfreq length=($lnsdelaytime / 2);
       }
       :delay $lnsdelaytime;
     }
     :if ($"signal-to-noise" >= $lnslevel5 && $"signal-to-noise" < $lnslevel6) do={
       :set lnsdelaytime 700ms;
       :if ($lnsrunningtime > $lnsrunbeepdiff) do={
         :beep frequency=$lnsbeepfreq length=($lnsdelaytime / 2);
       }
       :for i from=1 to=3 do={
         :led user-led=yes led4=no led3=no led2=yes led1=yes;
         :delay ($lnsdelaytime / 6);
         :led user-led=yes led4=no led3=yes led2=yes led1=yes;
         :delay ($lnsdelaytime / 6);
       }
     }
     :if ($"signal-to-noise" >= $lnslevel4 && $"signal-to-noise" < $lnslevel5) do={
       :set lnsdelaytime 900ms;:led user-led=yes led4=no led3=no led2=yes led1=yes;
       :if ($lnsrunningtime > $lnsrunbeepdiff) do={
         :beep frequency=$lnsbeepfreq length=($lnsdelaytime / 2);
       }
       :delay $lnsdelaytime;
     }
     :if ($"signal-to-noise" >= $lnslevel3 && $"signal-to-noise" < $lnslevel4) do={
       :set lnsdelaytime 1100ms;
       :if ($lnsrunningtime > $lnsrunbeepdiff) do={
         :beep frequency=$lnsbeepfreq length=($lnsdelaytime / 2);
       }
       :for i from=1 to=3 do={
         :led user-led=yes led4=no led3=no led2=no led1=yes;
         :delay ($lnsdelaytime / 6);
         :led user-led=yes led4=no led3=no led2=yes led1=yes;
         :delay ($lnsdelaytime / 6);
       }
     }
     :if ($"signal-to-noise" >= $lnslevel2 && $"signal-to-noise" < $lnslevel3) do={
       :set lnsdelaytime 1300ms;
       :led user-led=yes led4=no led3=no led2=no led1=yes;
       :if ($lnsrunningtime > $lnsrunbeepdiff) do={
         :beep frequency=$lnsbeepfreq length=($lnsdelaytime / 2);
       }
       :delay $lnsdelaytime;:if ($"signal-to-noise" >= $lnslevel1 && $"signal-to-noise" < $lnslevel2) do={
       :set lnsdelaytime 1500ms;
       :if ($lnsrunningtime > $lnsrunbeepdiff) do={
         :beep frequency=$lnsbeepfreq length=($lnsdelaytime / 2);
       }
       :for i from=1 to=3 do={
         :led user-led=yes led4=no led3=no led2=no led1=no;
         :delay ($lnsdelaytime / 6);
         :led user-led=yes led4=no led3=no led2=no led1=yes;
         :delay ($lnsdelaytime / 6);
       }
     }
     :if ($"signal-to-noise" < $lnslevel1) do={
       :set lnsdelaytime 1700ms;
       :if ($lnsrunningtime > $lnsrunbeepdiff) do={
         :beep frequency=$lnsbeepfreq length=($lnsdelaytime / 2);
       }
       :led user-led=yes led4=no led3=no led2=no led1=no;
       :delay $lnsdelaytime;
     }
   } else={
     :if ($"status" = "searching-for-network") do={
       :set lnsdelaytime 2000ms;
       :led user-led=no led4=no led3=no led2=no led1=no;:if ($lnsrunningtime > $lnsrunbeepdiff) do={
         :beep frequency=$lnsbeepfreq length=100ms;
       }
       :delay 100ms;
       :if ($lnsrunningtime > $lnsrunbeepdiff) do={
         :beep frequency=($lnsbeepfreq + 100) length=75ms;
       }
       :delay 75ms;
       :if ($lnsrunningtime > $lnsrunbeepdiff) do={
         :beep frequency=($lnsbeepfreq + 200) length=50ms;
       }
       :delay 50ms;
       :for i from=1 to=4 do={
         :led user-led=no;
         :delay ($lnsdelaytime / 8)
         :led user-led=yes;
         :delay ($lnsdelaytime / 8)
       }
       :set lnsdelaytime ($lnsdelaytime + (50ms + 75ms + 100ms));
     } else={
       :set lnsdelaytime 2000ms;
       :led user-led=no led4=no led3=no led2=no led1=no;
       :if ($lnsrunningtime > $lnsrunbeepdiff) do={
         :beep frequency=($lnsbeepfreq - 150) length=150ms;
       }:delay 150ms;
       :if ($lnsrunningtime > $lnsrunbeepdiff) do={
         :beep frequency=($lnsbeepfreq - 350) length=100ms;
       }
       :delay 100ms;
       :for i from=1 to=4 do={
         :led user-led=yes;
         :delay 50ms;
         :led user-led=no;
         :delay 50ms;
       }
       :delay 1550ms;
     }
   }
 }
:set lnsrunningtime ("$lnsrunningtime" - "$lnsdelaytime");
}

# shut off LEDs, play shutdown tones
:delay 50ms;
:led user-led=no led4=no led3=no led2=no led1=no;
:delay 50ms;
:beep frequency=($lnsbeepfreq - 200) length=50ms;
:delay 50ms;
:beep frequency=($lnsbeepfreq - 300) length=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] SXT 5HnD Alignment Script berryberry 0 941 17-06-2015, 11:47
Ultimo messaggio: berryberry
  [Mikrotik] Improved auto upgrade script v3.X berryberry 0 591 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.