So after Padlock is working my next fight seems to be scheduled with hostapd. In a very basic configuration it's actually working but at abysmal rates (about 100kb/s besides having perfect connection quality). Also 80211n support seems to be disabled at compile time but that isn't much of problem for now. While the minimal config (not even setting a channel) somewhat works hostapd seems to run into trouble as soon as a country code or channel is set (i've tried this with different hw_mode
settings - a, b, g - with no noticeable change):
Adding country_code=DE
to hostapd.conf results in
athn0: interface state UNINITIALIZED->COUNTRY_UPDATE
Previous country code , new country code DE
Continue interface setup after channel list update
ctrl_iface not configured!
Channel list update timeout - try to continue anyway
(I don't think the message about ctrl_iface is related here)
Adding channel=2
to hostapd.conf results in
Mode: (null) Channel: 2 Frequency: -1 MHz
I think it the cause of the problem might be related to hostapd being unable to pull the list of supported channels from the device. Is there any command i can use to pull the channel list manually (i think on Linux this can be done with iw
) for testing? I've looked around but from reading the relevant manuals neither wlanctl
nor ifconfig
seem to support this. Any other pointers/ideas on how to approach this are obviously also greatly appreciated.
Edit: If it's relevant the device is a TP-Link WN722N USB dongle which by default identifies as region CN.
Edit2: Seeing Mode = (null) here seems to be extremely weird. Hostapd's code is kinda huge but it seems the mode name is converted by hostapd_hw_mode_txt in hw_features.c and the relevant switch statement does not seem to allow a NULL pointer being returned due to having a default clause returning "UNKNOWN". I guess i must be reading the wrong source or something like that.
Edit3: I did something (reboot?) that allows it to reach about 7-8mbit/s which still isn't great but at least it's something. channel
settings seem to be straight up ignored though (i suspect hw_mode
is also but i don't know how to check this). It seems to stay on channel 1 whatever i do. Also trying to enable wmm results in ioctl returning file not found when a client tries to connect (the connection attempt fails shortly after). I am getting a feeling this might be a driver problem?
Edit4: There seems to be a difference between starting hostapd with or without -dd
. When run without -dd
it refuses to even start with a channel
directive in the config file complaining: Could not set channel for kernel driver
. Seemingly adding -dd
(show more debug information) makes it ignore errors? Kinda strange. Didn't expect that.
Edit5: In normal operation (as in started by rc without -dd
option and channel
setting) maximum transfer rate seems to be generally stuck at -/+ 100kb/s.
Edit6: OK, i am getting somewhere. This seems to be quite different than the hostapd that is used on Linux (if it looks pretty familiar on first glance). Stuff like channels and modes seemingly should be configured by ifconfig (media, mediaopts and such - is this actually mentioned anywhere but the driver man page? it seems quite elemental to setting up an AP). Kinda confusing hostapd will still accept the various configuration settings but fail to apply them. This is making a lot more sense now. Sadly setting media
on the wireless interface seems to have no effect. I can select whatever the driver accepts but be it ofdm54
, ofdm6
or ds1
the archived maximum transfer speed is always around 800kb/s.
Edit7: Setting options the driver(?) doesn't like can easily hang the kernel. I had already noticed this when playing with hostapd.conf but couldn't really pin the cause. Using ifconfig it's easily reproducable. For example by trying to set the interface to channel 13. After hitting enter there won't be any returning to your shell prompt.