INNER CODE UNIT · Python
start
thevickypedia/Jarvis · jarvis/main.py:187
def start() -> None:
"""Starts main process to activate Jarvis after checking internet connection and initiating background processes."""
logger.info("Current Process ID: %d", models.settings.pid)
controls.starter()
# Instantiate the object here, so validations go through first
activator = Activator()
if internet.private_ip() and internet.public_ip_info():
support.write_screen(text=f"INTERNET::Connected to {internet.get_connection_info() or 'the internet'}.")
else:
support.write_screen("Trying to toggle WiFi")
pywifi.ControlPeripheral(logger=logger).enable()
if models.env.wifi_ssid and models.env.wifi_password:
time.sleep(5)
support.write_screen(f"Trying to connect to {models.env.wifi_ssid!r}")
if pywifi.ControlConnection(
wifi_ssid=models.env.wifi_ssid,
wifi_password=models.env.wifi_password,
logger=logger,