Changes

Line 152: Line 152:  
Use a web browser or any other compatible software to send HTTP POST/GET requests to the device.
 
Use a web browser or any other compatible software to send HTTP POST/GET requests to the device.
   −
Below is a table containing syntax examples of this usage:  
+
====Setting====
 +
----
 +
Changing states of various I/O is possible using requests. Below is a table containing syntax examples of this usage:  
    
<table class="nd-othertables_2">
 
<table class="nd-othertables_2">
Line 206: Line 208:  
     <li><b>Switch output to High:</b><br><pre>curl -X GET "http://192.168.1.1/cgi-bin/io_state?username=user1&password=user1&pin=dout1&state=on"</pre></li>
 
     <li><b>Switch output to High:</b><br><pre>curl -X GET "http://192.168.1.1/cgi-bin/io_state?username=user1&password=user1&pin=dout1&state=on"</pre></li>
 
     <li><b>Switch output to Low after delay:</b><br><pre>curl -X GET "http://192.168.1.1/cgi-bin/io_state?username=user1&password=user1&pin=dout1&state=off&delay=5"</pre></li>
 
     <li><b>Switch output to Low after delay:</b><br><pre>curl -X GET "http://192.168.1.1/cgi-bin/io_state?username=user1&password=user1&pin=dout1&state=off&delay=5"</pre></li>
 +
</ul>
 +
 +
====Reading====
 +
----
 +
Getting the current state of various I/O is possible using requests. Usage is very similar to the examples above:
 +
 +
<b>Examples:</b>
 +
 +
<ul>
 +
{{#ifeq:{{{configurableio}}}|1|<li><b>Read state of Configurable Input/Output PIN3:</b><br><pre>curl -X GET "http://192.168.1.1/cgi-bin/io_value?username=user1&password=user1&pin=dio0"</pre></li>|}}
 +
{{#ifeq:{{{analog}}}|1|<li><b>Read state of analog input (in voltage mode):</b><br><pre>curl -X GET "http://192.168.1.1/cgi-bin/io_value?username=user1&password=user1&pin=adc0"</pre></li>
 +
<li><b>Read state of analog input (in current mode):</b><br><pre>curl -X GET "http://192.168.1.1/cgi-bin/io_value?username=user1&password=user1&pin=acl0"</pre></li>|}}
 +
  <li><b>Read state of digital output:</b><br><pre>curl -X GET "http://192.168.1.1/cgi-bin/io_value?username=user1&password=user1&pin=dout1"</pre></li>
 
</ul>
 
</ul>
  

Navigation menu