MQTT client that works with Google IOT cloud


#1

Hello

We are today using paho and this MQTT wrapper: https://github.com/mangOH/MqttClient/tree/use_paho_linux_version developed by @dfrey and others to connect to our own mosquitto broker with TLS encryption.

But I’m now trying to connect to google’s mqtt bridge with TLS and JWT. But I get a socket error when trying to connect. Not sure how to investigate this further but I think this may be a clue?

Is there a known issue connecting to gcloud with sierra (WP85) and this wrapper or have someone made it work?


#2

Hi @nilsarve,
If you are still looking for a solution, you could try this option: https://github.com/nhonchu/mqttClient-for-Legato

Hope this helps


#3

Looks great. Will check it out. :grinning:


#4

Hi @NhonChu,
Did some testing today but could not connect to Google cloud platform.

First of all is there a type here?
image
Had to make it

openssl genrsa -out rsa_private.pem 2048

for google to accept my public key.

But when running

gmqtt session start
i get Failed:

Any help would be greatly appreciated!


#5

Hi @nilsarve,

Thank you for reporting the typo (2048 instead of 2018) for the key generation.

Your device passed the SSL authentication steps, however for some reason the server rejects your mqtt connection request. Could you check these points :

  • is the device communication has been allowed ?
    image

  • have you uploaded the public key certificate to Google IoT Core ? And have the app to selected the private key?

Nhon


#6

Did not build a system image but used the path option. Maybe I should try building a system image?


#7

Thanks for the info.
You don’t need to build a system image, just the app.
I’ll try on WP85 and will let you know.


#8

Hi @nilsarve,
I found the issue (side effect of memory optimization). It has been fixed, please retrieve the new mqttGeneric.h file and recompile all components.
Let me know if this solves your connection issue.
Thanks


#9

Thanks @NhonChu!
That solved it! :smiley:


#10

Hi @nilsarve,
Great :ok_hand::grinning:
Thank you for reporting this.