ECMD Protocols: Unterschied zwischen den Versionen

Aus Ethersex_Wiki
Wechseln zu: Navigation, Suche
Zeile 1: Zeile 1:
 +
Unter Annahme, dass du ETHERSEX-IP, ECMD-PORT und ECMD-COMMAND entsprechend substituierst, kannst du unter folgenden Protokollen für die Übertragung von ecmd Befehlen wählen:
 +
 
== ECMD via HTTP ==
 
== ECMD via HTTP ==
If enabled in the configuration, you can call ECMD commands using URLs of the form:
+
Muss in menuconfig eingeschaltet werden. Dann ist folgendes URL Schema möglich:
 
<pre>http://ETHERSEX-IP/ecmd?ECMD-COMMAND</pre>
 
<pre>http://ETHERSEX-IP/ecmd?ECMD-COMMAND</pre>
Depending on your browser, ECMD-COMMAND may need to have the spaces replaced by '''+''' signs.
+
 
E.g.
+
== ECMD via USART ==
<pre>http://ETHERSEX-IP/ecmd?show+version</pre>
+
 
 +
== ECMD via UDP ==
  
 
== ECMD via TCP ==
 
== ECMD via TCP ==
If enabled in the configuation Ethersex accepts ECMD commands via TCP.
+
Muss in menuconfig eingeschaltet werden. Standard Port ist '''2701'''.
The default port that Ethersex listens on is '''2701''', but it can be changed in the configuration.
 
  
As a special Feature ECMD via TCP allows prefixing commands with '''!''' (exclamation mark).
+
Benutze ein Ausrufezeichen '''!''' vor einem ecmd Kommando um die tcp Verbindung sofort nach der Übertraung wieder abzubauen.
This prefix forces the TCP connection to close directly after the command was processed.
 
  
 
Using this command you can easily integrate ECMD into Unix shell scripts. E.g. to get the current
 
Using this command you can easily integrate ECMD into Unix shell scripts. E.g. to get the current
 
timestamp on your Ethersex as a variable in your shell, simply write
 
timestamp on your Ethersex as a variable in your shell, simply write
 
<pre>ECMD_DATE=`echo '!date' | nc ETHERSEX-IP ECMD-PORT`</pre>
 
<pre>ECMD_DATE=`echo '!date' | nc ETHERSEX-IP ECMD-PORT`</pre>
Of course you need to change ETHERSEX-IP and ECMD-PORT by the values for your Ethersex.
 
  
 
[[Category:Ethersex]]
 
[[Category:Ethersex]]
  
 
[[Kategorie:ECMD]]
 
[[Kategorie:ECMD]]

Version vom 25. Juli 2009, 15:44 Uhr

Unter Annahme, dass du ETHERSEX-IP, ECMD-PORT und ECMD-COMMAND entsprechend substituierst, kannst du unter folgenden Protokollen für die Übertragung von ecmd Befehlen wählen:

ECMD via HTTP

Muss in menuconfig eingeschaltet werden. Dann ist folgendes URL Schema möglich:

http://ETHERSEX-IP/ecmd?ECMD-COMMAND

ECMD via USART

ECMD via UDP

ECMD via TCP

Muss in menuconfig eingeschaltet werden. Standard Port ist 2701.

Benutze ein Ausrufezeichen ! vor einem ecmd Kommando um die tcp Verbindung sofort nach der Übertraung wieder abzubauen.

Using this command you can easily integrate ECMD into Unix shell scripts. E.g. to get the current timestamp on your Ethersex as a variable in your shell, simply write

ECMD_DATE=`echo '!date' | nc ETHERSEX-IP ECMD-PORT`