Data Sheet
36
Open the LuaLoader, click the “Upload File…”cho ose ESP826 6 No deMCU kit demo code
-> P18_DHT11_Temperature_OLED_Display-> TCP Server->init.lua. After the upload completed
then click “Download ” to download the init.lua file. Then Click “Upload File”, Choose
the”main.lua” in the same folder, download it.
The following, set another serial port which connect the NodeMCU (“AP mode”) and connecting ,
then click the “Upload File…” after connecting successful, choose ESP 8266 Node MCU
kit demo co de -> P18_DHT11_Temperature_OLED_Display ->DHT11-> init.lua. After the
upload completed then click “Download ” to download the init.lua file. Then Click “Upload File”,
Choose the” dht11.lua” in the same folder, download it.
TCP Serve:
-- init.lua --
--tcp server--
print("ESP8266 Server")
wifi.setmode(wifi.STATIONAP);
wifi.ap.config({ssid="test2",pwd="12345678"});
print("Server IP Address:",wifi.ap.getip())
-- Run the main file
dofile("main.lua")
-- main.lua --
function init_OLED(sda,scl) --Set up the u8glib lib
sla = 0x3c
i2c.setup(0, sda, scl, i2c.SLOW)
disp = u8g.ssd1306_128x64_i2c(sla)
disp:setFont(u8g.font_6x10)
disp:setFontRefHeightExtendedText()
disp:setDefaultForegroundColor()
disp:setFontPosTop()
end
-- Connect--
print('\nAll About Circuits main.lua\n')
init_OLED(5,6) --Run setting up
i=0
-- Start a simple http server
if srv~=nil then