Difference between revisions of "Component: Real Time Clock (ESP32) (Storage)"

From Flowcode Help
Jump to navigationJump to search
Line 1: Line 1:
 
+
{| style="width:50%"
 
 
{| width="50%"
 
 
|-
 
|-
| width="20%" style="color: gray;" | Author
+
| width="20%" style="color:gray;" | Author
 
| Matrix TSL
 
| Matrix TSL
 
|-
 
|-
| width="20%" style="color: gray;" | Version
+
| width="20%" style="color:gray;" | Version
| 1.0 (Release)
+
| 1.0
 
|-
 
|-
| width="20%" style="color: gray;" | Category
+
| width="20%" style="color:gray;" | Category
 
| Storage
 
| Storage
 
|}
 
|}
  
  
 +
==Real Time Clock (ESP32) component==
 +
Allows an ESP32 device to act as a RTC with NTP type server synchronisation. Requires a WIFI network connection with internet access to synchronise. Provides simulation using local PC system time.
 +
 +
==Detailed description==
  
==[[File:Component Icon 920175dd_ace8_49e2_9208_ec548563c9c0.png|Image]] Real Time Clock (ESP32) component==
+
''No detailed description exists yet for this component''
Allows an ESP32 device to act as a RTC with NTP type server synchronisation.
 
Requires a WIFI network connection with internet access to synchronise.
 
Provides simulation using local PC system time.
 
  
 
==Examples==
 
==Examples==
 +
 +
  
 
A simple example that shows how to connect the ESP device to a network and synchronise the internal clock with an internet based NTP time server every hour.
 
A simple example that shows how to connect the ESP device to a network and synchronise the internal clock with an internet based NTP time server every hour.
Line 36: Line 37:
 
==Downloadable macro reference==
 
==Downloadable macro reference==
  
===<span style="font-weight: normal;"><u><tt>GetDateString</tt></u></span>===
+
{| class="wikitable" style="width:60%; background-color:#FFFFFF;"
Collects the current date and returns it as a string.
+
|-
 +
| width="10%" align="center" style="background-color:#D8C9D8;" align="center" | [[File:Fc9-comp-macro.png]]
 +
| width="90%" style="background-color:#D8C9D8; color:#4B008D;" | '''GetDateString'''
 +
|-
 +
| colspan="2" | Collects the current date and returns it as a string. e.g. "DD/MM/YY" or "MM/DD/YY"&nbsp;
 +
|-
 +
|-
 +
| width="10%" align="center" | [[File:]] -
 +
| width="90%" | USFormat
 +
|-
 +
| colspan="2" | Select date format: 0=DD/MM/YY, 1=MM/DD/YY&nbsp;
 +
|-
 +
| width="10%" align="center" style="border-top: 2px solid #000;" | [[File:Fc9-string-icon.png]] - STRING
 +
| width="90%" style="border-top: 2px solid #000;" | ''Return''
 +
|}
  
e.g. "DD/MM/YY" or "MM/DD/YY"
 
  
'''Parameters'''
+
{| class="wikitable" style="width:60%; background-color:#FFFFFF;"
 +
|-
 +
| width="10%" align="center" style="background-color:#D8C9D8;" align="center" | [[File:Fc9-comp-macro.png]]
 +
| width="90%" style="background-color:#D8C9D8; color:#4B008D;" | '''GetHours'''
 +
|-
 +
| colspan="2" | Collects the current hour as a numeric value in the range of 0 - 23.&nbsp;
 +
|-
 +
|-
 +
| width="10%" align="center" style="border-top: 2px solid #000;" | [[File:Fc9-u8-icon.png]] - BYTE
 +
| width="90%" style="border-top: 2px solid #000;" | ''Return''
 +
|}
  
:[[Variable Types|BOOL]] ''USFormat''
 
