NotAuthorized / No such host is known error

Hello,

I tried publishing data to cumulocity with Mqtt in c#.

I copied the code here [url]MQTT client examples - Cumulocity IoT Guides

When I use “mqtt.cumulocity.com” with my tenantId/username password combination as it is instructed in the guide I get “Not Authorized” error and cannot connect to broker.

When I use MqttBox to publish data, I use “mqtt.cumulocity.com/tenantname” with the same credentials and there is no problem.

So I changed serverUrl in the c# code to “mqtt.cumulocity.com/tenantname” and this time it gives me “No Such Host is Known”

Either way I cannot connect to broker.

I cannot seem to find, Where am I messing up. Please help!

H Ömer,

on which tenant are you working? So you like to create a MQQT device there to publish data on your tenant?

best regards
Michael

Thanks for your reply Michael but it was apparently due to some erroneous config read.
It was trying to get username and password for the subtenant.

Best Regards

Ömer

Hi Omer,

sorry for my late reply. Do I get you last comment right, that you solved the issue?

best regards
Michael