Chat freely about anything...

User avatar
By Michaelo
#34412 I was happily working on my project collecting data form ESP01 sensors and sending to my local ESP server...
Then I came across MQTT and thought I'd modify my set-up and use it but I'm completely lost...

Before getting to the client side (coding my ESP01's to add MQTT), I first need to set up my local server to implement MQTT but this part is causing me no end of confusion... In all honesty I don't know where to start...

To simplify things I considered using Mongoose (the pro version of which includes an MQTT broker) but that won't suit everyone so, I'd rather try to implement the broker using opensource only but I can't find any example code or tutorials...

Can anyone give me suggestions on where I should start or point me in the right direction please...
Mike
User avatar
By tkdcal
#34431
Michaelo wrote:I was happily working on my project collecting data form ESP01 sensors and sending to my local ESP server...
Then I came across MQTT and thought I'd modify my set-up and use it but I'm completely lost...


I spent a few days working this out. I left the ESP 8266 out of the equation initially just to get the server and whatever router infrastructure proven out first.

I used an old EEEPC 900 netbook as my server and installed ubuntu linux. I had a ton of difficulty with other light distributions on an old dell desktop and eventually gave up on it. I installed and configured moquitto MQTT broker (http://mosquitto.org/). I also installed the apache web server to be able to easily check if my network and stuff were all working correctly.

On my normal windows 7 PC, I installed Eclipse Paho MQTT Client (http://www.eclipse.org/paho/) in order to test out the server operation and figure out how the MQTT subscribe and publish messages work.

Once I got all the pieces in place, it all worked pretty easily. Eventually, I put the MQTT stuff from the SDK onto my ESP8266-01 and fired it up. I was able to publish stuff to the mosquitto server and see it get relayed to the Paho client on my PC. I haven't gotten around to modifying the MQTT code on the ESP to do anything useful yet, but the basic demo works like its supposed to.

Hope this helps.
tkdcal
User avatar
By Michaelo
#34440 @tkdcal, many thanks I was beginning to think I was loosing it....

I will read your post and see if I can figure out what to do next, then I will edit this post and add some more details... need to grab some sleep now and just thought I say thanks before I tie myself up in knots... ;)