From 40f5ecd3a82e810203b39131cb61474f101de58e Mon Sep 17 00:00:00 2001 From: Paul Sokolovsky Date: Tue, 12 Apr 2016 00:37:04 +0300 Subject: esp8266: Add Python modules for initial configuration. Main entry point is _boot.py which checks whether FAT FS in flash mountable, and if so, mounts it. Otherwise, it checks if flash is empty, and if so, performs initial module setup: makes FAT FS, configures default AP name, etc. As a last option, if flash is not empty, and could not be mounted, it means filesystem corruption, and warning message with instructions is printed in an infinite loop. --- esp8266/scripts/_boot.py | 12 ++++++++++++ 1 file changed, 12 insertions(+) create mode 100644 esp8266/scripts/_boot.py (limited to 'esp8266/scripts/_boot.py') diff --git a/esp8266/scripts/_boot.py b/esp8266/scripts/_boot.py new file mode 100644 index 000000000..104034fb2 --- /dev/null +++ b/esp8266/scripts/_boot.py @@ -0,0 +1,12 @@ +import uos +import builtins +from flashbdev import bdev + +try: + vfs = uos.VfsFat(bdev, "/") +except OSError: + import inisetup + inisetup.check_bootsec() + uos.VfsFat.mkfs(bdev) + vfs = uos.VfsFat(bdev, "/") + inisetup.wifi() -- cgit v1.2.3