Build your #Dashbutton & GPIOs

ABOUT THIS PROJECT

ESP8266 based #Dashbutton like devices which can send any http based notification just by a push of a button, compatible with #IFTTT Maker. That sounds like an closed shop system just to order supplies needed from one single vendor – but we can build an WiFi enabled button based on the #ESP8266 while having also access to GPIOs and an open platform to do what ever you want with a button in the brave new #IoT world. Beyond it will support the #IFTTT application and its Maker Channel but also any LAMP based DIY backend.

WHAT IS “IFTTT” ?

IFTTT is a free web-based service that allows users to create chains of simple conditional statements, called “recipes”, which are triggered based on changes to other web services such as Gmail, Facebook, Instagram, and Pinterest. IFTTT is an abbreviation of “If This Then That”

HARDWARE REQUIREMENT

  1. ESP8266 WIFI TRANSRECIEVER MODULE
  2. LIPO BATTERY 200 mah
  3. A comapct casing (optional)

SOFTWARE REQUIREMENT

  1. nodeMCU firmware

SCHEMATICS

SOURCE CODE

//(flash this code using NODE MCU)

print(‘init.lua ver 1.2’)

wifi.setmode(wifi.STATION)

print(‘set mode=STATION (mode=’..wifi.getmode()..’)’)

print(‘MAC: ‘,wifi.sta.getmac())

print(‘chip: ‘,node.chipid())

print(‘heap: ‘,node.heap())

— wifi config start

wifi.sta.config(“<YOURSSID>”,”<YOURWIFIKEY>”)

— wifi config end

wifi.sta.connect()

tmr.alarm(1, 1000, 1, function()

if wifi.sta.getip()== nil then

print(“IP unavaiable, Waiting…”)

else

tmr.stop(1)

print(“ESP8266 mode is: ” .. wifi.getmode())

print(“The module MAC address is: ” .. wifi.ap.getmac())

print(“Config done, IP is “..wifi.sta.getip())

print(“*** You’ve got 5 sec to stop timer 0 ***”)

— this wait trick before starting application makes re-flashing easier

tmr.alarm(0, 5000, 0, function()

print(“Executing lua”)

dofile(“ifttt_sw.lua”)

end)

end

end)

Advertisements

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s