::Select date format: 0=DD/MM/YY, 1=MM/DD/YY
 
  
 +
{| class="wikitable" style="width:60%; background-color:#FFFFFF;"
 +
|-
 +
| width="10%" align="center" style="background-color:#D8C9D8;" align="center" | [[File:Fc9-comp-macro.png]]
 +
| width="90%" style="background-color:#D8C9D8; color:#4B008D;" | '''GetSecs'''
 +
|-
 +
| colspan="2" | Collects the current second as a numeric value in the range of 0 - 59.&nbsp;
 +
|-
 +
|-
 +
| width="10%" align="center" style="border-top: 2px solid #000;" | [[File:Fc9-u8-icon.png]] - BYTE
 +
| width="90%" style="border-top: 2px solid #000;" | ''Return''
 +
|}
  
'''Return value'''
 
  
:[[Variable Types|STRING]]
+
{| class="wikitable" style="width:60%; background-color:#FFFFFF;"
 +
|-
 +
| width="10%" align="center" style="background-color:#D8C9D8;" align="center" | [[File:Fc9-comp-macro.png]]
 +
| width="90%" style="background-color:#D8C9D8; color:#4B008D;" | '''GetYear'''
 +
|-
 +
| colspan="2" | Collects the year as a numeric value in the range of 0 - 99.&nbsp;
 +
|-
 +
|-
 +
| width="10%" align="center" style="border-top: 2px solid #000;" | [[File:Fc9-u8-icon.png]] - BYTE
 +
| width="90%" style="border-top: 2px solid #000;" | ''Return''
 +
|}
  
  
===<span style="font-weight: normal;"><u><tt>GetHours</tt></u></span>===
+
{| class="wikitable" style="width:60%; background-color:#FFFFFF;"
''<span style="color:red;">No additional information</span>''
+
|-
 +
| width="10%" align="center" style="background-color:#D8C9D8;" align="center" | [[File:Fc9-comp-macro.png]]
 +
| width="90%" style="background-color:#D8C9D8; color:#4B008D;" | '''QueryTimeServer'''
 +
|-
 +
| colspan="2" | Attempt to collect the local time from the selected time server. The ESP WIFI must be connected to a network with internet to allow this to work. Returns true if the time server synchronised correctly with the ESP.&nbsp;
 +
|-
 +
|-
 +
| width="10%" align="center" style="border-top: 2px solid #000;" | [[File:]] -
 +
| width="90%" style="border-top: 2px solid #000;" | ''Return''
 +
|}
  
  
 +
{| class="wikitable" style="width:60%; background-color:#FFFFFF;"
 +
|-
 +
| width="10%" align="center" style="background-color:#D8C9D8;" align="center" | [[File:Fc9-comp-macro.png]]
 +
| width="90%" style="background-color:#D8C9D8; color:#4B008D;" | '''ReadTime'''
 +
|-
 +
| colspan="2" | &nbsp;
 +
|-
 +
|-
 +
| width="10%" align="center" | [[File:Fc9-u8-icon.png]] - BYTE
 +
| width="90%" | Unit
 +
|-
 +
| colspan="2" | &nbsp;
 +
|-
 +
| width="10%" align="center" style="border-top: 2px solid #000;" | [[File:Fc9-u8-icon.png]] - BYTE
 +
| width="90%" style="border-top: 2px solid #000;" | ''Return''
 +
|}
  
'''Parameters'''
 
  
:''This macro has no parameters''
+
{| class="wikitable" style="width:60%; background-color:#FFFFFF;"
 +
|-
 +
| width="10%" align="center" style="background-color:#D8C9D8;" align="center" | [[File:Fc9-comp-macro.png]]
 +
| width="90%" style="background-color:#D8C9D8; color:#4B008D;" | '''SetTime'''
 +
|-
 +
| colspan="2" | Manually sets the current time. Useful for when WIFI / NTP commnication is not available.&nbsp;
 +
|-
 +
|-
 +
| width="10%" align="center" | [[File:Fc9-u8-icon.png]] - BYTE
 +
| width="90%" | Hour
 +
|-
 +
| colspan="2" | Hour ranging from 0 to 23&nbsp;
 +
|-
 +
| width="10%" align="center" | [[File:Fc9-u8-icon.png]] - BYTE
 +
| width="90%" | Min
 +
|-
 +
| colspan="2" | Minute ranging from 0 to 59&nbsp;
 +
|-
 +
| width="10%" align="center" | [[File:Fc9-u8-icon.png]] - BYTE
 +
| width="90%" | Sec
 +
|-
 +
| colspan="2" | Second ranging from 0 to 59&nbsp;
 +
|-
 +
| width="10%" align="center" style="border-top: 2px solid #000;" | [[File:Fc9-void-icon.png]] - VOID
 +
| width="90%" style="border-top: 2px solid #000;" | ''Return''
 +
|}
  
  
'''Return value'''
+
{| class="wikitable" style="width:60%; background-color:#FFFFFF;"
 +
|-
 +
| width="10%" align="center" style="background-color:#D8C9D8;" align="center" | [[File:Fc9-comp-macro.png]]
 +
| width="90%" style="background-color:#D8C9D8; color:#4B008D;" | '''GetMins'''
 +
|-
 +
| colspan="2" | Collects the current minute as a numeric value in the range of 0 - 59.&nbsp;
 +
|-
 +
|-
 +
| width="10%" align="center" style="border-top: 2px solid #000;" | [[File:Fc9-u8-icon.png]] - BYTE
 +
| width="90%" style="border-top: 2px solid #000;" | ''Return''
 +
|}
  
