groove-x / mqtt_bridge

mqtt_bridge provides a functionality to bridge between ROS and MQTT in bidirectional
MIT License
160 stars 146 forks source link

How to configure will params in demo.yaml #42

Closed baycxh closed 3 years ago

baycxh commented 3 years ago

How to configure will params in demo.yaml , is there any params to be configure and what's the pattern? Thanks!

ledmonster commented 3 years ago

Hi @baycxh. Which params do you want to configure? If you run mosquitto in local, you can use demo.yaml as it is.

baycxh commented 3 years ago

@ledmonster Thanks for your answer. I want to know how to set the will params in the configure to ensure the last message from client is sent.

ledmonster commented 3 years ago

Oh, I see. I haven't tried, but this may work.

mqtt:
  client:
    protocol: 4      # MQTTv311
  connection:
    host: localhost
    port: 1883
    keepalive: 60
  private_path: device/001
  will:
    topic: some_topic
    payload: some_payload
    qos: 0
    retain: false
    # properties: # we don't support this option, since it needs to be a Properties instance.

Related code: