Skip to content


  1. Connect to NanoPi NEO with SSH
  2. Download installation script:

    curl -o -L

  3. Make script executable and run it:

    chmod +x

    Installation script will:

    • Enable I2C and UART ports
    • Download and build WiringNP library
    • Install Java JRE
    • Download the latest version of MqGateway
    • Prepare basic configuration for MqGateway (requires adjustments before running MqGateway)
    • Prepare and enable a service which will ensure MqGateway is running all the time, even in case of device restart

    In case of problems with installation - see logs in file /opt/mqgateway/mqgateway-install.log

  4. Edit MqGateway configuration with an editor of your choice (e.g. nano or vim) to change address of MQTT server:

    configVersion: "1.1"
    name: "TestGateway"
    mqttHostname: "" # set IP of your MQTT broker
    rooms: # change devices configuration
    - name: "workshop"
        - name: "point with test relay"
          portNumber: 1
            - name: "test relay"
              id: "my-relay"
              wires: ["BLUE"]
              type: RELAY

    For more details on configuration files see configuration page and examples for supported devices.

  5. Reboot your NanoPI NEO to enable I2C and serial ports.
    MqGateway always starts automatically on start of NanoPi NEO.

What's next?