Last active
December 10, 2018 22:22
-
-
Save ciniml/200f05eada40ab7c067d760bc69779de to your computer and use it in GitHub Desktop.
MicroPython with FTP server initial bootstrap before configuring Wi-Fi
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
""" | |
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