If I have a relay board controlled from a web interface thru the ethernet port, how can I create a keyboard shortcut to activate the relay without the browser being open?
Asked
Active
Viewed 136 times
1 Answers
2
I assume you are talking about the Web Relay device made by control by web. If so, these have capabilities to be controlled by simple GET requests, so you could potentially map a wget command to a shortcut. Alternatively, you should look into the UniPi relay board. They cost about the same as one control by web device, but have 8 relays, one wire temperature sensors, and a slew of other features.
I am currently using these devices to automate a generator/solar system, and they are working great. Of course, of this isn't what you're talking about, then this is all rather worthless, isn't it!
Chris Cummings
- 21
- 2
-
Sounds like you know what you're about Chris - can you provide an example of how to map a wget command to a shortcut? – goobering Aug 02 '15 at 07:53
-
@goobering He more or less already did. Web servers and clients use HTTP to communicate;
GETis normally used to fetch pages. If "Do whatever" is a normal hyperlink, the browser sends aGETrequest when you click on it. That's what the server responds to. – goldilocks Aug 02 '15 at 13:48 -
Here is a good basis for mapping it to a shortcut: http://unix.stackexchange.com/questions/89622/how-to-execute-a-script-in-shell-when-a-shortcut-key-is-pressed As far as the actual GET command, read the manual for (what I'm assuming is) your control by web device. – Chris Cummings Aug 02 '15 at 17:27
wgetshould be sufficient (curlmight be better for this). If not, then obviously you will have to create the web interface first. – goldilocks Aug 02 '15 at 13:45