Hi,
i’m currently testing the MQTT connection with Cumulocity IoT Cloud using the tutorial that can be found under:
cumulocity guides under device SDK → mqtt examples->hello-mqtt-python
However, when i added on_connect callback and started the script, everytime it gives me result code 5, which is “not authorised” :
0%| | 0/50 [00:00<?, ?it/s]
Connect result = 5
2%|███▏ | 1/50 [00:01<00:49, 1.00s/it]
Connect result = 5
6%|█████████▋ | 3/50 [00:03<00:47, 1.00s/it]
Connect result = 5
14%|██████████████████████▌ | 7/50 [00:07<00:43, 1.00s/it]
Connect result = 5
30%|████████████████████████████████████████████████ | 15/50 [00:15<00:35, 1.00s/it]
Connect result = 5
62%|███████████████████████████████████████████████████████████████████████████████████████████████████▏ | 31/50 [00:31<00:19, 1.00s/it]
Connect result = 5
100%|████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████| 50/50 [00:50<00:00, 1.00s/it]
Connection failed
and here is the setting for connection, except added an on_connect callback to prevent the program from stucking at loop and the tenant, username, password settings, all the rest code is just as same as the tutorial in above link.
In Addition, for the field “serverUrl”, i have also tried the one for my cockipt, but it also not work.
Does anyone know how to solve it? It’s currently a free trial account btw.
Best regards