:[[Variable Types|BYTE]]
 
  
 +
{| class="wikitable" style="width:60%; background-color:#FFFFFF;"
 +
|-
 +
| width="10%" align="center" style="background-color:#D8C9D8;" align="center" | [[File:Fc9-comp-macro.png]]
 +
| width="90%" style="background-color:#D8C9D8; color:#4B008D;" | '''GetTimeString'''
 +
|-
 +
| colspan="2" | Collects the current time and returns it as a string. e.g. "HH:MM" or "HH:MM:SS"&nbsp;
 +
|-
 +
|-
 +
| width="10%" align="center" | [[File:]] -
 +
| width="90%" | IncludeSeconds
 +
|-
 +
| colspan="2" | 0=Dont Include Seconds, 1=Include Seconds in the String&nbsp;
 +
|-
 +
| width="10%" align="center" style="border-top: 2px solid #000;" | [[File:Fc9-string-icon.png]] - STRING
 +
| width="90%" style="border-top: 2px solid #000;" | ''Return''
 +
|}
  
===<span style="font-weight: normal;"><u><tt>GetSecs</tt></u></span>===
 
''<span style="color:red;">No additional information</span>''
 
  
 +
{| class="wikitable" style="width:60%; background-color:#FFFFFF;"
 +
|-
 +
| width="10%" align="center" style="background-color:#D8C9D8;" align="center" | [[File:Fc9-comp-macro.png]]
 +
| width="90%" style="background-color:#D8C9D8; color:#4B008D;" | '''ReadDate'''
 +
|-
 +
| colspan="2" | &nbsp;
 +
|-
 +
|-
 +
| width="10%" align="center" | [[File:Fc9-u8-icon.png]] - BYTE
 +
| width="90%" | Unit
 +
|-
 +
| colspan="2" | &nbsp;
 +
|-
 +
| width="10%" align="center" style="border-top: 2px solid #000;" | [[File:Fc9-u8-icon.png]] - BYTE
 +
| width="90%" style="border-top: 2px solid #000;" | ''Return''
 +
|}
  
  
'''Parameters'''
+
{| class="wikitable" style="width:60%; background-color:#FFFFFF;"
 +
|-
 +
| width="10%" align="center" style="background-color:#D8C9D8;" align="center" | [[File:Fc9-comp-macro.png]]
 +
| width="90%" style="background-color:#D8C9D8; color:#4B008D;" | '''SetDate'''
 +
|-
 +
| colspan="2" | Manually sets the current date. Useful for when WIFI / NTP commnication is not available.&nbsp;
 +
|-
 +
|-
 +
| width="10%" align="center" | [[File:Fc9-u8-icon.png]] - BYTE
 +
| width="90%" | Date
 +
|-
 +
| colspan="2" | Day of the month ranging from 1 to 31&nbsp;
 +
|-
 +
| width="10%" align="center" | [[File:Fc9-u8-icon.png]] - BYTE
 +
| width="90%" | Month
 +
|-
 +
| colspan="2" | Month ranging from 1 to 12&nbsp;
 +
|-
 +
| width="10%" align="center" | [[File:Fc9-u8-icon.png]] - BYTE
 +
| width="90%" | Year
 +
|-
 +
| colspan="2" | Year ranging from 0 to 99&nbsp;
 +
|-
 +
| width="10%" align="center" style="border-top: 2px solid #000;" | [[File:Fc9-void-icon.png]] - VOID
 +
| width="90%" style="border-top: 2px solid #000;" | ''Return''
 +
|}
  
