Tuesday, September 1, 2015

Home Automation Part 4 Mosquito v1.4 and ESP start

Now that I have some free time again it is back to work on my home automation stuff. For the past few days I have been working on this and have been slowly figuring out my problems.

  1. Programming. I bought a few esp-07 off of banggood.com for under 4 bucks a pop. While there I also bought a ftdi board so I could program them. The ftdi board works fine as a serial monitor but when it comes to programming it just doesn't work. Not sure what the problem was but I couldn't get it to work. Currently I am using an old USB to xbee board and that is working without a problem. If you are trying to program the ESPs and are having issues try a different ftdi device. 
  2. The Arduino IDE is where I have the most programming experience so I am going to stick with it. I know some people hate arduino with a burning passion but for me its simple (for the most part) and what I have the most experience with. Now in a previous post I talked about how to get an arduino with an Ethernet shield publishing and subscribing to MQTT messages. Once you have added the ESP board to the arduino board it is easy to program them as long as you ave the correct pins grounded or 3.3v See the Schematic below. But the PubSub library I was using before does not work with the ESP. Now I found this library. Now the problem with this is both of the libraries, the one I use with the Ethernet shield and the one I am now using both use pubsub. So the arduino IDE picks the one it thinks it should use which causes problems. I just removed the original one for now and have not tried the new one with the Ethernet shield. 
  3. Mosquito MQTT. With the Ethernet shield and the rpi I had no issues with the mosquito install. Now however with the new library I needed to upgrade mosquito. The code to install the new version is below.  Got the code from http://mosquitto.org/2013/01/mosquitto-debian-repository/
    wget http://repo.mosquitto.org/debian/mosquitto-repo.gpg.key
    sudo apt-key add mosquitto-repo.gpg.key
     cd /etc/apt/sources.list.d/
    sudo wget http://repo.mosquitto.org/debian/mosquitto-wheezy.list
    sudo apt-get update
    sudo apt-get install mosquitto


No comments:

Post a Comment