'Option wifi' within programs ?
Author
Message
JohnS
Guru
Joined: 18/11/2011
Location: United KingdomPosts: 4352
Posted: 10:36am 06 Jun 2025
phil99 said
That looks like a good solution.
Below is what I have been using. It's adapted from the work of others here.
Sub MM.STARTUP
Pause 200
On error skip 6
If MM.Info(ip address) = "0.0.0.0" Then 'test for WiFi link
Print "WiFi not found";
Pause 8000
Print "...Rebooting now"
CPU restart 'endless re-boot until WiFi found
EndIf
Local float TZ = 10, DS = 1 'Time Zone, Daylight Saving
Local integer n = 0
Do While Date$ = "01-01-2024" 'test internet connection, wait for date$ to update
On error skip
WEB NTP TZ+DS, "203.12.160.2" 'Second choice is 0.au.pool.ntp.org or 1.au.pool.ntp.org
Inc n : Print n; " tries", DateTime$(now),
Pause 2000
If n=15 Then End Sub 'give up!
Loop
Print
RUN 'start main program
End Sub
Should really use
If n=15 Then Exit Sub 'give up!
John