File tree Expand file tree Collapse file tree 7 files changed +60
-17
lines changed Expand file tree Collapse file tree 7 files changed +60
-17
lines changed Original file line number Diff line number Diff line change @@ -11,8 +11,8 @@ file:662:logger.py
1111file:1367:main.py
1212file:3259:management.py
1313file:309:updates_app.py
14- file:1192 :updates_pythings.py
14+ file:1212 :updates_pythings.py
1515file:734:updates_settings.py
1616file:1702:utils.py
17- file:19 :version.py
17+ file:18 :version.py
1818file:846:worker.py
Original file line number Diff line number Diff line change 44import os
55from arch import arch
66
7- BASE = 'http://backend.pythings.io/static/dist/{}/' .format (arch )
8-
97def update_pythings (version ):
8+ source = 'http://backend.pythings.io/static/dist/PythingsOS/{}/{}/' .format (version ,arch )
109 path = '/' + version
1110 try :
1211 os .mkdir (path )
1312 except OSError as e :
1413 pass
1514 from http import download
16- if not download (BASE + version + '/files.txt' , path + '/files.txt' ):
17- return
15+ if not download (source + '/files.txt' , path + '/files.txt' ):
16+ return False
1817 files_list = open (path + '/files.txt' )
1918 for item in files_list .read ().split ('\n ' ):
2019 if 'file:' in item :
2120 filename = item .split (':' )[2 ]
2221 if filename == 'app.py' : continue
2322 filesize = item .split (':' )[1 ]
24- download (BASE + version + '/' + filename , path + '/' + filename )
23+ download (source + '/' + filename , path + '/' + filename )
2524 if os .stat (path + '/' + filename )[6 ] != int (filesize ):
2625 logger .error ('Aborting: file expected size={}, actual size={}.' .format (filesize ,os .stat (path + '/' + filename )[6 ]))
2726 os .remove (path + '/' + filename )
Original file line number Diff line number Diff line change 1- version = 'v0.1-pre '
1+ version = 'v0.1-rc '
Original file line number Diff line number Diff line change @@ -3,17 +3,17 @@ file:17:arch.py
33file:2257:common.py
44file:394:files.txt
55file:0:globals.py
6- file:964 :hal.py
6+ file:892 :hal.py
77file:620:handle_main_error.py
88file:3142:http.py
99file:6579:init.py
1010file:662:logger.py
1111file:1367:main.py
1212file:3259:management.py
1313file:309:updates_app.py
14- file:1192 :updates_pythings.py
14+ file:1212 :updates_pythings.py
1515file:734:updates_settings.py
1616file:1702:utils.py
17- file:19 :version.py
17+ file:18 :version.py
1818file:7796:websetup.py
1919file:846:worker.py
Original file line number Diff line number Diff line change 55# Constants (settings)
66HW_SUPPORTS_DEEPSLEEP = True
77HW_SUPPORTS_RESETCAUSE = True
8- HW_SUPPORTS_LED = True
8+ HW_SUPPORTS_LED = False
99HW_SUPPORTS_WLAN = True
1010
1111# Required if resetcause is supported
@@ -19,10 +19,10 @@ def init():
1919class LED (object ):
2020 @staticmethod
2121 def on ():
22- machine . Pin ( 2 , machine . Pin . OUT ). low ()
22+ pass
2323 @staticmethod
2424 def off ():
25- machine . Pin ( 2 , machine . Pin . OUT ). high ()
25+ pass
2626
2727class WLAN (object ):
2828 @staticmethod
Original file line number Diff line number Diff line change @@ -11,9 +11,9 @@ file:662:logger.py
1111file:1367:main.py
1212file:3259:management.py
1313file:309:updates_app.py
14- file:1192 :updates_pythings.py
14+ file:1212 :updates_pythings.py
1515file:734:updates_settings.py
1616file:1702:utils.py
17- file:19 :version.py
17+ file:18 :version.py
1818file:7796:websetup.py
1919file:846:worker.py
Load Diff This file was deleted.
Original file line number Diff line number Diff line change 1+
2+ import machine
3+ import network
4+
5+ # Constants (settings)
6+ HW_SUPPORTS_DEEPSLEEP = True
7+ HW_SUPPORTS_RESETCAUSE = True
8+ HW_SUPPORTS_LED = True
9+ HW_SUPPORTS_WLAN = True
10+
11+ # Required if resetcause is supported
12+ HARD_RESET = 6
13+
14+ def init ():
15+ # i.e. turn off extra LEDs and lower PWMs
16+ pass
17+
18+ # Objects
19+ class LED (object ):
20+ @staticmethod
21+ def on ():
22+ machine .Pin (2 , machine .Pin .OUT ).low ()
23+ @staticmethod
24+ def off ():
25+ machine .Pin (2 , machine .Pin .OUT ).high ()
26+
27+ class WLAN (object ):
28+ @staticmethod
29+ def sta_active (mode ):
30+ network .WLAN (network .STA_IF ).active (mode )
31+ @staticmethod
32+ def ap_active (mode ):
33+ network .WLAN (network .AP_IF ).active (mode )
34+
35+ def get_tuuid ():
36+ wlan = network .WLAN (network .STA_IF )
37+ mac_b = wlan .config ('mac' )
38+ mac_s = ':' .join ( [ "%02X" % x for x in mac_b ] )
39+ return mac_s .replace (':' ,'' )
40+
41+ def reset_cause ():
42+ return machine .reset_cause ()
43+
44+ def reboot ():
45+ machine .reset ()
You can’t perform that action at this time.
0 commit comments