Compare commits

..

12 Commits

Author SHA1 Message Date
5e767d99f8 correct code 2025-07-22 14:01:54 +01:00
b4acb6e7b4 final fix? 2025-07-22 12:39:20 +01:00
52423fcc9a updated toml 2025-07-22 12:31:08 +01:00
3f6dfb9017 needed toml 2025-07-22 12:27:58 +01:00
1c1ba35577 cleanup 2025-07-22 11:49:00 +01:00
466668553d potental correct wifi fix 2025-07-22 11:44:26 +01:00
d9d8fb3d5a another fix 2025-07-22 10:29:28 +01:00
249327a8cc final fix? 2025-07-22 09:24:31 +01:00
ca7a2b615f new wifi 2025-07-22 08:42:22 +01:00
c133508f3c try again for wifi 2025-07-22 08:39:09 +01:00
b82615813d wifi fix 2025-07-21 20:37:23 +01:00
2acec6eca9 fix wifi 2025-07-21 18:27:00 +01:00
7 changed files with 49 additions and 73 deletions

View File

@ -0,0 +1,20 @@
# ==============================================================================
# == Raspberry Pi OS - First-Boot Wi-Fi Configuration
# ==============================================================================
#
# This file is used ONLY to get the device onto a Wi-Fi network on its
# very first boot. The filename "custom.toml" is required by the OS.
#
# -> Edit the "ssid" and "password" values below with your network details.
#
# All other kiosk-specific configuration (hostname, SSH keys, etc.) is
# handled by the "kioskbrowser.ini" file after this initial boot.
#
config_version = 1
[wlan]
ssid = "YOUR_WIFI_SSID"
password = "YOUR_WIFI_PASSWORD"
password_encrypted = false
country = "GB"

View File

@ -24,14 +24,6 @@ reboot_time = 04:00
; apikey to be sent with commands to /api.php
key = "MyKey"
[wifi]
; If you need more complex WiFi settings (like WPA2-Enterprise, hidden SSIDs, etc.)
; create a file called wpa_supplicant.conf on this partition.
country=DE
; Leave SSID empty to disable WiFi
ssid="My WiFi"
; Leave PSK empty (or comment) to use an open network
psk="My Passphrase"
[browser]
url="https://kittenlabs.de/"

View File

@ -2,9 +2,11 @@
# This script is being run on the target debian platform
apt update
DEBIAN_FRONTEND=noninteractive apt install -y lightdm openbox nginx php-fpm php-cli chromium autossh unclutter x11-xserver-utils xdotool htop nano openssh-server rsync x11vnc lm-sensors ntpdate scrot wireless-regdb fontconfig
DEBIAN_FRONTEND=noninteractive apt install -y lightdm openbox nginx php-fpm php-cli chromium autossh unclutter x11-xserver-utils xdotool htop nano openssh-server rsync x11vnc lm-sensors ntpdate scrot wireless-regdb fontconfig php-cli
rsync -a --chown=root:root "/kiosk_skeleton/." "/"
# Ensure all our custom scripts are executable
chmod +x /usr/bin/kiosk-* /usr/bin/get-ini /usr/bin/refresh-screen /usr/bin/schedule-* /usr/bin/setup-refresh-timer
# Add emoji support
mkdir -p /home/pi/.fonts
@ -53,11 +55,11 @@ echo "tmpfs /home/pi/.ssh/ tmpfs mode=0700,nosuid,nodev,uid=1000,gid=1000 0
echo "tmpfs /root/.ssh/ tmpfs mode=0700,nosuid,nodev,uid=0,gid=0 0 0" >> /etc/fstab
# Create symlinks for configuration files which will later get created at runtime (in /tmp)
rm /etc/hosts
rm /etc/hostname
mkdir -p /etc/wpa_supplicant/
ln -sf /tmp/hosts /etc/hosts
touch /etc/hostname
touch /etc/hosts
ln -sf /tmp/hostname /etc/hostname
ln -sf /tmp/hosts /etc/hosts
ln -sf /tmp/wpa_supplicant.conf /etc/wpa_supplicant/wpa_supplicant.conf
systemctl daemon-reload
@ -69,10 +71,10 @@ systemctl disable avahi-daemon || true
systemctl disable bluetooth || true
systemctl enable kiosk-ssh-keys
systemctl enable kiosk-wifi
systemctl enable NetworkManager
systemctl enable kiosk-set-hostname
systemctl enable kiosk-autossh
systemctl enable kiosk-watchdog
systemctl enable kiosk-set-hostname
systemctl enable ntpdate
systemctl enable lightdm
systemctl enable nginx

View File

@ -0,0 +1,21 @@
[connection]
id=kiosk
uuid=a2a5c7d8-2e2b-4b2a-9c1d-3e4e5e6a7b8c
type=wifi
autoconnect=true
interface-name=wlan0
[wifi]
mode=infrastructure
ssid=YOUR_WIFI_SSID
[wifi-security]
auth-alg=open
key-mgmt=wpa-psk
psk=YOUR_WIFI_PASSWORD
[ipv4]
method=auto
[ipv6]
method=auto

View File

@ -1,10 +0,0 @@
[Unit]
Description=Generate wpa_supplicant.conf from kioskbrowser.ini
Before=wpa_supplicant.service dhcpcd.service
[Service]
Type=oneshot
ExecStart=/usr/bin/kiosk-wifi
[Install]
WantedBy=multi-user.target

View File

@ -1,22 +0,0 @@
#!/usr/bin/env php
<?php
if ($argc != 4 && $argc != 5)
{
error_log("Usage: get-ini FILE SECTION NAME [DEFAULT]");
error_log("Fetches a single configuration item from an ini file");
exit(1);
}
$config = parse_ini_file($argv[1], true, INI_SCANNER_NORMAL);
if (isset($config[$argv[2]]))
{
if (isset($config[$argv[2]][$argv[3]]))
{
echo $config[$argv[2]][$argv[3]];
exit(0);
}
}
echo $argv[4] ?? "";
exit(1);

View File

@ -1,27 +0,0 @@
#!/bin/bash
if [ -f "/boot/wpa_supplicant.conf" ]; then
ln -s /boot/wpa_supplicant.conf /tmp/wpa_supplicant.conf
exit
fi
WIFI_SSID=$(get-ini /boot/kioskbrowser.ini wifi ssid)
WIFI_PSK=$(get-ini /boot/kioskbrowser.ini wifi psk)
WIFI_COUNTRY=$(get-ini /boot/kioskbrowser.ini wifi country)
if [ -n "${WIFI_SSID}" ]
then
echo "country=${WIFI_COUNTRY}" > /tmp/wpa_supplicant.conf
echo "ctrl_interface=DIR=/var/run/wpa_supplicant GROUP=netdev" >> /tmp/wpa_supplicant.conf
echo "update_config=1" >> /tmp/wpa_supplicant.conf
echo "network={" >> /tmp/wpa_supplicant.conf
echo " ssid=\"${WIFI_SSID}\"" >> /tmp/wpa_supplicant.conf
if [ -n "${WIFI_PSK}" ]
then
echo " psk=\"${WIFI_PSK}\"" >> /tmp/wpa_supplicant.conf
else
echo " key_mgmt=NONE" >> /tmp/wpa_supplicant.conf
fi
echo "}" >> /tmp/wpa_supplicant.conf
fi