I came across the IFTTT Smart Button project from Noel Portugal and decided to try it out. When I tried it on my ESP-3 it had some code issues at start due to the AP scanning that has an issue - as I always want to manually enter a SSID I removed that part. I then also wanted to modify and save the IFTTT URL so I could change it from the webpage. I also added some code to parse the URL properly.
Changes made:
- added chipID to the SSID
- added customurl field to let you enter and save another IFTTT url
- customurl saved in file
- added URL decoding and parsing
- added 5sec delay in init routine to avoid being locked out due to crash-loops
- removed the AP scanning and populating dropdown
- removed some other stuff ... but it still works ;-)
On the hardware side I used a ESP8266 ESP-3 model (flashed with latest DEV firmware nodeMCU). Added a 15k resisitor between GPIO15 and GND. As the ESP-3 doesn't have LED's you can't see if it's working. So you can either add a SMD low power LED somewhere or leave it as is. Should be better for your battery as well. For power I'm using a Lipo 3,7v battery (300mAh). So far I don't have any issues - mind you that the ESP usually prefers clean 3.3v. So I suggest adding a power regulator. Also fit your battery with a li-ion charger/monitor board to avoid draining/killing the li-ion.
I hope this helps other people in creating simple cool wifi IFTTT buttons.
For sure the code can be cleanup a bit. Suggestions welcome. Going to test this for a while and see how long the battery lasts for. In my test setup I added some additional code and LED's to see if the webserver was launched and when the IFTTT message is successfully sent.
Be sure to check Noel Portugal 's project. The idea and initial code comes from him!
Comments