Code is here:
-- Written by WHMcClintic for Wind Speed using esp8266 with lua 5.1.4
-- use pin 4 as the input pulse width counter
cnt=0
rp=0
pin=4
du=0
st=0
gpio.mode(pin,gpio.INPUT)
function onStart()
if cnt == 0 then st=tmr.now()
end
rp=gpio.read(pin)
--print(rp)
cnt=cnt+1
if cnt == 10 then et=tmr.now()
du=et-st
ws=(60-(du/30000))
ws=ws/2
if ws<1 then ws=0
end
print("Wind Speed mph is "..ws)
cnt=0
end
end
gpio.mode(pin,gpio.INT)
gpio.trig(pin, 'both', onStart)