dividebysandwich / shareboxx

An anonymous, disconnected local filesharing system over WiFi, similar to Piratebox and Librarybox, entirely written in Rust.
GNU General Public License v2.0
123 stars 9 forks source link

Workaround for a hostapd issue (accesspoint not visible after reboot) #9

Open marwenius opened 4 days ago

marwenius commented 4 days ago

After a cold boot or reboot, the hostapd service started, but the Wi-Fi access point only worked after a manual restart of the service with sudo systemctl restart hostapd.service.

The solution: Add the line ExecStartPre=/bin/sleep 15 in the file hostapd.service.

pi@shareboxx:~ $ sudo systemctl cat hostapd
# /lib/systemd/system/hostapd.service
[Unit]
Description=Access point and authentication server for Wi-Fi and Ethernet
Documentation=man:hostapd(8)
After=network.target
ConditionFileNotEmpty=/etc/hostapd/hostapd.conf

[Service]
Type=forking
PIDFile=/run/hostapd.pid
Restart=on-failure
RestartSec=2
Environment=DAEMON_CONF=/etc/hostapd/hostapd.conf
EnvironmentFile=-/etc/default/hostapd
ExecStart=/usr/sbin/hostapd -B -P /run/hostapd.pid $DAEMON_OPTS ${DAEMON_CONF}
ExecStartPre=/bin/sleep 15

[Install]
WantedBy=multi-user.target

I got the solution from there: https://forums.raspberrypi.com/viewtopic.php?p=1583480#p1583480

dividebysandwich commented 4 days ago

Interesting, I never had this issue... On which hardware did you try this? I ran it on a Raspi 5.

marwenius commented 4 days ago

Interesting, I never had this issue... On which hardware did you try this? I ran it on a Raspi 5.

Tried it on this hardware: