30 lines
930 B
Markdown
30 lines
930 B
Markdown
|
# Automatic WiFi Config
|
||
|
|
||
|
The below will setup automatic WiFi configuration via text file. The way this will work is you plug in a USB disk with a file named ```wifi.txt``` with the ```essid``` as the first line and ```password``` as the second line in the file. On boot a small script will run that reads the file and re-configures the PiFrame's WiFi to use the new values.
|
||
|
|
||
|
Can be used for setup and/or re-configuring WiFi if something changes.
|
||
|
|
||
|
``` sh
|
||
|
|
||
|
git clone https://git.kemonine.info/PiFrame/piframe.git /opt/piframe
|
||
|
cp /opt/piframe/wifi_setup.py /usr/local/bin
|
||
|
chmod a+x /usr/local/bin/wifi_setup.py
|
||
|
|
||
|
cat > /etc/systemd/system/wifi_setup.service <<EOF
|
||
|
[Unit]
|
||
|
Description=Automatic configuration of WiFi on boot
|
||
|
|
||
|
[Service]
|
||
|
User=root
|
||
|
PrivateTmp=true
|
||
|
ExecStart=/usr/local/bin/wifi_setup.py
|
||
|
|
||
|
[Install]
|
||
|
WantedBy=multi-user.target
|
||
|
EOF
|
||
|
|
||
|
systemctl daemon-reload
|
||
|
systemctl enable --now wifi_setup
|
||
|
|
||
|
```
|