Documentation > nControl > Getting Started
Configuring WiFi Controllers
For nControl™ 2018.1 or higher
This article explains how to connect a WiFi train controller to nControl.
How does the train controller communicate with nControl?
The train controller and nControl communicate through an MQTT broker. An MQTT broker is a 'message server' that can receive messages from one device and forward them another devices. The broker creates a network of interconnected devices.
So the train controller needs to make two connections:
  • It has to connect to the WiFi network so it can reach the MQTT broker. The WiFi controller needs a 2.4GHz WiFi network.
  • It has to connect to the MQTT broker
Configuring the Controller
The first time you use a controller you need to configure it so it can connect to the WiFi network and MQTT broker.
  • Start by launching nControl and make sure the MQTT broker is running: select Controller > MQTT Broker in the main menu. If the broker is not running, click the Start button to launch it. Once the broker is running, close the dialog box by clicking the Close button.
  • Connect the train controller to your computer using a mirco-B USB cable. Make sure it's the only 4DBrix controller that is connected to the computer. Choose Controller > Configure WiFi Controller in the main menu. This will open the WiFi Controller Configuration dialog box. Enter the following information:
    • an alias for the controller, that's the name you will have to use in nControl to identify the controller. If you use multiple train controllers, they all need to have a unique alias.
    • the name (SSID) of your WiFi network
    • the password of your WiFi network
    • the IP address of the MQTT broker. Click the Use this system button to retrieve the address for your computer.
    Click the Store button to save this information in your train controller.
Verifying the Settings
Keep the controller connected to the micro-B USB cable and verify the settings by clicking on the Verify button. Your controller will first attempt to connect to your WiFi network.

Once the controller is connected to the WiFi network, it will try to connect to the MQTT broker.

Disconnect the controller from the USB cable. It's now ready to be used.
Using the Controller
Connect the controller to the LEGO® battery box and switch the power on. The controller will automatically connect to the WiFi network and MQTT broker. It takes around 5 seconds for the controller to boot and to connect to the MQTT broker.

You only need to configure the controller once. As long as you're using it on the same WiFi network, you don't need to reconfigure it; just switch it on and it will automatically connect.
Troubleshooting
If the controller is not connecting to nControl:
  • Check that you're using a 2.4GHz WiFi network.
  • Connect the controller to the computer and verify the configuration: Controller > Configure WiFi Controller > Verify. This will show whether the controller cannot connect to the WiFi network or the MQTT broker.
  • If it cannot connect to the WiFi network; check the WiFi network name and password.
  • If it cannot connect to the MQTT broker; check whether the broker IP address is correct and whether the broker is running.
  • Check if there are not firewalls blocking MQTT traffic. You can use our online MQTT test app to check whether you can communiate with MQTT brokers over your network.