:''This macro has no parameters''
 
  
 +
{| class="wikitable" style="width:60%; background-color:#FFFFFF;"
 +
|-
 +
| width="10%" align="center" style="background-color:#D8C9D8;" align="center" | [[File:Fc9-comp-macro.png]]
 +
| width="90%" style="background-color:#D8C9D8; color:#4B008D;" | '''GetDate'''
 +
|-
 +
| colspan="2" | Collects the day of the month as a numeric value in the range of 1 - 31.&nbsp;
 +
|-
 +
|-
 +
| width="10%" align="center" style="border-top: 2px solid #000;" | [[File:Fc9-u8-icon.png]] - BYTE
 +
| width="90%" style="border-top: 2px solid #000;" | ''Return''
 +
|}
  
'''Return value'''
 
  
:[[Variable Types|BYTE]]
+
{| class="wikitable" style="width:60%; background-color:#FFFFFF;"
 +
|-
 +
| width="10%" align="center" style="background-color:#D8C9D8;" align="center" | [[File:Fc9-comp-macro.png]]
 +
| width="90%" style="background-color:#D8C9D8; color:#4B008D;" | '''SetTimeServer'''
 +
|-
 +
| colspan="2" | Overwrites the default time server setting allowing for multiple time servers to be queried.&nbsp;
 +
|-
 +
|-
 +
| width="10%" align="center" | [[File:Fc9-string-icon.png]] - STRING
 +
| width="90%" | TimeServer
 +
|-
 +
| colspan="2" | e.g. "pool.ntp.org"&nbsp;
 +
|-
 +
| width="10%" align="center" style="border-top: 2px solid #000;" | [[File:Fc9-void-icon.png]] - VOID
 +
| width="90%" style="border-top: 2px solid #000;" | ''Return''
 +
|}
  
  
===<span style="font-weight: normal;"><u><tt>GetYear</tt></u></span>===
+
{| class="wikitable" style="width:60%; background-color:#FFFFFF;"
Gets the current month as a number 1 - 12
+
|-
 +
| width="10%" align="center" style="background-color:#D8C9D8;" align="center" | [[File:Fc9-comp-macro.png]]
 +
| width="90%" style="background-color:#D8C9D8; color:#4B008D;" | '''GetMonth'''
 +
|-
 +
| colspan="2" | Collects the month as a numeric value in the range of 1 - 12.&nbsp;
 +
|-
 +
|-
 +
| width="10%" align="center" style="border-top: 2px solid #000;" | [[File:Fc9-u8-icon.png]] - BYTE
 +
| width="90%" style="border-top: 2px solid #000;" | ''Return''
 +
|}
  
'''Parameters'''
 
  
:''This macro has no parameters''
+
{| class="wikitable" style="width:60%; background-color:#FFFFFF;"
 +
|-
 +
| width="10%" align="center" style="background-color:#D8C9D8;" align="center" | [[File:Fc9-comp-macro.png]]
 +
| width="90%" style="background-color:#D8C9D8; color:#4B008D;" | '''Initialise'''
 +
|-
 +
| colspan="2" | Configures the timeserver variable as well as sets the timezone offset in seconds.&nbsp;
 +
|-
 +
|-
 +
| width="10%" align="center" style="border-top: 2px solid #000;" | [[File:Fc9-void-icon.png]] - VOID
 +
| width="90%" style="border-top: 2px solid #000;" | ''Return''
 +
|}
  
  
'''Return value'''
+
{| class="wikitable" style="width:60%; background-color:#FFFFFF;"
 +
|-
 +
| width="10%" align="center" style="background-color:#D8C9D8;" align="center" | [[File:Fc9-comp-macro.png]]
 +
| width="90%" style="background-color:#D8C9D8; color:#4B008D;" | '''SetUTCOffset'''
 +
|-
 +
| colspan="2" | Allows the UTC Offset to be defined in seconds. e.g. for BST use 3600 or for UTC+2 use 7200 or for UTC-2 use -7200&nbsp;
 +
|-
 +
|-
 +
| width="10%" align="center" | [[File:]] -
 +
| width="90%" | UTCOffset
 +
|-
 +
| colspan="2" | Time offset in seconds&nbsp;
 +
|-
 +
| width="10%" align="center" style="border-top: 2px solid #000;" | [[File:Fc9-void-icon.png]] - VOID
 +
| width="90%" style="border-top: 2px solid #000;" | ''Return''
 +
|}
  
