How to use the autoconfig.wlan function in autoconfig

To help you get started, we’ve selected a few autoconfig examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github zsquareplusc / wipy-environment / device / flash / main.py View on Github external
# encoding: utf-8
#
# main.py -- put your code here!
#
# (C) 2015 Chris Liechti 
#
# SPDX-License-Identifier:    BSD-3-Clause

import machine
import expansionboard
import autoconfig
import upathlib
import ulog

if machine.reset_cause() != machine.SOFT_RESET:
    autoconfig.wlan()


ulog_config = upathlib.Path('/flash/ulogconfig.py')
if ulog_config.exists():
    execfile(str(ulog_config))
del ulog_config

if expansionboard.initialize_sd_card():
    main = upathlib.Path('/sd/main.py')
    ulog.root.info('execute {}...'.format(main))
    if main.exists():
        execfile(str(main))
    else:
        ulog.root.warn('no file {} found!'.format(main))
    del main