I solved this problem:

from m5stack import * import wifisetup wifisetup.auto_connect()