Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
S
Sensor System
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Iterations
Wiki
Requirements
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Locked files
Build
Pipelines
Jobs
Pipeline schedules
Test cases
Artifacts
Deploy
Releases
Package Registry
Container Registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Service Desk
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Code review analytics
Issue analytics
Insights
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Institut für Informatik
QE Research Group
FORTE
Sensor System
Commits
01aa1fe8
Commit
01aa1fe8
authored
2 years ago
by
Zoe Pfister
Browse files
Options
Downloads
Patches
Plain Diff
force manual setting of RTCTime for testing
parent
6b731d30
No related branches found
No related tags found
5 merge requests
!39
Merge Develop into Main
,
!19
development into master
,
!17
Inital Host, initial Client
,
!10
merge serial comm and sd write into espnow
,
!8
merge sensor_readout into develop
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
host/fipy/lib/rtc_time.py
+14
-7
14 additions, 7 deletions
host/fipy/lib/rtc_time.py
host/fipy/main.py
+1
-1
1 addition, 1 deletion
host/fipy/main.py
with
15 additions
and
8 deletions
host/fipy/lib/rtc_time.py
+
14
−
7
View file @
01aa1fe8
...
@@ -3,14 +3,19 @@ from machine import RTC
...
@@ -3,14 +3,19 @@ from machine import RTC
class
RTCTime
:
class
RTCTime
:
def
__init__
(
# def __init__(
self
,
# self,
main_ntp_server
:
str
=
"
pool.ntp.org
"
,
# main_ntp_server: str = "pool.ntp.org",
backup_ntp_server
:
str
=
"
time.nist.gov
"
,
# backup_ntp_server: str = "time.nist.gov",
update_interval_seconds
:
int
=
3600
,
# update_interval_seconds: int = 3600,
):
# ):
# self.rtc = RTC()
# self._setup_ntp(main_ntp_server, backup_ntp_server, update_interval_seconds)
def
__init__
(
self
,
datetime
):
self
.
rtc
=
RTC
()
self
.
rtc
=
RTC
()
self
.
_setup_ntp
(
main_ntp_server
,
backup_ntp_server
,
update_interval_seconds
)
self
.
rtc
.
init
(
datetime
)
def
_setup_ntp
(
def
_setup_ntp
(
self
,
main_ntp_server
:
str
,
backup_ntp_server
:
str
,
update_interval_seconds
:
int
self
,
main_ntp_server
:
str
,
backup_ntp_server
:
str
,
update_interval_seconds
:
int
...
@@ -21,6 +26,8 @@ class RTCTime:
...
@@ -21,6 +26,8 @@ class RTCTime:
print
(
self
.
rtc
.
synced
())
print
(
self
.
rtc
.
synced
())
sleep
(
1
)
sleep
(
1
)
def
get_time
(
self
):
def
get_time
(
self
):
return
self
.
rtc
.
now
()
return
self
.
rtc
.
now
()
...
...
This diff is collapsed.
Click to expand it.
host/fipy/main.py
+
1
−
1
View file @
01aa1fe8
...
@@ -43,7 +43,7 @@ data.send(
...
@@ -43,7 +43,7 @@ data.send(
)
)
# data.disconnect()
# data.disconnect()
rtc_time
=
RTCTime
()
rtc_time
=
RTCTime
(
(
2014
,
5
,
1
,
4
,
13
,
0
,
0
,
0
)
)
# w = WLAN()
# w = WLAN()
# ESPNOW.init()
# ESPNOW.init()
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment