Aller au contenu

Web services associated with VRmaze Lite

VRmaze Lite includes a Web server for remote control of the software. This Web server is launched at VRmaze Lite startup when the Deploy Web Services option is enabled in the control panel.

Image title 2

Web Server User Interface.

VRmaze Lite Web Services

The web services offered by VRmaze Lite are few in number and do not offer an advanced graphical interface. They provide access to a set of remote commands.

The Web server provides access to these functions:

  • Create a subject (with first and last name)
  • Launch a protocol (by selecting a subject beforehand)
  • Send a command to stop the current protocol.
  • Abruptly stop the protocol in progress
  • View logs

To access the web server, when VRmaze Lite is launched, open an Internet browser and enter the address http://localhost/liteserver.

To access the Web server from a remote computer, enter the IP address of the target computer http://ADRESSE_IP_DISTANTE/liteserver.

Getting log information

The Web server sends back information about VRmaze Lite, but is unable to get any status feedback on the current protocol. The protocol itself must send information back to the server, so that all the server's clients are informed of the current protocol status.

To achieve this, VRmaze has an entity attribute called Lite Record Logger under the Lite category. This attribute will search for the first available parent containing records (DataRecords) and output the last known recorded data as a log line in the server at a variable frequency.

Attribute Lite Record Logger

The frequency at which logs are sent must be deliberately low, so as not to overload the server calls and the processing of the sending process to the detriment of protocol execution speed.

Stop signal management

By default, a protocol is independent: it cannot be stopped from the outside without completely shutting down the process (at the risk of not obtaining any result files). A protocol attribute is used to manage stop signals. This Lite Server Signal Listener attribute of the Lite category will regularly (once every 3 seconds) ask the server about the status of its Stop command. When the signal is received, the protocol will stop normally and proceed with data logging.

Trigger management

The Web server, designed to be accessible from the local network, allows you to manually launch triggers using the dedicated command. This command sends a numerical value to the protocol under experimentation. The value of this trigger can be captured by a MemoryMapperFloatRecorderEntity.

This entity allows floating-point values to be captured in a mapped memory space. The mapped memory space dedicated to VRmaze Lite's web server is called LiteWebServer (See dedicated section).

Web server launch error

It is possible that the launch of a web server when VRmaze Lite is launched may fail. Depending on certain configurations, VRmaze Lite may be unable to launch the web server. In the event of a problem launching the software, a message is displayed:

Image title 2

The web server launch error message.

Web server launch error

A Web server launch error is not blocking the use of VRmaze Lite.

The error can be explained by the fact that, by default, Windows does not allow non-administrator users to open communication ports.

  • The first solution is to run VRmaze Lite as an administrator.

The second solution is to declare the communication port used by the web server open for the user launching VRmaze Lite, or for all users by default. The operation consists in launching a command-line action with administrator authentication:

Some prerequisites:

  • This command must be executed by a machine administrator.
  • VRmaze Lite cannot execute this command internally.

To run a command prompt as an administrator, execute the cmd command and select the administrator run option:

Image title 2

The command prompt launched as administrator.

Next, type a netsh command opening the http port in communication for the registered user or all users, of which here are two examples (The first example opens the port for all users of the machine while the second opens it for the user of domain Domain and name UserName):

  • netsh http add urlacl url=http://+:80/ user="everyone"
  • netsh http add urlacl url=http://+:80/ user=Domaine/NomUtilisateur

This command only needs to be performed once on the machine and only requires a restart of VRmaze Lite.

Unable to connect to server from outside.

In the event of problems connecting to the server from another machine, check the Windows firewall properties and, in some cases, allow access to the machine on port 80.

Open port for everyone

Please note that port opening for "Everyone" depends on the version of Windows installed on the workstation. Indeed, depending on the main language of Windows, "all users" have different names (User="Everyone" in English, User="Todos" in Spanish etc.).

Windows firewall blocks port 80

By default, the Windows firewall blocks port 80 for incoming and outgoing communications. To access the server from a computer on the network, you need to :

  • Disable the Windows firewall (not recommended for security reasons).
  • open port 80 for incoming and outgoing communication.

To open port 80 for communication, you need to create two rules, one for outgoing communication, the other for incoming communication. Many tutorials exist on the Internet, here's one for opening a port for incoming connections. You need to create the same rule for outgoing connections.