Skip to content

Commit 4ca8f3c

Browse files
authoredMar 7, 2020
Update sntp.md
+Outcomings of <nodemcu#3044>
1 parent c116d9d commit 4ca8f3c

File tree

1 file changed

+5
-0
lines changed

1 file changed

+5
-0
lines changed
 

‎docs/modules/sntp.md

+5
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,7 @@ If any sync operation fails (maybe the device is disconnected from the internet)
2727

2828
#### Parameters
2929
- `server_ip` if non-`nil`, that server is used. If `nil`, then the last contacted server is used. If there is no previous server, then the pool ntp servers are used. If the anycast server was used, then the first responding server will be saved.
30+
!!! note Per default, `nodemcu.pool.ntp.org` will be used. This is fine for our project; if you plan a scaled project, please think to defining your very own ntp server(s)!
3031
- `server1`, `server2` these are either the ip address or dns name of one or more servers to try.
3132
- `callback` if provided it will be invoked on a successful synchronization, with four parameters: seconds, microseconds, server and info. Note that when the [rtctime](rtctime.md) module is available, there is no need to explicitly call [`rtctime.set()`](rtctime.md#rtctimeset) - this module takes care of doing so internally automatically, for best accuracy. The info parameter is a table of (semi) interesting values. These are described below.
3233
- `errcallback` failure callback with two parameters. The first is an integer describing the type of error. The module automatically performs a number of retries before giving up and reporting the error. The second is a string containing supplementary information (if any). Error codes:
@@ -64,6 +65,10 @@ sntp.sync("224.0.1.1",
6465
end
6566
)
6667
```
68+
!!! attention `smtp.sync` will raise an exeption, if there's a sync attempt on the way already.
69+
70+
If you plan to call `smtp.sync` more than once (say, in boot code, and in main code later), keep in mind to do [protected](http://www.lua.org/manual/5.1/manual.html#pdf-pcall) calls!
71+
6772
#### See also
6873
[`rtctime.set()`](rtctime.md#rtctimeset)
6974

0 commit comments

Comments
 (0)
Failed to load comments.