Skip to content

Commit

Permalink
Add time_server setting to allow user to provide their own server.
Browse files Browse the repository at this point in the history
  • Loading branch information
h2zero authored and heythisisnate committed Oct 6, 2022
1 parent 29819e0 commit 7ccb923
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 2 deletions.
3 changes: 2 additions & 1 deletion src/lfs/server_settings.lua
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,8 @@ local function process(request)
endpoint_type = request.body.endpoint_type,
blink = request.body.blink,
discovery = request.body.discovery,
aws = request.body.aws
aws = request.body.aws,
time_server = request.body.time_server
}))
setVar("sensors", require("variables_build")(request.body.sensors))
setVar("actuators", require("variables_build")(request.body.actuators))
Expand Down
2 changes: 1 addition & 1 deletion src/lfs/wifi.lua
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,7 @@ local _ = tmr.create():alarm(900, tmr.ALARM_AUTO, function(t)
gpio.write(4, gpio.HIGH)
enduser_setup.stop()

sntp.sync({gw, 'time.google.com', 'pool.ntp.org'},
sntp.sync({require("settings").time_server or gw, 'time.google.com', 'pool.ntp.org'},
function(sec)
tm = rtctime.epoch2cal(sec)
print("Heap: ", node.heap(), "Current Date/Time:",
Expand Down

0 comments on commit 7ccb923

Please sign in to comment.