Community discussions

 
mperdue
Member Candidate
Member Candidate
Topic Author
Posts: 288
Joined: Wed Jun 30, 2004 8:18 pm

powerd & battery backup

Mon Jul 19, 2010 5:42 pm

I have a location on a mountain top that has electricity that gets knocked out every time a thunderstorm passes by. It's a long electrical line up the side of the mountain. There is a cabin at this location which is a summer home of a local person. I would normally just install a full solar system and be done with it, but the land owner does not want the panels in the yard. There are at times very high winds at this location as well so it would take a pretty substantial structure to hold the panels as well.

My idea was to use my normal solar battery and a normal ac charger connected to the battery. I would design it in such a way that the battery would cycle and charge similar to a normal solar system. for example charge to a certain voltage and then turn off, then start charging again once the battery drops. I don't think a continues charge would be good for the battery.

So the the question is, how do I get alerted that there is no electrical power and I am running on battery only?

I have a normal zonet router on the Ethernet side to provide wireless to the property owner when they are staying at there. Knowing this if elctricty is out that router would be off and the Ethernet side of things would show disconnected. So is there a way to monitor port activity? And send an alert if the either is down?

Thanks,
Michael
 
SurferTim
Forum Guru
Forum Guru
Posts: 4637
Joined: Mon Jan 07, 2008 10:31 pm
Location: Miramar Beach, Florida

Re: powerd & battery backup

Mon Jul 19, 2010 5:57 pm

A small 12v battery and a 6 amp marine type (like for a sailboat) charger does it for me. If you select a good charger, it will have multiple stage charging, which is for leaving it connected to the battery. Also normally has a ground isolation circuit. That helps keep the unit from becoming a lightning target.

I use a RB433ah if I need to check input voltage. That is a good indication the charger has failed.
 
mperdue
Member Candidate
Member Candidate
Topic Author
Posts: 288
Joined: Wed Jun 30, 2004 8:18 pm

Re: powerd & battery backup

Mon Jul 19, 2010 6:31 pm

Thank You, the suggested charger seems like a good answer to that issue.

The second question is not to check that the charger/battery has failed but if the power is out. This gives me time to call the power company and inform them that the line is down again and gives them time to restore power without my service being out.

I was wanting to know if there is a way the mikrotik unit can alert me that the ether1 port LINK is down. Because the router in the building would be unpowered.
 
SurferTim
Forum Guru
Forum Guru
Posts: 4637
Joined: Mon Jan 07, 2008 10:31 pm
Location: Miramar Beach, Florida

Re: powerd & battery backup

Mon Jul 19, 2010 6:41 pm

Yes. But this is not my idea. I remember this from another post recently. A hub or switch is connected to the mains power with a wall wart. Connect the hub/switch to one of the ethernet ports. When the power is up, the port will show 'Running'. If the power is out, it will not. Then you can use a scheduled script to notify you by email when it is out.
 
adrianatkins
Long time Member
Long time Member
Posts: 556
Joined: Wed Sep 05, 2007 10:34 am
Location: Spain
Contact:

Re: powerd & battery backup

Mon Jul 19, 2010 11:05 pm

how do I get alerted that there is no electrical power and I am running on battery
Depending on your Routerboard (some do not support voltage reporting), and *if* the power drops a volt or so when it's on backup, you can use this script, run from scheduler every minute or 5. It disables the ftp service so you can see something go orange on Dude.
vthres 138 means 'set the alert threshold to 13.8 volts (as seen by the routerboard) :-

:global vthresh 138
:global voltage [/sys health get voltage]

:global emails 2
:global to "me@myemailaddress.com"
:global server "my.smtp.server.com"
:global goodtext "Power OK"
:global badtext "Power Has Failed"
:global stat
:global ostat
:global cnt

:if ([:typeof $cnt] = "unknown") do={:set cnt 0}

:global goodbody ([/system identity get name]." ".$goodtext)
:global badbody ([/system identity get name]." ".$badtext)

:if ( $voltage >= $vthresh ) do={
:if ( $ostat != $goodtext ) do={:set cnt 0};
:if ( $cnt < $emails ) do={
:set cnt ($cnt + 1);
:set ostat $goodtext;
:log warning ($goodtext);
/tool e-mail send to=$to subject=$goodbody body=$goodbody server=$server
/ip service enable ftp
}
} else={
:if ( $ostat != $badtext ) do={:set cnt 0};
:if ( $cnt < $emails ) do={:set cnt ($cnt + 1);
:log warning ($badtext);
:set ostat $badtext;
/tool e-mail send to=$to subject=$badbody body=$badbody server=$server
/ip service disable ftp
}
}
Don't forget to give me at least a tenner a month, every month
 
