From e6470782200b80dbd072ca6c23aba7a61e613ceb Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ebbe=20Ba=C3=9F?= Date: Fri, 16 Feb 2024 19:23:24 +0100 Subject: [PATCH] updated wifi check process MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Ebbe Baß --- client/main.py | 9 +++------ 1 file changed, 3 insertions(+), 6 deletions(-) diff --git a/client/main.py b/client/main.py index 557559d..05e05b1 100644 --- a/client/main.py +++ b/client/main.py @@ -1,5 +1,5 @@ import os -import wifi +import subprocess import neopixel import requests import json @@ -53,11 +53,8 @@ def get_assigned_params(): return None, None def is_connected_to_wifi(): - try: - ssid = wifi.current() - return ssid is not None - except wifi.exceptions.InterfaceError: - return False + output = subprocess.check_output(['iwgetid']) + return output.split('"')[1] is not None def update_led_strip(r, g, b, dmx_address, strip, LED_PER_PIXEL): for i in range(LED_COUNT):