-
Notifications
You must be signed in to change notification settings - Fork 8
/
main.py
executable file
·46 lines (32 loc) · 1.7 KB
/
main.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
from microWifi import MicroWifi
from machine import Timer
from time import sleep
# ============================================================================
# ===( Functions )============================================================
# ============================================================================
def _timerProcess(timer) :
print('-----------------------------')
print('Access point opened : %s' % wifi.IsAccessPointOpened())
print('Connected to AP : %s' % wifi.IsConnectedToAP())
print('Internet access : %s' % wifi.InternetAccessIsPresent())
print('google.com IP address : %s' % wifi.ResolveIPFromHostname('google.com'))
print('-----------------------------')
# ============================================================================
# ===( Main )=================================================================
# ============================================================================
print()
print("=======================================================================")
print()
print() # ----------------------------------------------
wifi = MicroWifi()
Timer.Alarm(_timerProcess, 3, periodic=True)
if not wifi.OpenAccessPointFromConf() :
wifi.OpenAccessPoint('.-= AP TEST =-.', None, '192.168.0.254')
if not wifi.ConnectToAPFromConf() :
wifi.ConnectToAP('JCzic', 'azerty123')
print()
print("=======================================================================")
print()
# ============================================================================
# ============================================================================
# ============================================================================