adrianatkins
Long time Member
Long time Member
Posts: 556
Joined: Wed Sep 05, 2007 10:34 am
Location: Spain
Contact:

Re: powerd & battery backup

Mon Jul 19, 2010 11:09 pm

For monitoring th Running State of a port, use this script, again from scheduler every once in a while. 'port' is 1=ether1 etc. 'emails' is how many emails you want it to send on a state change :-

:global port 2
:global emails 2
:global to "me@myemailaddress.com"
:global server "my.smtp.server.com"
:global goodtxt "Power OK"
:global badtxt "Power Has Failed"
:global stat
:global ostat
:global cnt

:global goodbody ([/system identity get name]." ".$goodtxt)
:global badbody ([/system identity get name]." ".$badtxt)

:set stat [/interface ethernet find running name="ether".$port]
:set ostat [/interface ethernet get ("ether".$port) comment]
:set cnt [:pick $ostat 0 1]
:set ostat [:pick $ostat 2 100]

:if ( [:typeof $ostat] = "nil" ) do={:set ostat "unknown"}

:if ( $stat = "*".$port ) do={
:if ( $ostat != $goodtxt ) do={ :set cnt 0 };
:if ( $cnt < $emails ) do={
:set cnt ($cnt + 1);
:log warning ($goodtxt);
/interface ethernet set ("ether".$port) comment=($cnt." ".$goodtxt)
/tool e-mail send to=$to subject=$goodbody body=$goodbody server=$server
/sys service enable ftp
}
} else={
:if ( $ostat != $badtxt ) do={ :set cnt 0 };
:if ( $cnt < $emails ) do={
:set cnt ($cnt + 1);
:log warning ($badtxt);
/interface ethernet set ("ether".$port) comment=($cnt." ".$badtxt)
/tool e-mail send to=$to subject=$badbody body=$badbody server=$server
/ip route enable [ find comment=Backup]
/sys service disable ftp
}
}
Don't forget to give me at least a tenner a month, every month
 
adrianatkins
Long time Member
Long time Member
Posts: 556
Joined: Wed Sep 05, 2007 10:34 am
Location: Spain
Contact:

Re: powerd & battery backup

Mon Jul 19, 2010 11:14 pm

Just rembered :
/sys service disable ftp
might be
/ip service disable ftp

Depending on your ROS version.
Try it in a terminal window first, and alter your scripts accordingly, otherwise the script fails.
Don't forget to give me at least a tenner a month, every month
 
n21roadie
Forum Guru
Forum Guru
Posts: 1889
Joined: Fri Aug 07, 2009 10:36 pm
Location: Limerick,Ireland

Re: powerd & battery backup

Sat Nov 12, 2011 7:34 pm

For monitoring th Running State of a port, use this script, again from scheduler every once in a while. 'port' is 1=ether1 etc. 'emails' is how many emails you want it to send on a state change :-

:global port 2
:global emails 2
:global to "me@myemailaddress.com"
:global server "my.smtp.server.com"
:global goodtxt "Power OK"
:global badtxt "Power Has Failed"
:global stat
:global ostat
:global cnt

:global goodbody ([/system identity get name]." ".$goodtxt)
:global badbody ([/system identity get name]." ".$badtxt)

:set stat [/interface ethernet find running name="ether".$port]
:set ostat [/interface ethernet get ("ether".$port) comment]
:set cnt [:pick $ostat 0 1]
:set ostat [:pick $ostat 2 100]

:if ( [:typeof $ostat] = "nil" ) do={:set ostat "unknown"}

:if ( $stat = "*".$port ) do={
:if ( $ostat != $goodtxt ) do={ :set cnt 0 };
:if ( $cnt < $emails ) do={
:set cnt ($cnt + 1);
:log warning ($goodtxt);
/interface ethernet set ("ether".$port) comment=($cnt." ".$goodtxt)
/tool e-mail send to=$to subject=$goodbody body=$goodbody server=$server
/sys service enable ftp
}
} else={
:if ( $ostat != $badtxt ) do={ :set cnt 0 };
:if ( $cnt < $emails ) do={
:set cnt ($cnt + 1);
:log warning ($badtxt);
/interface ethernet set ("ether".$port) comment=($cnt." ".$badtxt)
/tool e-mail send to=$to subject=$badbody body=$badbody server=$server
/ip route enable [ find comment=Backup]
/sys service disable ftp
}
}
Has anyone used this script on OS 5.6?
N21roadie,
Network 100% MT for Now?
 
