File tree Expand file tree Collapse file tree 1 file changed +10
-2
lines changed Expand file tree Collapse file tree 1 file changed +10
-2
lines changed Original file line number Diff line number Diff line change @@ -56,6 +56,7 @@ import machine
56
56
from machine import RTC
57
57
import pycom
58
58
59
+ print (' \n Starting LoRaWAN concentrator' )
59
60
# Disable Hearbeat
60
61
pycom.heartbeat(False )
61
62
@@ -75,19 +76,26 @@ def machine_cb (arg):
75
76
# register callback function
76
77
machine.callback(trigger = (machine.PYGATE_START_EVT | machine.PYGATE_STOP_EVT | machine.PYGATE_ERROR_EVT ), handler = machine_cb)
77
78
79
+ print (' Connecting to WiFi...' , end = ' ' )
78
80
# Connect to a Wifi Network
79
81
wlan = WLAN(mode = WLAN .STA )
80
82
wlan.connect(ssid = ' <SSID>' , auth = (WLAN .WPA2 , " <PASSWORD>" ))
81
83
82
84
while not wlan.isconnected():
85
+ print (' .' , end = ' ' )
83
86
time.sleep(1 )
84
-
85
- print (" Wifi Connection established" )
87
+ print (" OK" )
86
88
87
89
# Sync time via NTP server for GW timestamps on Events
90
+ print (' Syncing RTC via ntp...' , end = ' ' )
88
91
rtc = RTC()
89
92
rtc.ntp_sync(server = " 0.pool.ntp.org" )
90
93
94
+ while not rtc.synced():
95
+ print (' .' , end = ' ' )
96
+ time.sleep(.5 )
97
+ print (" OK\n " )
98
+
91
99
# Read the GW config file from Filesystem
92
100
fp = open (' /flash/config.json' ,' r' )
93
101
buf = fp.read()
You can’t perform that action at this time.
0 commit comments