MQTT tutorial not compiling

Discussion to talk about software related topics only.
Post Reply
DOCelectronics
Posts: 3
Joined: Mon Jul 06, 2020 1:47 pm

MQTT tutorial not compiling

Post by DOCelectronics »

I'm setting out to design a gateway for the custom IOT network we've developed (which currently uses a laptop as a gateway). I've selected NetBurner as the best option. I'm new to NetBurner so may have missed something here but when I tried following the MQTT tutorial I have struck problems. I've downloaded all the latests tools and purchased a MODM7AE70 development kit.
User avatar
Jon
Posts: 79
Joined: Mon Feb 05, 2018 10:54 am

Re: MQTT tutorial not compiling

Post by Jon »

Hi there! I've spent a fair amount of time working with the MQTT tutorials and would be happy to help. Just to be clear, are you talking about the MQTT tutorial that uses AWS, or the tutorial that uses the Paho library?
DOCelectronics
Posts: 3
Joined: Mon Jul 06, 2020 1:47 pm

Re: MQTT tutorial not compiling

Post by DOCelectronics »

Hi Jon, Thanks for your reply, I'm not sure how that got posted, I changed my mind and went to start a support ticket. Thanks for your offer. The post is only partial. I am talking about the MQTT/AWS tutorial. When I tried to compile it I got a large number of warnings and some errors. The errors related to the SSL error codes. Some are not defined in the SSl.h file. I tried the #defines from the NetBurner SSL.h file on the website and that had a different set of defines but it still didn't compile for the same reason (but different codes). I could probably mash them together but wanted a bit of guidance on why this might be happening. Thanks.
User avatar
Jon
Posts: 79
Joined: Mon Feb 05, 2018 10:54 am

Re: MQTT tutorial not compiling

Post by Jon »

Hi DOCelectronics,

Ah! That's a great catch. We made a significant change to the SSL library in our latest 3.x toolset, which required some alterations to our error codes. I'll go through those and make the required adjustments, and then submit the changes to the repo. I'll also keep an eye out for any support tickets you submit and make sure I pick them up. =)

Kind Regards,
Jon
User avatar
Jon
Posts: 79
Joined: Mon Feb 05, 2018 10:54 am

Re: MQTT tutorial not compiling

Post by Jon »

Hi DOCElectronics,

I've updated the example on the repo. It should include the changes required to have the example built on NNDK 3.3. If you run into any issues (build or otherwise), feel free to reply here or open a support ticket.

Kind Regards,
Jon
DOCelectronics
Posts: 3
Joined: Mon Jul 06, 2020 1:47 pm

Re: MQTT tutorial not compiling

Post by DOCelectronics »

Thanks Jon,

I've downloaded the new src from the repo and the errors have gone. I don't quite have it building yet as I can't get the certificate and privatekey arrays working but I'm sure I will figure that out. BTW, I think there is a small error in the tutorial as well, the command line for compiling the certificates is given as:

compfile privatekey PRIVATE_KEY_LEN privatekey.cpp

where I think maybe it needs to be:

compfile [input file name] privatekey PRIVATE_KEY_LEN privatekey.cpp

Ditto for the certificate command line.

Thanks again.
User avatar
Jon
Posts: 79
Joined: Mon Feb 05, 2018 10:54 am

Re: MQTT tutorial not compiling

Post by Jon »

Hi DOCelectronics,

You are exactly right, thank you for pointing that out. The html characters for that weren't escaped properly, so they ended up getting absorbed into the page. It's been corrected now, and should show up properly. If you continue to have issues with the certificate, let me know and we'll get it sorted out.

Kind Regards,
Jon
User avatar
Jon
Posts: 79
Joined: Mon Feb 05, 2018 10:54 am

Re: MQTT tutorial not compiling

Post by Jon »

One more fix that will be pushed... in iot_tls_connect(), right before the call to SSL_ClientReadyCert(), you will need to add a call to SslInit(), or you will get a socket error.
Post Reply