def change_access(self, user=None, passwrd=None): """change_access - change password for telnet and ftp access""" if (user is None) or (passwrd is None): print('WifiManager:: username and password must be specified') return server = Server() # from network # disable the server server.deinit() # enable the server again with new credentials # for ftp and telnet, not USB server.init(login=(user, passwrd), timeout=600) print_debug('WifiManager::password {} is changed...'.format(user))
def change_access(self, user=None, passwrd=None): """change_access - change password for telnet and ftp access""" if (user == None) or (passwrd == None): print('WifiManager:: username and password must be specified') return server = Server() # from network # disable the server server.deinit() # enable the server again with new credentials # for example: remote access, ftp and telnet, not USB server.init(login=(user, passwrd), timeout=600) if USE_DEBUG: print('WifiManager::password is changed...')
coda_common.coda_save_config() break else: pass else: pass if wlan.isconnected(): coda_common.led_g() update_ap_list(SSID, PWD) print("ip:", wlan.ifconfig()[0]) server = Server() server.deinit() server.init(login=(coda_common.CODA_CONFIG["server_userid"], coda_common.CODA_CONFIG["server_pwd"]), timeout=60) time.sleep(1) coda_common.led_off() AP_LIST = None SCAN_LIST = None gc.collect() if coda_common.CODA_CONFIG[ "enable_app_main"] and coda_common.CODA_CONFIG["app_main"] > "": execfile(coda_common.CODA_CONFIG["app_main"]) else: AP_LIST = None SCAN_LIST = None
""" import os import machine import pycom from network import Server from config import SERIAL_ACCESS from config import FTP_ACCESS_ENABLED from config import FTP_USER from config import FTP_PASSWORD # Deactivate heartbeat pycom.heartbeat(False) # Activate Serial Access if SERIAL_ACCESS: uart = machine.UART(0, 115200) os.dupterm(uart) # Disable FTP server server = Server() server.deinit() # Enable the server again with new settings if FTP_ACCESS_ENABLED: server.init(login=(FTP_USER, FTP_PASSWORD), timeout=600) # Wifi on boot default off pycom.wifi_on_boot(False)