Feature #207
closed
Added by Hammel over 11 years ago.
Updated over 11 years ago.
Category:
04 - Root File System
Description
Use of the access point requires providing dhcp services.
- Add (if it's not there yet) dhcpd to the rootfs
- Provide a default configuration
- Make sure it gets started when hostapd gets started.
The default DHCP server is udhcpd in Busybox. Buildroot offers the ISC dhcp server.
References:
Files
- Description updated (diff)
- Status changed from New to In Progress
- % Done changed from 0 to 10
Busybox's udhcpd is lighter weight but requires rebuilding the entire rootfs to try it (it's not configured currently). I'll try the ISC version first to see how much size that adds to the rootfs and to see if it writes outside of /var/*.
ISC dhcpd in Buildroot comes with a bad init script and configuration. I've come up with a working configuration for the 192.168.3.x network. See attached file.
The buildroot init script (S80dhcp-server) should be removed as a post-build step.
To use this the S40network script should manually configure wlan0 when the WAP is configured. The address for the board should default to 192.168.3.x to match the config file and bui-network-config should allow manually editing /etc/dhcpd.conf in case the user changes the static IP for wlan0. I can either force the configuration to the .3 subnet in bui-network-config or I can allow the user to shoot themselves in the foot if they want. I prefer the latter. Let's build better dummies.
Also, the default configuration location for dhcpd is /etc/dhcpd.conf. This differs from the location created by buildroot. So the rootfs build should remote /etc/dhcpd/ as a post-build step. dhcpd.conf should be added to src/buildroot/skeleton/etc in the PiBox source tree.
- % Done changed from 30 to 60
Added support to rootfs build for dhcp, including default dhcpd.conf. Added support to bui-network-config to edit conf file, if desired. Configuration was manually tested.
Next up:
- Edit S40network to manually start/stop dhcpd when access point it configured.
After running some tests I found that one of the USB wifi adapters I've marked as supported in /etc/usbhandler.conf doesn't work with hostap because the driver doesn't support it, even though the adapter does. I switched to a TP-Link TL-WN727N adapter and it works just fine. However, I found my default hostapd.conf file was not correct. I think the auth_algs was wrong - it was set to 2 when it should have been set to 1 even when using PSK authentication. "1" means open, which implied no PSK, but that's a wrong assumption.
So I got a working hostapd.conf now (see attached). I just have to integrate it into bui-network-config.
I also have a working update to S40network. I need to check that in to.
And then hostapd will be officially supported. Yippeeeeee!
- Severity changed from 04 - Low to 01 - Critical
- % Done changed from 80 to 90
Fixed bui-network-config so it handles the hostapd.conf correctly.
- Status changed from In Progress to Closed
- % Done changed from 90 to 100
S40network update has been pushed upstream.
This issue can be closed.
Also available in: Atom
PDF