:[[Variable Types|BYTE]]
 
  
 +
{| class="wikitable" style="width:60%; background-color:#FFFFFF;"
 +
|-
 +
| width="10%" align="center" style="background-color:#D8C9D8;" align="center" | [[File:Fc9-comp-macro.png]]
 +
| width="90%" style="background-color:#D8C9D8; color:#4B008D;" | '''Initialise'''
 +
|-
 +
| colspan="2" | Configures each matching sensor on the bus with the specified conversion bits.&nbsp;
 +
|-
 +
|-
 +
| width="10%" align="center" style="border-top: 2px solid #000;" | [[File:Fc9-void-icon.png]] - VOID
 +
| width="90%" style="border-top: 2px solid #000;" | ''Return''
 +
|}
  
===<span style="font-weight: normal;"><u><tt>QueryTimeServer</tt></u></span>===
 
Attempt to collect the local time from the selected time server.
 
 
The ESP WIFI must be connected to a network with internet to allow this to work.
 
 
Returns true if the time server synchronised correctly with the ESP.
 
 
'''Parameters'''
 
 
:''This macro has no parameters''
 
  
 
'''Return value'''
 
 
:[[Variable Types|BOOL]] : Returns true if the operation is a success, else false
 
 
 
===<span style="font-weight: normal;"><u><tt>GetMins</tt></u></span>===
 
''<span style="color:red;">No additional information</span>''
 
 
 
 
'''Parameters'''
 
 
:''This macro has no parameters''
 
 
 
'''Return value'''
 
 
:[[Variable Types|BYTE]]
 
 
 
===<span style="font-weight: normal;"><u><tt>GetTimeString</tt></u></span>===
 
Collects the current time and returns it as a string.
 
 
e.g. "HH:MM" or "HH:MM:SS"
 
 
'''Parameters'''
 
 
:[[Variable Types|BOOL]] ''IncludeSeconds''
 
::0=Dont Include Seconds, 1=Include Seconds in the String
 
 
 
'''Return value'''
 
 
:[[Variable Types|STRING]]
 
 
 
===<span style="font-weight: normal;"><u><tt>GetDate</tt></u></span>===
 
''<span style="color:red;">No additional information</span>''
 
 
 
 
'''Parameters'''
 
 
:''This macro has no parameters''
 
 
 
'''Return value'''
 
 
:[[Variable Types|BYTE]]
 
 
 
===<span style="font-weight: normal;"><u><tt>SetTimeServer</tt></u></span>===
 
Overwrites the default time server setting allowing for multiple time servers to be queried.
 
 
'''Parameters'''
 
 
:[[Variable Types|<- STRING]] ''TimeServer''
 
::e.g. "pool.ntp.org"
 
::''This parameter may be returned back to the caller''
 
 
 
'''Return value'''
 
 
:''This call does not return a value''
 
 
 
===<span style="font-weight: normal;"><u><tt>GetMonth</tt></u></span>===
 
Gets the current month as a number 1 - 12
 
 
'''Parameters'''
 
 
:''This macro has no parameters''
 
 
 
'''Return value'''
 
 
:[[Variable Types|BYTE]]
 
 
 
===<span style="font-weight: normal;"><u><tt>Initialise</tt></u></span>===
 
Configures the timeserver variable as well as sets the timezone offset in seconds.
 
 
'''Parameters'''
 
 
:''This macro has no parameters''
 
 
 
'''Return value'''
 
 
:''This call does not return a value''
 
 
 
===<span style="font-weight: normal;"><u><tt>SetUTCOffset</tt></u></span>===
 
