# Cirus-Link MQTT and Sparkplug B subscriptions

**URL:** <https://forum.inductiveautomation.com/t/cirus-link-mqtt-and-sparkplug-b-subscriptions/44966>\
**Category:** Ignition\
**Tags:** ignition80\
**Created:** [March 26, 2021, 4:48pm UTC](https://forum.inductiveautomation.com/t/cirus-link-mqtt-and-sparkplug-b-subscriptions/44966 "2021-03-26T16:48:58Z")\
**Posts on this page:** 8\
**Page:** 1

<div class="post-metadata">

**Author:** ![codersmurf](https://avatars.discourse-cdn.com/v4/letter/c/df788c/32.png) [@codersmurf](https://forum.inductiveautomation.com/u/codersmurf)\
**Post date:** [March 26, 2021, 4:48pm UTC](https://forum.inductiveautomation.com/t/cirus-link-mqtt-and-sparkplug-b-subscriptions/44966/1 "2021-03-26T16:48:58Z")

</div>

I have a customer who has ignition and mqtt running on it. I have an app using mosquitto and tahu to sub and pub to their scada. They aren’t sure how to debug issues and cirus-link isn’t really helping them. I have a connection using tls, they see my connection in netstat, but I never get the connection callback and any subs and pubs seemingly do nothing. I’m not even sure what topic path should look like, neither do they.Thanks, jake

---

<div class="post-metadata">

**Author:** ![Kyle\_Chase](https://avatars.discourse-cdn.com/v4/letter/k/9de0a6/32.png) [@Kyle\_Chase](https://forum.inductiveautomation.com/u/Kyle_Chase)\
**Post date:** [March 26, 2021, 5:15pm UTC](https://forum.inductiveautomation.com/t/cirus-link-mqtt-and-sparkplug-b-subscriptions/44966/2 "2021-03-26T17:15:34Z")

</div>

What are you seeing in your broker logs?

---

<div class="post-metadata">

**Author:** ![codersmurf](https://avatars.discourse-cdn.com/v4/letter/c/df788c/32.png) [@codersmurf](https://forum.inductiveautomation.com/u/codersmurf)\
**Post date:** [March 26, 2021, 5:29pm UTC](https://forum.inductiveautomation.com/t/cirus-link-mqtt-and-sparkplug-b-subscriptions/44966/3 "2021-03-26T17:29:14Z")

</div>

connect: mqtt tls 0

Client mosq/QhNDKFpE`BAkLK2WI9 sending CONNECT

Client mosq/QhNDKFpE`BAkLK2WI9 sending SUBSCRIBE (Mid: 1, Topic: spBv1.0/#, QoS: 0)

---

<div class="post-metadata">

**Author:** ![justin.brzozoski](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/justin.brzozoski/32/13452_2.png) [@justin.brzozoski](https://forum.inductiveautomation.com/u/justin.brzozoski)\
**Post date:** [March 26, 2021, 5:54pm UTC](https://forum.inductiveautomation.com/t/cirus-link-mqtt-and-sparkplug-b-subscriptions/44966/4 "2021-03-26T17:54:03Z")

</div>

> [@codersmurf](#):
>
> I never get the connection callback and any subs and pubs seemingly do nothing

The mosquitto pub/sub command line tools will just sit there quietly and do nothing if your TLS setup isn't right. They don't fail like you'd expect. It's possible it's opening a connection to the server port and you're stuck on TLS negotiation.

Can you test it on a non-TLS port just for sanity?

---

<div class="post-metadata">

**Author:** ![codersmurf](https://avatars.discourse-cdn.com/v4/letter/c/df788c/32.png) [@codersmurf](https://forum.inductiveautomation.com/u/codersmurf)\
**Post date:** [March 26, 2021, 6:04pm UTC](https://forum.inductiveautomation.com/t/cirus-link-mqtt-and-sparkplug-b-subscriptions/44966/5 "2021-03-26T18:04:27Z")

</div>

Unfortunately I can’t, the customer is not really into helping us, they are trying to bully us into what they want. If it was up to them we would not be able to see any data from the machines we rent them. Would the logs on their end show anything? The customer seems to have only high level guys and if I could tell them exactly what to look for I might be able to get further.Thanks, jake

---

<div class="post-metadata">

**Author:** ![justin.brzozoski](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/justin.brzozoski/32/13452_2.png) [@justin.brzozoski](https://forum.inductiveautomation.com/u/justin.brzozoski)\
**Post date:** [March 26, 2021, 7:19pm UTC](https://forum.inductiveautomation.com/t/cirus-link-mqtt-and-sparkplug-b-subscriptions/44966/6 "2021-03-26T19:19:23Z")

</div>

When I get stuck on what might be TLS issues for MQTT, and I have no pull with the the server admins, my usual path is a mix of using `openssl s_client` to more closely examine what certificates their server is using and expecting, and to setup a temporary MQTT server of my own that tries to behave in a similar manner to confirm that I am setting up my client properly.

As a starting point, just try a command like this pointed at the server you’re having trouble using:

```auto
openssl s_client -connect test.mosquitto.org:8883 -showcerts -status

```

Openssl comes with most Linux setups and I think Win10 more recently as well.

That [test.mosquitto.org](http://test.mosquitto.org) server is probably also a reasonable place to test your client against some different TLS setups to make sure you’re not doing that wrong. You can find more info on the useful setups they provide on different (non-standard) ports from the top level web page at the same address.

---

<div class="post-metadata">

**Author:** ![Kyle\_Chase](https://avatars.discourse-cdn.com/v4/letter/k/9de0a6/32.png) [@Kyle\_Chase](https://forum.inductiveautomation.com/u/Kyle_Chase)\
**Post date:** [March 26, 2021, 8:12pm UTC](https://forum.inductiveautomation.com/t/cirus-link-mqtt-and-sparkplug-b-subscriptions/44966/7 "2021-03-26T20:12:11Z")

</div>

Sounds like an authentication issue/acl issue. I’d check that.

---

<div class="post-metadata">

**Author:** ![codersmurf](https://avatars.discourse-cdn.com/v4/letter/c/df788c/32.png) [@codersmurf](https://forum.inductiveautomation.com/u/codersmurf)\
**Post date:** [March 26, 2021, 8:18pm UTC](https://forum.inductiveautomation.com/t/cirus-link-mqtt-and-sparkplug-b-subscriptions/44966/8 "2021-03-26T20:18:14Z")

</div>

So it comes back as expected, perhaps I’m not using mosquitto correctly, here’s what I have:

mosquitto\_username\_pw\_set(m\_client, usr.c\_str(), pwd.c\_str());  
mosquitto\_tls\_set(m\_client, ca.c\_str(), NULL, NULL, NULL, NULL);

ca is the full path to the pem in /etc/mosquitto/ca\_certificates/

Thanks
