Send and Receive MQTT data

MQTT

I made a post last year on how I was finally able to get the ESP to send MQTT data. I had forgotten all about that when I was able to flash the chips again, so I started digging for how to do it. I basically came across the same code somewhere else (can’t remember where), but this time I was able to get send and receiving to work. Decided to share. Once uploaded to the ESP you can see the printed results in the buffer window (I use ESPlorer). Code is below.