# MQTT connection to broker lost when adding LWT property

**URL:** <https://discourse.nodered.org/t/mqtt-connection-to-broker-lost-when-adding-lwt-property/81529>\
**Category:** General\
**Tags:** mqtt\
**Created:** [24 September 2023 01:41 UTC](https://discourse.nodered.org/t/mqtt-connection-to-broker-lost-when-adding-lwt-property/81529 "2023-09-24T01:41:46Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![flyinfalcon](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/flyinfalcon/32/83161_2.png) [@flyinfalcon](https://discourse.nodered.org/u/flyinfalcon)\
**Post date:** [24 September 2023 01:41 UTC](https://discourse.nodered.org/t/mqtt-connection-to-broker-lost-when-adding-lwt-property/81529/1 "2023-09-24T01:41:46Z")

</div>

I am trying to setup a Last Will & Testament but once I add the LWT topic to the broker properties and once I deploy the connection is immediately lost to the broker which is hosted on aws IoT core.  
I've tried configuring it with differente QoS values, different payloads but no luck, any ideas what is causing this unless i'm missing something here? Thanks

Here is a link showing what I mean: [https://youtu.be/BcvVQFdVc1M](https://youtu.be/BcvVQFdVc1M)

---

<div class="post-metadata">

**Author:** ![kuema](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/kuema/32/6542_2.png) [@kuema](https://discourse.nodered.org/u/kuema)\
**Post date:** [24 September 2023 06:36 UTC](https://discourse.nodered.org/t/mqtt-connection-to-broker-lost-when-adding-lwt-property/81529/2 "2023-09-24T06:36:17Z")

</div>

Could be a permission issue with the topic you're using as LWT topic. Most - if not all - MQTT brokers close the connection if you don't have permission to reading/writing to a topic.

As for AWS, I _suspect_ you can only access a specific topic prefix, like the one in your video. `$AWS/things/[my-id]/...`.

However, it's just a guess, I've never used AWS and don't know their conventions and restrictions. Does it even support LWT?

---

<div class="post-metadata">

**Author:** ![flyinfalcon](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/flyinfalcon/32/83161_2.png) [@flyinfalcon](https://discourse.nodered.org/u/flyinfalcon)\
**Post date:** [24 September 2023 09:01 UTC](https://discourse.nodered.org/t/mqtt-connection-to-broker-lost-when-adding-lwt-property/81529/3 "2023-09-24T09:01:57Z")

</div>

Resolved this now, yes it was a permissions issue, I was using a wildcard that wasn't supported. Many Thanks

---

<div class="post-metadata">

**Author:** ![system](https://us1.discourse-cdn.com/flex026/uploads/nodered/original/1X/d073cd938eafa2e558d7c2cd59003b3ef4963033.png) [@system](https://discourse.nodered.org/u/system)\
**Post date:** [8 October 2023 09:02 UTC](https://discourse.nodered.org/t/mqtt-connection-to-broker-lost-when-adding-lwt-property/81529/4 "2023-10-08T09:02:54Z")

</div>

This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.
