-
1Step 1
WARNING.... WARNING... WARNING...WARNING...WARNING.... WARNING... WARNING...WARNING..
THE ESP 8266 is a 3.3v device. DONT connect VCC or any of the pins to a 5v source or it will damage the device.
WARNING.... WARNING... WARNING...WARNING...WARNING.... WARNING... WARNING...WARNING..
Before you can start building your project you will need some esp8266 tools and firmware. These tools are windows specific tools, but there are linux variants available.
You need to be able to flash new firmware to the chip., To do that I recommend espflasher available at https://github.com/nodemcu/nodemcu-firmware
For loading the actually wifi detection software onto the esp8266 wifi board I would recommend ESPlorer available from github. https://github.com/4refr0nt/ESPlorer
-
2Step 2
-
3Step 3
Here is the complete schematic. The ftdi and lipo charger are optional parts but included for completeness.
NOTE!!! I didnt have a good fritizing ams117 part so I used the more generic 78xx regulator. The schematic shows a single part but I used a ebay module, see parts list. again any 3.3v regulator will do.
-
4Step 4
Here is the LUA code need to make this work. NOTE, you can run this on the stock esp8266 firmware you must upgrade to the LUA firmware.
-- Gary Sanders N8EMR
-- Use the code as needed. Bits and pieces snarfed
-- from various online sources.
-- Find an open AP and turn on GPIO 2
-- To see debug or any output to the com port set debug
-- equal to 1. Otherwise leave set to 0.
debug=0
function gpio0_on()
pin=3
gpio.mode(pin,gpio.OUTPUT)
gpio.write(pin,gpio.HIGH)
if debug==1 then print("gpio 0 on") end
end
function gpio2_on()
pin=4
gpio.mode(pin,gpio.OUTPUT)
gpio.write(pin,gpio.HIGH)
if debug==1 then print("gpio 2 on") end
end
function gpio0_off()
pin=3
gpio.mode(pin,gpio.OUTPUT)
gpio.write(pin,gpio.LOW)
if debug==1 then print("gpio 0 off") end
end
function gpio2_off()
pin=4
gpio.mode(pin,gpio.OUTPUT)
gpio.write(pin,gpio.LOW)
if debug==1 then print("gpio 2 off") end
end
function checkap()
gpio2_off()
gpio0_off()
gpio0_on()
-- no ap found
ap=0
function listap(t)
for k,v in pairs(t) do
--print(k.." : "..v)
--print(v)
a=string.sub (v, 0 , 1 )
if debug==1 then print(a) end
if a=="0" then
print("Found open node" , k)
-- found at least one open Ap..
gpio2_on()
gpio0_off()
else
print ("No open nodes found")
end
end
end
wifi.sta.getap(listap)
end
-- turn off LED's until first pass happens.
gpio0_off()
gpio2_off()
-- send data every X ms to thing speak
tmr.alarm(0, 10000, 1, function() checkap() end )
Discussions
Become a Hackaday.io Member
Create an account to leave a comment. Already have an account? Log In.