Allows the UTC Offset to be defined in seconds.
 
 
e.g. for BST use 3600 or for UTC+2 use 7200 or for UTC-2 use -7200
 
 
'''Parameters'''
 
 
:[[Variable Types|LONG]] ''UTCOffset''
 
::Time offset in seconds
 
 
 
'''Return value'''
 
 
:''This call does not return a value''
 
 
 
 
==Simulation macro reference==
 
 
''This component does not contain any simulation macros''
 
  
  
 
==Property reference==
 
==Property reference==
<span style="font-weight: normal;"><u>Time Server</u></span>
 
  
This property is of type ''Line of text'' and can be referenced with the variable name ''TimeServer''.
+
{| class="wikitable" style="width:60%; background-color:#FFFFFF;"
 
+
|-
Default time server URL.
+
| width="10%" align="center" style="background-color:#D8C9D8;" | [[File:Fc9-prop-icon.png]]
 
+
| width="90%" style="background-color:#D8C9D8; color:#4B008D;" | '''Properties'''  
Set as part of the initialise macro.
+
|-
 
+
|-
Can be overridden using the SetTimeServer macro.
+
| width="10%" align="center" | [[File:Fc9-type-10-icon.png]]
 
+
| width="90%" | Time Server
<span style="font-weight: normal;"><u>UTC Offset</u></span>
+
|-
 
+
| colspan="2" | Default time server URL. Set as part of the initialise macro. Can be overridden using the SetTimeServer macro.&nbsp;
This property is of type ''Unsigned integer'' and can be referenced with the variable name ''GMTOff''.
+
|-
 
+
| width="10%" align="center" | [[File:Fc9-type-21-icon.png]]
Offset in seconds from UTC.
+
| width="90%" | UTC Offset
 
+
|-
Set as part of the initialise macro.
+
| colspan="2" | Offset in seconds from UTC. Set as part of the initialise macro. Can be overridden using the SetUTCOffset macro.&nbsp;
 
+
|-
Can be overridden using the SetUTCOffset macro.
+
| width="10%" align="center" | [[File:Fc9-type-21-icon.png]]
 
+
| width="90%" | Number of Retries
<span style="font-weight: normal;"><u>Number of Retries</u></span>
+
|-
 
+
| colspan="2" | Sets the number of retries to connect to the SNTP server before giving up&nbsp;
This property is of type ''Unsigned integer'' and can be referenced with the variable name ''NumRetries''.
+
|-
 
+
| width="10%" align="center" style="background-color:#D8C9D8;" | [[File:Fc9-conn-icon.png]]
Sets the number of retries to connect to the SNTP server before giving up
+
| width="90%" style="background-color:#D8C9D8; color:#4B008D;" | '''Connections'''
 +
|-
 +
|-
 +
| width="10%" align="center" style="background-color:#D8C9D8;" | [[File:Fc9-conn-icon.png]]
 +
| width="90%" style="background-color:#D8C9D8; color:#4B008D;" | '''Simulations'''
 +
|-
 +
|}

Revision as of 20:58, 16 November 2021

Author Matrix TSL
Version 1.0
Category Storage


Real Time Clock (ESP32) component

Allows an ESP32 device to act as a RTC with NTP type server synchronisation. Requires a WIFI network connection with internet access to synchronise. Provides simulation using local PC system time.

Detailed description

No detailed description exists yet for this component

Examples

A simple example that shows how to connect the ESP device to a network and synchronise the internal clock with an internet based NTP time server every hour.

FC6 Icon.png ESP32 RTC NTP Example


The internal clock can drift over time and so it is important to sync regularily with the NTP time server.


For low power operations or when internet connectivity may be intermittent a 32.768KHz crystal can be used with the ESP32 device to improve the internal clock accuracy over time.

The crystal is fitted between pins IO32 and IO33 and must have 12pF capacitors to ground. The crystal must also be enabled by editing the sdkconfig file in the project compilation directory.

Downloadable macro reference

Fc9-comp-macro.png GetDateString
Collects the current date and returns it as a string. e.g. "DD/MM/YY" or "MM/DD/YY" 
[[File:]] - USFormat
Select date format: 0=DD/MM/YY, 1=MM/DD/YY 
Fc9-string-icon.png - STRING Return


