R2D2 HTTP API: Difference between revisions

From Opale Wiki
Jump to navigation Jump to search
(Fix HTTP incorrect description)
No edit summary
 
(4 intermediate revisions by the same user not shown)
Line 22: Line 22:
* <nowiki>http://root:admin@192.168.1.1:8000/cgi-bin?command=StartGsmPort&arg1=0</nowiki>
* <nowiki>http://root:admin@192.168.1.1:8000/cgi-bin?command=StartGsmPort&arg1=0</nowiki>


* <nowiki>http://root:admin@192.168.2.1:8000/cgi-bin?command=SendAtCommand&arg1=ATI4</nowiki>
* <nowiki>http://root:admin@192.168.1.1:8000/cgi-bin?command=SendAtCommand&arg1=0&arg2=ATI4</nowiki>
|}
|}
In order to allow the HTTP interface to work, it has to be enabled by the following command (through SSH):
In order to allow the HTTP interface to work, it has to be enabled by the following command (through a SSH session):


<code>reg add services/gsmrobotd/parameters /v HTTPListeningPort /t REG_DWORD /d 80</code>
<code>reg add services/gsmrobotd/parameters /v HTTPListeningPort /t REG_DWORD /d 8000</code>


It sets the HTTP ListingPort to 80, or any desired and available value.
It sets the HTTP ListingPort to 8000, or any desired and available value (note that 80 will conflict with the robot web interface).


<code>reg add services/gsmrobotd/parameters /v HTTPSListeningPort /t REG_DWORD /d 443</code>
<code>reg add services/gsmrobotd/parameters /v HTTPSListeningPort /t REG_DWORD /d 8443</code>


It sets the HTTPS ListingPort to 443, or any desired and available value. And the following line saves the modification on disk.
It sets the HTTPS ListingPort to 8443, or any desired and available value. And the following line saves the modification on disk.


<code>reg regsave</code>
<code>reg regsave</code>
Line 38: Line 38:
Then to take into account the changes the following commands must be entered:
Then to take into account the changes the following commands must be entered:


<code>sc stop gsmrobotd</code>
<code>sc restart all</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:
The following command can then be used to check if the configuration is correct:

Latest revision as of 15:24, 28 January 2026

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:
  • http://root:admin@192.168.1.1:8000/cgi-bin?command=StartGsmPort&arg1=0
  • http://root:admin@192.168.1.1:8000/cgi-bin?command=SendAtCommand&arg1=0&arg2=ATI4

In order to allow the HTTP interface to work, it has to be enabled by the following command (through a SSH session):

reg add services/gsmrobotd/parameters /v HTTPListeningPort /t REG_DWORD /d 8000

It sets the HTTP ListingPort to 8000, or any desired and available value (note that 80 will conflict with the robot web interface).

reg add services/gsmrobotd/parameters /v HTTPSListeningPort /t REG_DWORD /d 8443

It sets the HTTPS ListingPort to 8443, 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 restart all

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.