Connect to azure by MQTTT ( not azure iot node )?


I’ve been trying to connect to an azure iot hub using the Mqtt node and always get ‘not authorised’.

I can successfully connect and send messages using the azure iot node but I’m trying to simulate a device which cannot use the sdk and can only use ‘native’ mqtt, hence my focus is on the mqtt node.

I configure the mqtt node with a username and sas password, and have uploaded the azure ca certificate and set the node as ssl, but as I mentioned I always get ‘not authorised’.

Any ideas appreciated,
Thx, Gav

Have you checked following links:

Thank you yes I have, I used them as references for example to figure how to create the sas token.

I guess for most people they’d just use the azure nodes, and I know they work, nice and simple. It’s only because I wanted to simulate the actual device that I went native mqtt node. I’ve also written some test c code which also works, and this used the config I use on the mqtt node, sas token etc. So I’m a bit baffled really.