Fc9-comp-macro.png GetHours
Collects the current hour as a numeric value in the range of 0 - 23. 
Fc9-u8-icon.png - BYTE Return


Fc9-comp-macro.png GetSecs
Collects the current second as a numeric value in the range of 0 - 59. 
Fc9-u8-icon.png - BYTE Return


Fc9-comp-macro.png GetYear
Collects the year as a numeric value in the range of 0 - 99. 
Fc9-u8-icon.png - BYTE Return


Fc9-comp-macro.png QueryTimeServer
Attempt to collect the local time from the selected time server. The ESP WIFI must be connected to a network with internet to allow this to work. Returns true if the time server synchronised correctly with the ESP. 
[[File:]] - Return


Fc9-comp-macro.png ReadTime
 
Fc9-u8-icon.png - BYTE Unit
 
Fc9-u8-icon.png - BYTE Return


Fc9-comp-macro.png SetTime
Manually sets the current time. Useful for when WIFI / NTP commnication is not available. 
Fc9-u8-icon.png - BYTE Hour
Hour ranging from 0 to 23 
Fc9-u8-icon.png - BYTE Min
Minute ranging from 0 to 59 
Fc9-u8-icon.png - BYTE Sec
Second ranging from 0 to 59 
Fc9-void-icon.png - VOID Return


Fc9-comp-macro.png GetMins
Collects the current minute as a numeric value in the range of 0 - 59. 
Fc9-u8-icon.png - BYTE Return


Fc9-comp-macro.png GetTimeString
Collects the current time and returns it as a string. e.g. "HH:MM" or "HH:MM:SS" 
[[File:]] - IncludeSeconds
0=Dont Include Seconds, 1=Include Seconds in the String 
Fc9-string-icon.png - STRING Return


Fc9-comp-macro.png ReadDate
 
Fc9-u8-icon.png - BYTE Unit
 
Fc9-u8-icon.png - BYTE Return


Fc9-comp-macro.png SetDate
Manually sets the current date. Useful for when WIFI / NTP commnication is not available. 
Fc9-u8-icon.png - BYTE Date
Day of the month ranging from 1 to 31 
Fc9-u8-icon.png - BYTE Month
Month ranging from 1 to 12 
Fc9-u8-icon.png - BYTE Year
Year ranging from 0 to 99 
Fc9-void-icon.png - VOID Return


Fc9-comp-macro.png GetDate
Collects the day of the month as a numeric value in the range of 1 - 31. 
Fc9-u8-icon.png - BYTE Return


Fc9-comp-macro.png SetTimeServer
Overwrites the default time server setting allowing for multiple time servers to be queried. 
Fc9-string-icon.png - STRING TimeServer
e.g. "pool.ntp.org" 
Fc9-void-icon.png - VOID Return


Fc9-comp-macro.png GetMonth
Collects the month as a numeric value in the range of 1 - 12. 
Fc9-u8-icon.png - BYTE Return


Fc9-comp-macro.png Initialise
Configures the timeserver variable as well as sets the timezone offset in seconds. 
Fc9-void-icon.png - VOID Return


Fc9-comp-macro.png SetUTCOffset
Allows the UTC Offset to be defined in seconds. e.g. for BST use 3600 or for UTC+2 use 7200 or for UTC-2 use -7200 
[[File:]] - UTCOffset
Time offset in seconds 
Fc9-void-icon.png - VOID Return


Fc9-comp-macro.png Initialise
Configures each matching sensor on the bus with the specified conversion bits. 
Fc9-void-icon.png - VOID Return



Property reference

Fc9-prop-icon.png Properties
Fc9-type-10-icon.png Time Server
Default time server URL. Set as part of the initialise macro. Can be overridden using the SetTimeServer macro. 
Fc9-type-21-icon.png UTC Offset
Offset in seconds from UTC. Set as part of the initialise macro. Can be overridden using the SetUTCOffset macro. 
Fc9-type-21-icon.png Number of Retries
Sets the number of retries to connect to the SNTP server before giving up 
Fc9-conn-icon.png Connections
Fc9-conn-icon.png Simulations