# Configure parameters with MQTT

**URL:** <https://bbs.aprbrother.com/t/configure-parameters-with-mqtt/1854>\
**Category:** BLE Gateway\
**Created:** [July 7, 2022, 11:28am UTC](https://bbs.aprbrother.com/t/configure-parameters-with-mqtt/1854 "2022-07-07T11:28:31Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![kmg454](https://bbs.aprbrother.com/letter_avatar_proxy/v4/letter/k/6de8d8/32.png) [@kmg454](https://bbs.aprbrother.com/u/kmg454)\
**Post date:** [July 7, 2022, 11:28am UTC](https://bbs.aprbrother.com/t/configure-parameters-with-mqtt/1854/1 "2022-07-07T11:28:32Z")

</div>

I made the files  
Config Topic  
Topic Prefix For Device Inbox  
Device Outbox Topic  
but where do I store these files?

---

<div class="post-metadata">

**Author:** ![aprilpea](https://bbs.aprbrother.com/user_avatar/bbs.aprbrother.com/aprilpea/32/9_2.png) [@aprilpea](https://bbs.aprbrother.com/u/aprilpea)\
**Post date:** [July 7, 2022, 12:16pm UTC](https://bbs.aprbrother.com/t/configure-parameters-with-mqtt/1854/2 "2022-07-07T12:16:47Z")

</div>

Please check the document for [configure parameters with MQTT](https://wiki.aprbrother.com/en/gw4/config_with_mqtt.html).

You need install your own MQTT broker first

---

<div class="post-metadata">

**Author:** ![kmg454](https://bbs.aprbrother.com/letter_avatar_proxy/v4/letter/k/6de8d8/32.png) [@kmg454](https://bbs.aprbrother.com/u/kmg454)\
**Post date:** [July 7, 2022, 12:45pm UTC](https://bbs.aprbrother.com/t/configure-parameters-with-mqtt/1854/3 "2022-07-07T12:45:35Z")

</div>

I have my broker installed that’s not the problem, but how do I use the Config Topic,  
Topic Prefix For Device Inbox and the Device Outbox Topic. I made the files but how do i use them and where to store.

---

<div class="post-metadata">

**Author:** ![aprilpea](https://bbs.aprbrother.com/user_avatar/bbs.aprbrother.com/aprilpea/32/9_2.png) [@aprilpea](https://bbs.aprbrother.com/u/aprilpea)\
**Post date:** [July 8, 2022, 3:06am UTC](https://bbs.aprbrother.com/t/configure-parameters-with-mqtt/1854/4 "2022-07-08T03:06:18Z")

</div>

I expect that you have set these for gateways

- Config Topic
- Topic Prefix For Device Inbox `device-config-`
- Device Outbox Topic `pub-config-`

Let’s say the mac address for gateway is `CC50E38BA0BC`

For configure the gateway with MQTT, you can publish a message to the topic `device-config-CC50E38BA0BC`, the topic is combined with topic prefix and mac address

```auto
{
    "event": "update",
    "version": 1,
    "config": {
        "app": {
            "mqtt-host": "mqtt.bconimg.com",
            "mqtt-port": 1883,
            "mqtt-topic": "new/topic"
        }
   }
}

```

You can do this with `mosquitto_pub` command line or MQTT tool with GUI such as `MQTTX`. Here’s an example for `mosquitto_pub`

1. save the message to file `msg.txt`
2. run the mosquitto\_pub command. Please modify the command to match your host and port

```auto
mosquitto_pub -h YOUR-MQTT-BROKER -p 1883 -f msg.txt

```
