Monday 23 January 2017

Getting Started With ESP EASY

EasyEsp is a framework for IOT for esp8266 and includes support for among others the nodemcu board.

We first need to setup the Arduino IDE for esp support and load the firmware. There is a great guide at http://www.letscontrolit.com/wiki/index.php/Tutorial_Arduino_Firmware_Upload

Now the firmware is loaded we need to restart the esp to load the defaults. so just unplugg wait a few seconds and reconnect it. Now you should have a new Wifi network avalible named configesp connect to it use the password wpakey



Nodemcu pinout



Add your wifi connection and wait untill get the wifi connection confirmation. You now have the ip adress to.


Choose the esp Access point

Select or enter ssd and password



Wifi ok, now the ESP EASY AP point is down. Windows should now reconnect to your default WIFI. Wait until it's connected then you click the proceed to main config link.

Enter the ip and credentials to your mqtt server and hit enter.



Now you can connect some leds to nodemcu like
I tested with 3 leds(blue, yellow and red) Connect the leds(with 220Ohms resistors) to D0,D1,D2. If you dont know now to connect it see this guide : http://www.instructables.com/id/Basic-Arduino-Tutorials-01-Blinking-LED/

When everything is connected we can start testing with :
mosquitto_pub -t '/<<yournodename>>/gpio/05' -m '1'

If everything is wired correctly the LED on gpio should light up. if you change the '1' to '0' it will stop shining.

You have to remeber to use the gpio pinnumbers not the nodemcu names(D0,D1,D2 etc)

Now the cool part. Integrate it with Home Assistant.






Notes:
Reset wifi on the esp : python esptool.py -p com6 erase_flash or upload a scetch with WiFi.disconnect(); in the setup section.







No comments:

Post a Comment