R2D2 HTTP API: Difference between revisions
No edit summary |
No edit summary |
||
(2 intermediate revisions by the same user not shown) | |||
Line 2: | Line 2: | ||
It has the following syntax: | It has the following syntax: | ||
{| | {| class="wikitable" | ||
|'''Syntax''': | |'''Syntax''': | ||
|http://['''user:password'''@]'''IP_Address'''[:'''Port_Number]'''/cgi-bin?command='''R2D2Command'''&'''arg1'''=val1&'''arg2'''=val2...&''' | |http://['''user:password'''@]'''IP_Address'''[:'''Port_Number]'''/cgi-bin?command='''R2D2Command'''&'''arg1'''=val1&'''arg2'''=val2...&'''argN'''=v | ||
|- | |- | ||
| | | | ||
Line 13: | Line 13: | ||
- '''R2D2Commmand''' is the R2D2 API command to be executed | - '''R2D2Commmand''' is the R2D2 API command to be executed | ||
- '''arg1''' to ''' | - '''arg1''' to '''argN''' depend on the arguments needed for the R2D2 API command entered. | ||
Argument between brackets are | Argument between brackets are optionals. | ||
|- | |- | ||
|'''Examples:''' | |'''Examples:''' | ||
Line 24: | Line 24: | ||
* <nowiki>http://root:admin@192.168.2.1:8000/cgi-bin?command=SendAtCommand=&arg1=ATI4</nowiki> | * <nowiki>http://root:admin@192.168.2.1:8000/cgi-bin?command=SendAtCommand=&arg1=ATI4</nowiki> | ||
|} | |} | ||
< | In order to allow the HTTP interface to work, it has to be enabled by the following command (through SSH): | ||
<code>reg add services/gsmrobotd/parameters /v HTTPListeningPort /t REG_DWORD /d 80</code> | |||
It sets the HTTP ListingPort to 80, or any desired and available value. | |||
<code>reg add services/gsmrobotd/parameters /v HTTPSListeningPort /t REG_DWORD /d 443</code> | |||
It sets the HTTPS ListingPort to 443, or any desired and available value. And the following line saves the modification on disk. | |||
<code>reg regsave</code> | |||
Then to take into account the changes the following commands must be entered: | |||
<code>sc stop gsmrobotd</code> | |||
<code>sc stop gsmuxsvc</code> | |||
<code>sc start gsmuxsvc</code> | |||
<code>sc start gsmrobotd</code> | |||
The following command can then be used to check if the configuration is correct: | |||
<code>reg query services/gsmrobotd/parameters /v HTTPListeningPort</code> | |||
<code>reg query services/gsmrobotd/parameters /v HTTPSListeningPort</code> | |||
It will either return the HTTP or the HTTPS Listening port depending on the command above entered. |
Latest revision as of 07:51, 4 June 2024
Any command from the R2D2 API can be accessed through a HTTP Interface.
It has the following syntax:
Syntax: | http://[user:password@]IP_Address[:Port_Number]/cgi-bin?command=R2D2Command&arg1=val1&arg2=val2...&argN=v |
- User:password are user & password to connect to the Robot
- IP_Address is the TCP/IP address of the Robot, Port is the port used to access the R2D2 API - R2D2Commmand is the R2D2 API command to be executed - arg1 to argN depend on the arguments needed for the R2D2 API command entered. Argument between brackets are optionals. | |
Examples: | If Robot's credentials are user=root and password=admin, at IP Address 192.168.1.1 with port 8000:
|
In order to allow the HTTP interface to work, it has to be enabled by the following command (through SSH):
reg add services/gsmrobotd/parameters /v HTTPListeningPort /t REG_DWORD /d 80
It sets the HTTP ListingPort to 80, or any desired and available value.
reg add services/gsmrobotd/parameters /v HTTPSListeningPort /t REG_DWORD /d 443
It sets the HTTPS ListingPort to 443, or any desired and available value. And the following line saves the modification on disk.
reg regsave
Then to take into account the changes the following commands must be entered:
sc stop gsmrobotd
sc stop gsmuxsvc
sc start gsmuxsvc
sc start gsmrobotd
The following command can then be used to check if the configuration is correct:
reg query services/gsmrobotd/parameters /v HTTPListeningPort
reg query services/gsmrobotd/parameters /v HTTPSListeningPort
It will either return the HTTP or the HTTPS Listening port depending on the command above entered.