It seems the easy part of this is the actual opening of the gate. A simple bash or python script can run the appropriate commands to send a signal to open a relay/GPIO pin.
The hard part seems to be the connection between phone (as you want to be mobile!) and the onion.
A couple of ways I can think of:
1: Use Telegram - It is a messaging app but you can use it to send commands to a device. The device polls Telegram through an API and if a specific command is sent then you can tell it to do something. ie, run a script that opens a gate!
2: Use IFTTT maker channel - Its a simple cloud based automation tool. So you can either have an IF This Then That, so if your phone gets to this GPS co-ord then open the gate. Or better would be the DO function of IFTTT which you launch the app and it has specific buttons which you can set, ie button to open gate, button to close. In the background, again the device will need a webhook to poll the API of IFTTT looking for the DO button presses.
Each method relies on polling the API of the service, IFTTT DO function would work better as the command structure of Telegram would mean you'd have to a send a command (ie /opengate) whereas the DO presents a nice button on an app you press.
As each method relies on polling an API and you'd want it to be fast I reckon you'd want something like poll every second. I dont know if this is possible because I've not used it before!
Hi @Stephen-Moraco, unfortunately we are still stumbling when it comes to getting newer versions of node to compile. We have searched for ways that the Arduino Yun has compiled it, but it seems that they did not open source the patch/makefile for their pre-built version. If you can extract the files from your device that would be great. We can try to repackage it as an ipk and release that.
Hi @Jardel-Inacio-Moreira-Vieira, unfortunately I don't think the Omega has enough resources to run couchDB. I tried to do some google searches but I wasn't able to find any information on compiling it for OpenWRT. However, I was able to find a lite noSQL here: http://whitedb.org, however I am not sure if it fits your requirement.
This demonstration uses the ULN2003A, which is a cheaper version of the ULN2803, but is the same as far as electrical connections and such.
I wrote this in simple terms for clarity so anyone can understand it, hopefully.
In the Fritzing diagram below it shows the connections to the Onion Expansion and your external power source. This would be the same for whatever you are trying to power, wether it be an LED or a relay.
The ULN2003/ULN2803 sink the Ground to your part. So if you are trying to run LEDs or other directional power parts you have to have the Negative line(Cathode) of your part connected to the output of the chip and the positive leg of your part connected to the positive side of your power source.
When I hooked it up I just used the GPIO Tool in the Onion Console to turn on or off each color as I wanted. It worked flawlessly. My boy, only 4 years old, wanted to turn the colors on and off too.... lol
I hope this helps. Feel free to message me if you have any questions.
Hi @Boken-Lin , Thanks a lot for the information, definitely it will help!
One question, I see on that article that SNMPD or MiniSNMP are mostly oriented to obtain performance data from the Onion Omega (which is good) to be polled from a centralized SNMP server (i.e. CACTI), however I did not see anything about how to trigger traps (push SNMP message) to be sent from the Onion Omega towards the centralized SNMP server (i.e NPM SolarWinds, IBM NetCool, etc.). For example, if a temperature alarm is triggered and detected by Onion Omega (inner script), can it uses SNMPD o MiniSNMPD to send an SNMP trap to the centralized server informing about the Temperature Alarm triggered ?
I'll keep reading to find it out, but if you already have a reference article would be great.
Thanks @fader and @Boken-Lin. I have started using tmux in a vertical split screen while testing so that I can quickly restore my changes after a factory reset. The openwrt article was handy for keeping my configs.