diff --git a/projects/ArchR/packages/archr/sources/scripts/wifictl b/projects/ArchR/packages/archr/sources/scripts/wifictl index 37a25629a8..cc78c2c3f3 100755 --- a/projects/ArchR/packages/archr/sources/scripts/wifictl +++ b/projects/ArchR/packages/archr/sources/scripts/wifictl @@ -119,15 +119,35 @@ connect_wifi() { printf '[Security]\n' > "${IWD_DIR}/${IWD_NAME}.open" fi - # Scan and connect - iwctl station ${WIFI_DEV} scan 2>/dev/null - sleep 2 - iwctl station ${WIFI_DEV} connect "${SSID}" 2>/dev/null + # Scan até o SSID aparecer na lista do iwd. O sleep fixo de 2s falhava + # em dongles USB lentos (o iwctl connect retorna "network not found" se + # a rede ainda não está nos resultados de scan) e o usuário via só um + # "network error" genérico no ES. Até ~12s de scan antes de desistir; + # tenta conectar mesmo assim (a rede pode ser oculta). + SSID_SEEN=0 + for i in $(seq 1 6); do + iwctl station ${WIFI_DEV} scan 2>/dev/null + sleep 2 + if /usr/bin/iwd_get-networks 2>/dev/null | grep -qF "${SSID}"; then + SSID_SEEN=1 + break + fi + done + + # Loga a saída real do iwctl connect: é a única evidência de POR QUE a + # associação falhou (senha errada, rede WPA1/TKIP sem suporte no iwd, + # timeout...). Sem isso todo erro vira "network error" indistinguível. + CONNECT_LOG="/var/log/wifictl.log" + { + echo "== $(date '+%F %T') connect ssid='${SSID}' dev=${WIFI_DEV} seen_in_scan=${SSID_SEEN}" + iwctl station ${WIFI_DEV} connect "${SSID}" 2>&1 + } >> "${CONNECT_LOG}" # Wait for connection. O "state=connected" sozinho não basta: se a # estação já estava em outra rede o teste retornaria sucesso falso. - # Comparar também o "Connected network" com o SSID solicitado. - for i in $(seq 1 15); do + # Comparar também o "Connected network" com o SSID solicitado. 30s: + # dongles lentos levam mais que os 15s antigos para associar + 4-way. + for i in $(seq 1 30); do SHOW=$(iwctl station ${WIFI_DEV} show 2>/dev/null) STATE=$(printf '%s\n' "${SHOW}" | awk '/^[[:space:]]*State[[:space:]]/ {print $NF}') NET=$(printf '%s\n' "${SHOW}" | sed -n 's/^[[:space:]]*Connected network[[:space:]]*//p') @@ -135,10 +155,12 @@ connect_wifi() { NET="${NET#"${NET%%[![:space:]]*}"}" NET="${NET%"${NET##*[![:space:]]}"}" if [ "${STATE}" = "connected" ] && [ "${NET}" = "${SSID}" ]; then + echo "== $(date '+%F %T') connected to '${SSID}'" >> "${CONNECT_LOG}" return 0 fi sleep 1 done + echo "== $(date '+%F %T') FAILED to connect to '${SSID}' (state=${STATE:-?})" >> "${CONNECT_LOG}" return 1 } diff --git a/projects/ArchR/packages/ui/emulationstation/package.mk b/projects/ArchR/packages/ui/emulationstation/package.mk index 338cb36273..a540a2fc62 100644 --- a/projects/ArchR/packages/ui/emulationstation/package.mk +++ b/projects/ArchR/packages/ui/emulationstation/package.mk @@ -2,7 +2,7 @@ # Copyright (C) 2026 ArchR (https://github.com/archr-linux/Arch-R) PKG_NAME="emulationstation" -PKG_VERSION="715ea4b6f659c6041370930964f459fe50f65a58" +PKG_VERSION="8a257e1fa996c40f29c7ddfb7d0a913bfd814748" PKG_GIT_CLONE_BRANCH="master" PKG_LICENSE="GPL" PKG_SITE="https://github.com/archr-linux/emulationstation-next"