Cannot get messages from mosquitto (client id rejected)

Hello, I had been using an older version (May) of the loraserver setup (using Vagrant) and could easily subscribe to any topic and receive the rx data or send mine with a tx topic. Since yesterday, I am using the latest version (October 30th) and at the beggining I was unable to subscribe to any topic and the message I got was “Connection Refused: not authorised.”
Then I saw this changelog message “Note that anonymous connections will be rejected. This allows users to connect to the MQTT broker using their LoRa App Server credentials.” so I tried to use this command:
mosquitto_sub -v -t “#” -u “admin” -P “admin” in order to use the Lora App Server credentials. Now the connection is not refused but no messages appear at all :frowning:
What am I missing here? Thank you

With mosquitto_sub there is an issue. Add -i somerandomstring. The issue is that the Mosquitto server marks the random client id that mosquitto_sub generates when you don’t set the -i flag as suspicious, which is not really handy :wink:

1 Like

Correct, I would have never guessed that :stuck_out_tongue:
While mosquitto_sub command now seems to work ok, nothing changes if I use a client id while using the mosquitto library (in mosquitto_new(const char * id, bool clean_session, void *obj) :frowning:
I am curious if anyone has seen this issue, as I did’t see any similar question in the forum.

It took me a while to figure that out too :wink:

I suppose you mean with the mosquitto C library? Unfortunately I don’t have any experience with that.

1 Like

Yes, the C library. I had a silly bug, now it operates as expected.
Thank you Orne, your work and dedication so far are impressive :wink:

1 Like