projects:wifi-doorbell
no way to compare when less than two revisions
Differences
This shows you the differences between two versions of the page.
Previous revision | |||
— | projects:wifi-doorbell [2015/05/14 19:35] (current) – external edit 127.0.0.1 | ||
---|---|---|---|
Line 1: | Line 1: | ||
+ | Dzwonek do drzwi hakerspejsu zrobiony z modułu ESP8266 z odpalonym NodeMCU. | ||
+ | |||
+ | |||
+ | ==== Kod ==== | ||
+ | < | ||
+ | |||
+ | |||
+ | function wait_for_wifi_conn ( func ) | ||
+ | | ||
+ | if wifi.sta.getip ( ) == nil then | ||
+ | print (" | ||
+ | else | ||
+ | | ||
+ | | ||
+ | end | ||
+ | end) | ||
+ | end | ||
+ | |||
+ | wifi.setmode(wifi.STATION) | ||
+ | wifi.sta.config(" | ||
+ | wifi.sta.connect() | ||
+ | gpio.mode(3, | ||
+ | gpio.write(3, | ||
+ | |||
+ | wait_for_wifi_conn ( function() | ||
+ | --while wifi.sta.status() ~= 5 do | ||
+ | --tmr.delay(1000000) | ||
+ | --print(wifi.sta.status()) | ||
+ | --end | ||
+ | print(wifi.sta.getip()) | ||
+ | sk=net.createConnection(net.TCP, | ||
+ | sk: | ||
+ | sk: | ||
+ | sk: | ||
+ | sk: | ||
+ | sk: | ||
+ | end) | ||
+ | </ |
projects/wifi-doorbell.txt · Last modified: 2015/05/14 19:35 by 127.0.0.1