Skip to content

Instantly share code, notes, and snippets.

@ciniml
Last active December 10, 2018 22:22
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save ciniml/200f05eada40ab7c067d760bc69779de to your computer and use it in GitHub Desktop.
Save ciniml/200f05eada40ab7c067d760bc69779de to your computer and use it in GitHub Desktop.
MicroPython with FTP server initial bootstrap before configuring Wi-Fi
"""
Setup development environment
"""
import time
import network
import machine
import gc
try:
import appconfig
except:
class AppConfig(object):
def __init__(self, ssid:str, password:str) -> None:
self.wifi_ssid = ssid
self.wifi_password = password
ssid = input('Input Wi-Fi SSID: ')
password = input('Input Wi-Fi password: ')
appconfig = AppConfig(ssid, password)
# Start Wi-Fi
w = network.WLAN()
w.active(True)
w.connect(appconfig.wifi_ssid, appconfig.wifi_password)
while not w.isconnected():
time.sleep(1)
print(w.ifconfig())
# Start FTP server to upload source codes.
network.ftp.start(user='esp32', password='esp32')
gc.collect()
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment