-
Notifications
You must be signed in to change notification settings - Fork 8
/
Copy pathinit.lua
55 lines (41 loc) · 853 Bytes
/
init.lua
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
--[[
ESP8266-remote
Trigger a camera from a smartphone connected to ESP8266 running NodeMCU.
[20150419][v1.0]
Initial release
]]
-- SET UART CONFIGURATION
uart.setup(0, 115200, 8, 0, 1, 1)
-- SET WIFI CONFIGURATION
wifi.setmode(wifi.SOFTAP)
local cfg
cfg = {
ip = "10.10.10.10",
netmask = "255.255.255.0",
gateway = "10.10.10.10"
}
wifi.ap.setip(cfg)
cfg = {
ssid = "ESP",
pwd = "12345678"
}
wifi.ap.config(cfg)
print("\r\n********************")
print("ESP IP:\r\n", wifi.ap.getip())
print("Heap:\r\n", node.heap())
print("********************")
cfg = nil
-- COMPILE LUA FILES
local files = { 'server.lua', 'filesend.lua' }
for _, f in ipairs(files) do
if file.open(f) then
file.close()
node.compile(f)
file.remove(f)
print(f, " is now compiled")
end
end
files = nil
-- START SERVER
collectgarbage()
dofile("server.lc");