I have verified the server as I am connecting to it from an embedded system as well as a data collection device running on a linux based platform. The MQTT does not connect and generates an error message. I have included a dump of the output
The early part of the stack trace here suggests that your client app has no idea how to resolve the MQTT server’s address e.g, the “GetHostByName” referenced in the Message header.
So it appears that you may have put something along the lines of server=“my.mqttserver.net” or some such in your code, but the client has no idea how to resolve it. Check that DNS knows how to get to your named MQTT server, and also check that you have your network client setup with a DNS address.
If my guesses are out in left field, well, it’s because without code to look at, it’s just that: Guessing.
Ok, so I downloaded and ran the code - it appears to work at my end. There are no exceptions thrown and outside of the application, I’m able to ping the MQTT server listed in the code as well.
Of note, what I don’t see is a debug output of “MQTT Connection changed!” as I would expect from the handler assignment. As you can see from my debug, the code makes it to the flagMqttConnected = true statement without error, however, it takes about a minute for the code to get that far which is in my book a sign of problems.
What we can confirm:
The MQTT server name is being resolved.
A connection is at least being attempted.
What we don’t know:
Is it my LAN Router resolving the MQTT server or is it the settings on the FEZ Duino? (No, I don’t want to set my router to the different DNS as it will disrupt a few other things on my network.)
Is the username/pass correct for the test session?
Is it finally connecting at some point (I quit waiting after about 10 mins.)
So from your original exception, two things are needed to clear up:
Change your DNS primary and secondary to something more common - those 220.127.116.11 and .76 pairs are at least here in the US, off the beaten path as it were.
Confirm your own router/gateway that you’re working from can ping the named MQTT server. You should open a CMD prompt and type: nslookup killerbunnies.strongarmtech.io
Make sure that the server can be found at your end (its found at mine.)
Good luck sir!
Screen shots: (Code execution made it to and waiting at line 76)
As far as the MQTT server credentials, I have three other devices, 2 RaspberryPI based and 1 bare metal, all three have no issue with connecting and transferring data. I’ll play around with this some more and see if I can figure out what is going on. I’m going to run wireshark next to sniff out the transactions.
So I added code to verify address by manually looking up the address, it was there. No luck. Modified code to use Adafruit.IO as the source, downloaded the certificate, changed the code to support the same and still no connection. Code is modeled after your app note and C# for IOT and Robotics PDF book.