Tell us about yourself!

Complete Your Profile
  • ESP8266 Web Server (Without Arduino)

    Thanks for your post- iT WORKSModified code - to work without WIFI- STANDALONE APAccessPoint with WEBSERVER (No HOME WIFI or Network Needed)I have modified the above script (init.lua) adding a few lines to make the esp into an Access point and webserver. Now with script flashed into the esp8266 with name as init.lua the ESP you will be able to connect from your browser or Mobile directly to the ESP without having to go through your HOME WIFI.This is standalone webserver and access point. You will have to connect to the ESP ACCESS POINT and then type 192.168.4.1 which is the default address of the ESP Access point. All other devices connecting to the ESP8266_xxxx Access point will be given a IP address from the ESP. print(“Ready to start soft ap”)local str=wifi.ap.getmac()...

    see more »

    Thanks for your post- iT WORKSModified code - to work without WIFI- STANDALONE APAccessPoint with WEBSERVER (No HOME WIFI or Network Needed)I have modified the above script (init.lua) adding a few lines to make the esp into an Access point and webserver. Now with script flashed into the esp8266 with name as init.lua the ESP you will be able to connect from your browser or Mobile directly to the ESP without having to go through your HOME WIFI.This is standalone webserver and access point. You will have to connect to the ESP ACCESS POINT and then type 192.168.4.1 which is the default address of the ESP Access point. All other devices connecting to the ESP8266_xxxx Access point will be given a IP address from the ESP. print(“Ready to start soft ap”)local str=wifi.ap.getmac();local ssidTemp=string.format(“%s%s%s”,string.sub(str,10,11),string.sub(str,13,14),string.sub(str,16,17));cfg={}cfg.ssid=”ESP8266_”..ssidTemp;cfg.pwd=””wifi.ap.config(cfg)wifi.sta.getip()led1 = 3led2 = 4gpio.mode(led1, gpio.OUTPUT)gpio.mode(led2, gpio.OUTPUT)srv=net.createServer(net.TCP)srv:listen(80,function(conn) conn:on(“receive”, function(client,request) local buf = “”; local _, _, method, path, vars = string.find(request, “([A-Z]+) (.+)?(.+) HTTP”); if(method == nil)then _, _, method, path = string.find(request, “([A-Z]+) (.+) HTTP”); end local _GET = {} if (vars ~= nil)then for k, v in string.gmatch(vars, “(%w+)=(%w+)&*”) do _GET[k] = v end end buf = buf..” AP WEBSERVER “; buf = buf..”GPIO0 ON OFF“; buf = buf..”GPIO2 ON OFF“; local _on,_off = “”,”” if(_GET.pin == “ON1”)then gpio.write(led1, gpio.HIGH); elseif(_GET.pin == “OFF1”)then gpio.write(led1, gpio.LOW); elseif(_GET.pin == “ON2”)then gpio.write(led2, gpio.HIGH); elseif(_GET.pin == “OFF2”)then gpio.write(led2, gpio.LOW); end client:send(buf); client:close(); collectgarbage(); end)end)Connections while Programming the ESP8266-NodeMCUESP8266 UNOVCC 3.3VCH_PD 3.3VGND GNDGPIO1 GNDTX TXRX RXConnections while Programming the ESP8266-Lua ScriptESP8266 UNOVCC 3.3VCH_PD 3.3VGND GNDGPIO1 OPENTX TXRX RX

    Thanks for your post- iT WORKSModified code - to work without WIFI- STANDALONE APAccessPoint with WEBSERVER (No HOME WIFI or Network Needed)I have modified the above script (init.lua) adding a few lines to make the esp into an Access point and webserver. Now with script flashed into the esp8266 with name as init.lua the ESP you will be able to connect from your browser or Mobile directly to the ESP without having to go through your HOME WIFI.This is standalone webserver and access point. You will have to connect to the ESP ACCESS POINT and then type 192.168.4.1 which is the default address of the ESP Access point. All other devices connecting to the ESP8266_xxxx Access point will be given a IP address from the ESP. print(“Ready to start soft ap”)local str=wifi.ap.getmac()...

    see more »

    Thanks for your post- iT WORKSModified code - to work without WIFI- STANDALONE APAccessPoint with WEBSERVER (No HOME WIFI or Network Needed)I have modified the above script (init.lua) adding a few lines to make the esp into an Access point and webserver. Now with script flashed into the esp8266 with name as init.lua the ESP you will be able to connect from your browser or Mobile directly to the ESP without having to go through your HOME WIFI.This is standalone webserver and access point. You will have to connect to the ESP ACCESS POINT and then type 192.168.4.1 which is the default address of the ESP Access point. All other devices connecting to the ESP8266_xxxx Access point will be given a IP address from the ESP. print(“Ready to start soft ap”)local str=wifi.ap.getmac();local ssidTemp=string.format(“%s%s%s”,string.sub(str,10,11),string.sub(str,13,14),string.sub(str,16,17));cfg={}cfg.ssid=”ESP8266_”..ssidTemp;cfg.pwd=””wifi.ap.config(cfg)wifi.sta.getip()led1 = 3led2 = 4gpio.mode(led1, gpio.OUTPUT)gpio.mode(led2, gpio.OUTPUT)srv=net.createServer(net.TCP)srv:listen(80,function(conn) conn:on(“receive”, function(client,request) local buf = “”; local _, _, method, path, vars = string.find(request, “([A-Z]+) (.+)?(.+) HTTP”); if(method == nil)then _, _, method, path = string.find(request, “([A-Z]+) (.+) HTTP”); end local _GET = {} if (vars ~= nil)then for k, v in string.gmatch(vars, “(%w+)=(%w+)&*”) do _GET[k] = v end end buf = buf..” AP WEBSERVER “; buf = buf..”GPIO0 ON OFF“; buf = buf..”GPIO2 ON OFF“; local _on,_off = “”,”” if(_GET.pin == “ON1”)then gpio.write(led1, gpio.HIGH); elseif(_GET.pin == “OFF1”)then gpio.write(led1, gpio.LOW); elseif(_GET.pin == “ON2”)then gpio.write(led2, gpio.HIGH); elseif(_GET.pin == “OFF2”)then gpio.write(led2, gpio.LOW); end client:send(buf); client:close(); collectgarbage(); end)end)Connections while Programming the ESP8266-NodeMCUESP8266 UNOVCC 3.3VCH_PD 3.3VGND GNDGPIO1 GNDTX TXRX RXConnections while Programming the ESP8266-Lua ScriptESP8266 UNOVCC 3.3VCH_PD 3.3VGND GNDGPIO1 OPENTX TXRX RX

    View Instructable »