R2D2 HTTP API

From Ultiroam User Docs
Jump to navigation Jump to search

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 of the R2D2 API command used.

Argument between brackets are optionnals.

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.2.1:8000/cgi-bin?command=SendAtCommand=&arg1=ATI4

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 return either the HTTP or the HTTPS Listening port depending on the command entered.