Documentation > nControl > Getting Started
Using Web Interfaces
For nControl™ 2018.0 or higher
This article explains how to generate and use web interfaces. With web interfaces you can control your layout using a phone or tablet.
What are web interfaces?
A web interface is a web page version of your nControl project. It allows you to control and monitor your layout from a web browser. As such you can control your layout with any device that can run a web browser: iPhone, Android phone, iPad, Android tablet, kindle fire tablet, etc. without having to install any additional apps.
The web interface does not have any 'intelligence'. It's essentially a remote control: when you press a tile it will forward that information to the computer running nControl. When nControl changes something in your layout, it will broadcast that to the web interface so you can monitor what's going on.
You can simultaneously connect multiple web interfaces to the same nControl session. For example, you can use a phone to control the switches and use a tablet to monitor your track layout. The MQTT broker in nControl will take care of the communication between all the connected devices and make sure they are remain up-to-date with the current situation.
Generating a web interface
Before you start, make sure you have a 4DBrix account and that nControl is linked to your account.
Web interfaces are generated from nControl projects. Open your project and select File>Upload Interface.... in the main menu. If nControl is correctly linked to your 4DBrix account it will open the Upload Interface dialog box. Enter a Title and a short Description; and click the Upload button. If all goes well you will see the dialog box generating the web interface and uploading it to your 4DBrix account.
The web interfaces are 'read only', you cannot modify your layout with them. If you want to make a change, modify your nControl project and regenerate the web interface.
Starting the MQTT broker
The web interfaces will communicate with nControl through the internal MQTT broker. Before you can open a web interface you have to start the MQTT broker. Select File>MQTT Broker... to open the MQTT Broker dialog box. Click the Start button to launch the broker.

Note that the broker communicates through a Internet/WiFi router. If your computer is not connected to a router the MQTT broker will not be able to start. The MQTT Broker dialog box shows the IP address of the MQTT broker. That's the address that your web interfaces will need to connect to nControl.
Opening the web interface
Before opening a web interface, make sure you have nControl, and its MQTT broker, running. To open a web interface, launch a web browser on the device you want to use and go the 4DBrix website. Scroll down to the footer and select Control Panel in the Account column. This will take you to the log in page.

Enter your e-mail address, password, check the CAPTCHA verification check box and click the Log In button. This will take you to your control panel. There you will see a table with all your interfaces.

Locate the web interface you want to open; you can identify the correct interface using the title and description that you entered while generating it. To open it, click on the button.
The web interface will first ask you to confirm the IP address of the MQTT broker it has to connect to. It will suggest the IP address of the computer that was used to generate the interface. If you want to connect to that computer, just click the Connect button. If you want to connect to another system, enter the IP address of the MQTT broker of that computer before hitting the Connect button. You can find the IP address of the MQTT broker by selecting File>MQTT Broker... in nControl.

If the interface fails to connect to the MQTT broker:
  • Check if the MQTT broker of your nControl session is running. You can do this by selecting File>MQTT Broker... in the main menu. This will open the MQTT Broker dialog box.
  • Check whether the web interface uses the correct IP address. The IP address you have to use is shown in the MQTT Broker dialog box.
  • Check whether your mobile device is connected to the same local network as nControl.
  • Reload the page of the web interface and try to connect.
To connect multiple mobile devices to the same nControl session, simply open the web interface on another device. nControl will automatically make sure all the devices are kept synchronized.
Using the web interface
The web interfaces have three tabs:

  • The first tab shows your track layout. You can use this tab to monitor your layout and see what's going on. That track layout is kept up-to-date by nControl. So if something changes in your layout, either by a script or by another web interface, you will immediately see it in this tab.

  • The second tab shows all the tiles of the connected devices. You can use it to flip switches, change traffic lights, play sounds, etc.

  • The third tab shows all the train control panels. It allows you to control the trains that are equipped with 4DBrix train WiFi controllers.
Who can connect?
The MQTT broker will use your local network, either Ethernet or WiFi. Any device that is connect to your local network can potentially make a connection with nControl and be used to control your layout. Devices that are not on your local network cannot connect to nControl and control your layout.
Make sure your mobile devices are connected to your WiFi network. You cannot control your layout through a mobile data connection, unless your Internet router allows outside access. By default, for security reasons, outside access is blocked by your router; access from the outside will only be possible if you explicitly configure your Internet router to allow it.