diff -r 49728322ffb4 -r 66a6d3f131cc src/eric7/MicroPython/Devices/MCUScripts/picoWiznetConnect.py --- a/src/eric7/MicroPython/Devices/MCUScripts/picoWiznetConnect.py Tue Mar 14 13:18:54 2023 +0100 +++ b/src/eric7/MicroPython/Devices/MCUScripts/picoWiznetConnect.py Tue Mar 14 13:19:33 2023 +0100 @@ -1,17 +1,23 @@ try: import wiznet_config - def connectLan(): + def connect_lan(): import network import time from machine import Pin, SPI + try: + ifconfig = wiznet_config.ifconfig + except AttributeError: + print("The network configuration in 'wiznet_config.py' is invalid.") + return None + spi = SPI(0, 2_000_000, mosi=Pin(19), miso=Pin(16), sck=Pin(18)) nic = network.WIZNET5K(spi, Pin(17), Pin(20)) nic.active(False) nic.active(True) - nic.ifconfig(wiznet_config.ifconfig) + nic.ifconfig(ifconfig) max_wait = 140 while max_wait: if nic.isconnected(): @@ -30,5 +36,5 @@ print( "The network configuration is kept in 'wiznet_config.py'. Please add it there." ) - def connectLan(): + def connect_lan(): return None