rodolfo
Long time Member
Long time Member
Posts: 543
Joined: Sat Jul 05, 2008 11:50 am

Re: powerd & battery backup

Sun Nov 13, 2011 8:50 pm

imho is simpler to add an old rb133, powered directly by th ac, added to Dude.
if power fails, rb133 goes down, then you could have any notification you want from dude
rodolfo
IZ0UQV
 
dingsingo
Member Candidate
Member Candidate
Posts: 100
Joined: Sun Jul 24, 2005 9:47 pm
Location: Germany

Re: powerd & battery backup

Sun Nov 13, 2011 9:20 pm

Hi,

look

http://www.meanwelldirect.co.uk/product ... efault.htm


and a RB/433AH, RB/411AH, RB/435G or someting. Then you can make an Dude-Trape to "heath" and the Powerinput on the Routerboard. If the AC input form Meanwell is down, the DC output goes 1,5volt down. The dude can see this and send an mail.

dingsingo
 
n21roadie
Forum Guru
Forum Guru
Posts: 1889
Joined: Fri Aug 07, 2009 10:36 pm
Location: Limerick,Ireland

Re: powerd & battery backup

Sun Nov 13, 2011 10:04 pm

imho is simpler to add an old rb133, powered directly by th ac, added to Dude.
if power fails, rb133 goes down, then you could have any notification you want from dude
I have the dude on site running on a PC into ac mains direct and not on the ups to prolong the battery life when ac power is lost, so my plan is to monitor ether port which is connected to dude and when ac power is lost then use a script like the one listed to send a SMS text like "SiteX on battery power countdown = Xhrs:mins" and follow up sms text "siteX ac power restored" if no follow up text received before "X" time, then i have to travel to that site, i would welcome any advice on this.
N21roadie,
Network 100% MT for Now?
 
popcorrin
Member Candidate
Member Candidate
Posts: 189
Joined: Wed Mar 11, 2009 12:55 am

Re: powerd & battery backup

Tue Nov 15, 2011 2:14 am

Hi,

look

http://www.meanwelldirect.co.uk/product ... efault.htm


and a RB/433AH, RB/411AH, RB/435G or someting. Then you can make an Dude-Trape to "heath" and the Powerinput on the Routerboard. If the AC input form Meanwell is down, the DC output goes 1,5volt down. The dude can see this and send an mail.

dingsingo
I think this one might even work better. It has 2 relays, one for when ac power is out and one for when the battery is low. http://www.meanwell.com/search/psc-100/default.htm

Which brings me to a question. Is there a way to program the serial port on an RB4xx board to recognize the state of a switch, whether it is open or closed?
 
n21roadie
Forum Guru
Forum Guru
Posts: 1889
Joined: Fri Aug 07, 2009 10:36 pm
Location: Limerick,Ireland

Re: powerd & battery backup

Sat Dec 24, 2011 7:21 pm

In my quest to gain some basic knowledge of scripting i tried the "For monitoring th Running State of a port, use this script, again from scheduler every once in a while. 'port' is 1=ether1 etc. 'emails' is how many emails you want it to send on a state change :-"

Changed /sys service enable ftp to /ip service enable ftp which now enables/disables ftp on ROS 5.9 but I cannot figure out the syntax errors for

:set stat [/interface ethernet find running name="ether".$port]
syntax error (line 1 column 59
You do not have the required permissions to view the files attached to this post.
N21roadie,
Network 100% MT for Now?
 
User avatar
m4rk0
Member Candidate
Member Candidate
Posts: 195
Joined: Sat Feb 16, 2008 8:30 pm
Location: BA

Re: powerd & battery backup

Mon Jan 09, 2012 2:31 pm

This is very good solution:
http://gregsowell.com/?p=2093
http://www.mreza-wisp.ba/
Please, give Karma if I fix your problem
Certified MTCNA
 
n21roadie
Forum Guru
Forum Guru
Posts: 1889
Joined: Fri Aug 07, 2009 10:36 pm
Location: Limerick,Ireland

Re: powerd & battery backup

Tue Jan 10, 2012 11:26 am

This is very good solution:
http://gregsowell.com/?p=2093
Thank you
N21roadie,
Network 100% MT for Now?

Who is online

Users browsing this forum: MSN [Bot] and 31 guests