We have big problems with murders and violent crimes in South Africa (especially on farms) where another one of our clients have been almost murdered today, just escaping with his life and still in intensive care.
There is a request from our farmer clients that live in rural, sparsely populated areas if there might be a way to link a panic button (or many of them distributed over the house) to our mikrotik units to initiate some kind of panic signal to other farmers.
Once a panic signal is sent, I can write software to accept/detect the signal (on our server) and either dial (via Elastix/Asterisk) a predefined set of numbers with a pre-recorded message to alert farmers in the area to respond, or I can send an SMS to all relevant farmers.
The thing is, how to convert a physical push-to-make switch into a ‘signal’ or packet that can be sent via our Wireless network and how do I detect it at the server side to initiate the dialing/sms?
I suppose connecting something to the serial port on the MT would be possible, or some kind of device connected to the LAN, but I would not know how to design/build such a device, nor which script to write to take it from there. Windows software is no problem for me to write and I can interface to MT and Asterisk via their respective APIs, so that is also not a big problem and certainly possible for me to receive some kind of notification via our WAN and respond to that.
If anyone can give me some advice on an existing device that use either LAN or serial port or where to start to build such a device would be greatly appreciated.
Apologies for posting this here, but since lives are literally at stake, I’m sure you’ll forgive me this one…
What about a simple circuit breaker..
Two devices (a Main RB and a satellite RB [maybe an old obsolete RB or a simple switch])
Configure the Main RB to recognize if the satellite RB goes offline (maybe with an ethernet cable plugged on both) with a script that does whatever you need (an email to your sms gateway?);
make a NC circuit to power on the satellite RB, and when the panic button is pressed, it power off for some secs the satellite RB, enough to make the script run.
This is the easiest implementation i can imagine, you can refine this adding some variables (ping between the RBs instead of just checking the interface state, and if the alarm is already sent within 5 mins, don’t send it again; it might require an higher scripting skill, but everything is doable)
Just my 2 cents.
I have since read a bit more on serial port programming and it seems from my Windows software it will be fairly easy to detect a button pressed (on/off switch). If all else fails, I can wire up the client PC with a small running program to monitor for a switch press on the serial port, which can then do the rest, i.e. automated Asterisk dial, SMS, or even activate an on-screen+audio alarm on neighbouring farmers PCs running the same system or even on different Internet service (off our network 3G, ADSL, satellite Internet, etc.).
In a way, that will be better as even clients with other CPE’s (like ub-you-know-who) can also use the system. I’ll see how this develops and will post here if I find an easy & reliable solution.
However, your post made me think… To have a second RB might be a bit heavy, but I suppose MT script can detect or fire when a port goes down (eg. unplugging LAN port)? If so, then why not just break the LAN port connectivity via a switch? So if user press panic button, it will break the network connection between his MT<->switch or MT<->PC or MT<->VoIP_FXS device or whatever he has. So as long as SOME device is connected to the LAN at all times, it might work. The problem is of course, having false positives when e.g. the maid unplug the ethernet-switch to use the power plug for the vacuum cleaner… (Yes, that happens more often than what I’d like and account for a siginifact number of support calls!!!
Thanks for your response, really clever direction you pointed me into…
I didn’t think about unplugging ethernet cable because a panic button has around less than a second of “unplugging” and it might not be recognized by the script detector..
I supposed the panic button as a simple NC-NO Red button with hazard warnings
But it might be a relay button with timer that keeps unplugged the cable for 10 secs.
how many ethernet ports ports are on the CPE device..
IE a 411 or is it a 433 type device..
if it is a 433 or 532… you could use an un used thernet port…
Wire a relay in a manor that it normaly keeps the ethernet port in a loopback config.
Then a putton is pressed, it breakes power to the relay or sets it, causing the cross over connection to drop.
Detect the change of sate on the port and trigger the notify script..
I think a single chip and a relay would do the trick..
look up monostable multivibrator for the cicruit..
Thanks guys. In the meantime I’m going ahead with a PC based simple serial port switch that will be activated/detected by windows software, maybe someone can then write a script or package for MT in the future. USB sounds nice, but none of our CPE RBs have USB and I’d love a solution that can be just an add-on to possibly hundreds of farmers without having to replace CPEs. Also with serial, you can theoretically go much further than what ethernet or USB allow, e.g. use an unused telephone cable pair to install a switch at a barn or whatever. There are some very cheap RF rx/tx devices (like garage-door openers) that can also easily be adapted to act as a simple switch, so a carry-with you panic button seems quite plausible, albeit with limited range, although I’m sure that a aftermarket (DIY) antenna might extend the range.