The other tutorial from sirlagz uses dnsmasq with basically the same problem; the phone either verifies and hangs on acquiring an IP address or hangs on verifying.
Very stupid, because it did work at one time

On second thoughts that makes a lot of sense in my situation, for I basically only need the browser of one e-reader connected to the Pi over WiFi! That can't be too hard, will dive into that in a few days, any tips welcomeSonny_Jim wrote: EDIT: Or just use static addresses if you can't get udhcpd to work.
I don't have my Pi right now, but hostapd should find the config file automatically. If not, I'll update my tutorial.poing wrote:I have two Ralink dongles now. I tried the sirlagz tutorial and had initial success where I could log into my Pi with my phone and see the webpage on the Pi (that's what I need), but then MySQL went corrupt. So I decided to install everything from scratch but now it won't work anymorehunternet93 wrote: Hmm. Try running the following commands and posting the results:The first two commands check if HostAPD and uDHPD are running, the second two give some information on your network interfaces. It's very possible I missed a step when writing the instructions, I wrote them during a break a work and haven't had time to verify them on a Pi yet.Code: Select all
sudo service hostapd status sudo service udhcpd status sudo ifconfig sudo iwconfig
After five tries I'm a bit disparate.
Anyway I tried this tutorial again. What I had to do was changeintoCode: Select all
DEAMON_CONF=""
in the file /etc/init.d/hostapd otherwise hostapd wouldn't start.Code: Select all
DEAMON_CONF="/etc/hostapd/hostapd.conf"
What error did you get? auth_algs=0 is the correct line to put in the config file, which tells hostapd to allow open (passwordless) authentication.Next I had to remove the linefrom /etc/hostapd/hostapd.conf for it was not allowed to have arguments.Code: Select all
auth_algs=0
Apparently, udhcpd doesn't report it's status when asked. Try running the command "udhcpd" and see if there are any error messages. Also, it appears that wlan0 hasn't been assigned a static IP address, maybe check /etc/network/interfaces?That's where I am, I can see the Access Point but it refuses to give me an IP address, which is the same status I can reach with the sirlagz tutorial (after likewise editing as above, only then I need to change a "group" line in /etc/hostapd/hostapd.conf)
Here's the output from the requested commands:
Hope someone can help.Code: Select all
pi@raspberrypi ~ $ sudo service hostapd status [ ok ] hostapd is running. pi@raspberrypi ~ $ sudo service udhcpd status Usage: /etc/init.d/udhcpd {start|stop|restart|force-reload} pi@raspberrypi ~ $ sudo ifconfig eth0 Link encap:Ethernet HWaddr b8:27:eb:13:26:2e inet addr:192.168.1.123 Bcast:192.168.1.255 Mask:255.255.255.0 UP BROADCAST RUNNING MULTICAST MTU:1500 Metric:1 RX packets:1302 errors:0 dropped:0 overruns:0 frame:0 TX packets:1086 errors:0 dropped:0 overruns:0 carrier:0 collisions:0 txqueuelen:1000 RX bytes:1140902 (1.0 MiB) TX bytes:175176 (171.0 KiB) lo Link encap:Local Loopback inet addr:127.0.0.1 Mask:255.0.0.0 UP LOOPBACK RUNNING MTU:16436 Metric:1 RX packets:0 errors:0 dropped:0 overruns:0 frame:0 TX packets:0 errors:0 dropped:0 overruns:0 carrier:0 collisions:0 txqueuelen:0 RX bytes:0 (0.0 B) TX bytes:0 (0.0 B) mon.wlan0 Link encap:UNSPEC HWaddr 00-0F-54-0A-AC-E2-00-00-00-00-00-00-00-00-00-00 UP BROADCAST RUNNING MULTICAST MTU:1500 Metric:1 RX packets:130 errors:0 dropped:0 overruns:0 frame:0 TX packets:0 errors:0 dropped:0 overruns:0 carrier:0 collisions:0 txqueuelen:1000 RX bytes:12684 (12.3 KiB) TX bytes:0 (0.0 B) wlan0 Link encap:Ethernet HWaddr 00:0f:54:0a:ac:e2 UP BROADCAST RUNNING MULTICAST MTU:1500 Metric:1 RX packets:18 errors:0 dropped:0 overruns:0 frame:0 TX packets:18 errors:0 dropped:0 overruns:0 carrier:0 collisions:0 txqueuelen:1000 RX bytes:6196 (6.0 KiB) TX bytes:6520 (6.3 KiB) pi@raspberrypi ~ $ sudo iwconfig lo no wireless extensions. wlan0 IEEE 802.11bgn Mode:Master Frequency:2.427 GHz Tx-Power=20 dBm Retry long limit:7 RTS thr:off Fragment thr:off Power Management:on eth0 no wireless extensions. mon.wlan0 IEEE 802.11bgn Mode:Monitor Tx-Power=20 dBm Retry long limit:7 RTS thr:off Fragment thr:off Power Management:on pi@raspberrypi ~ $
You can check for error messages on the Pi with this command:Sonny_Jim wrote:I'm using a zd1211rw based dongle along with hostapd and dnsmasq, which seems to work OK for some devices and not with others. For example my Nintendo DS and N900 both connect fine, but my laptop doesn't want to connect. I'm fairly sure it's a problem with the wireless drivers.
Code: Select all
sudo cat /var/log/syslog | grep "hostapd\|udhcpd"
Code: Select all
" and "[\code]" tags to put the output in it's own scroll box so your post isn't several miles long.)
Code: Select all
[302172.509572] wlan0: direct probe to 00:17:3f:b1:43:36 (try 1/3)
[302172.708169] wlan0: direct probe to 00:17:3f:b1:43:36 (try 2/3)
[302172.908155] wlan0: direct probe to 00:17:3f:b1:43:36 (try 3/3)
[302173.108138] wlan0: direct probe to 00:17:3f:b1:43:36 timed out
There probably is a driver issue somewhere, using a real access point/router is probably a good idea for a "serious" hotspot because it'll have good, working hardware builtin.Sonny_Jim wrote:Here's the thing, hostapd nor the PI ever sees anything coming from my laptop, but it otherwise finds other devices, so I only have this in my laptops dmesg:The only reason I setup hostapd was because my DS doesn't support anything other than WEP for encryption and no one uses that nowadays, so I'm not that bothered about it. As someone pointed out for me, a dd-wrt router is just as configurable as a Pi, costs less than a Pi and comes with a PSUCode: Select all
[302172.509572] wlan0: direct probe to 00:17:3f:b1:43:36 (try 1/3) [302172.708169] wlan0: direct probe to 00:17:3f:b1:43:36 (try 2/3) [302172.908155] wlan0: direct probe to 00:17:3f:b1:43:36 (try 3/3) [302173.108138] wlan0: direct probe to 00:17:3f:b1:43:36 timed out
I had the same problem with the sirlagz tutorial when starting from a fresh Raspian install. The first time it worked OK, although then MySQL gave up somehow. I'm using the latest distro 2012-10-28.hunternet93 wrote: I don't have my Pi right now, but hostapd should find the config file automatically. If not, I'll update my tutorial.
I put the line back then restarted the Pi. hostapd will fail to start. Config file is:hunternet93 wrote: What error did you get? auth_algs=0 is the correct line to put in the config file, which tells hostapd to allow open (passwordless) authentication.
Code: Select all
interface=wlan0
ssid=GlimBox_1
hw_mode=g
channel=4
wmm_enabled=0
auth_algs=0
Code: Select all
pi@raspberrypi ~ $ hostapd -d /etc/hostapd/hostapd.conf
random: Trying to read entropy from /dev/random
Configuration file: /etc/hostapd/hostapd.conf
Line 6: no authentication algorithms allowed
1 errors found in configuration file '/etc/hostapd/hostapd.conf'
When I run udhcpd there is no output, this is the contents of /etc/network/interfaces:hunternet93 wrote: Apparently, udhcpd doesn't report it's status when asked. Try running the command "udhcpd" and see if there are any error messages. Also, it appears that wlan0 hasn't been assigned a static IP address, maybe check /etc/network/interfaces?
Code: Select all
auto lo
iface lo inet loopback
iface eth0 inet dhcp
allow-hotplug wlan0
iface wlan0 inet static
address 192.168.2.1
netmask 255.255.255.0
wpa-roam /etc/wpa_supplicant/wpa_supplicant.conf
iface default inet dhcp
up iptables-restore < /etc/iptables.ipv4.nat
Code: Select all
sudo cat /var/log/syslog | grep "hostapd\|udhcpd"
Code: Select all
Nov 6 15:34:56 raspberrypi udhcpd[3595]: udhcpd (v1.20.2) started
Nov 6 15:34:56 raspberrypi udhcpd[3595]: max_leases=235 is too big, setting to 19
Nov 6 15:34:56 raspberrypi udhcpd[3595]: can't open '/var/lib/misc/udhcpd.leases': No such file or directory
Nov 6 15:38:44 raspberrypi udhcpd[3595]: Received SIGTERM
Nov 6 15:39:01 raspberrypi udhcpd[1983]: udhcpd (v1.20.2) started
Nov 6 15:39:01 raspberrypi udhcpd[1983]: max_leases=235 is too big, setting to 19
Nov 6 15:39:01 raspberrypi udhcpd[1983]: can't open '/var/lib/misc/udhcpd.leases': No such file or directory
Nov 6 15:43:10 raspberrypi udhcpd[1983]: Received SIGTERM
Nov 6 15:43:11 raspberrypi udhcpd[2236]: udhcpd (v1.20.2) started
Nov 6 15:43:11 raspberrypi udhcpd[2236]: max_leases=235 is too big, setting to 19
Nov 6 15:43:11 raspberrypi udhcpd[2236]: can't open '/var/lib/misc/udhcpd.leases': No such file or directory
Nov 6 15:50:41 raspberrypi udhcpd[2236]: Received SIGTERM
Nov 6 15:50:59 raspberrypi udhcpd[2005]: udhcpd (v1.20.2) started
Nov 6 15:50:59 raspberrypi udhcpd[2005]: max_leases=235 is too big, setting to 19
Nov 6 15:50:59 raspberrypi udhcpd[2005]: can't open '/var/lib/misc/udhcpd.leases': No such file or directory
Nov 6 15:53:27 raspberrypi udhcpd[2005]: Received SIGTERM
Nov 6 15:53:44 raspberrypi udhcpd[2050]: udhcpd (v1.20.2) started
Nov 6 15:53:44 raspberrypi udhcpd[2050]: max_leases=235 is too big, setting to 19
Nov 6 15:53:44 raspberrypi udhcpd[2050]: can't open '/var/lib/misc/udhcpd.leases': No such file or directory
Nov 6 15:53:44 raspberrypi udhcpd[2050]: is interface wlan0 up and configured?: Cannot assign requested address
Nov 6 15:54:27 raspberrypi hostapd: wlan0: STA 78:d6:f0:45:6f:8c IEEE 802.11: authenticated
Nov 6 15:54:27 raspberrypi hostapd: wlan0: STA 78:d6:f0:45:6f:8c IEEE 802.11: associated (aid 1)
Nov 6 15:54:27 raspberrypi hostapd: wlan0: STA 78:d6:f0:45:6f:8c RADIUS: starting accounting session 50992475-00000000
Nov 6 15:54:58 raspberrypi hostapd: wlan0: STA 78:d6:f0:45:6f:8c IEEE 802.11: disassociated
Nov 6 15:54:59 raspberrypi hostapd: wlan0: STA 78:d6:f0:45:6f:8c IEEE 802.11: authenticated
Nov 6 15:54:59 raspberrypi hostapd: wlan0: STA 78:d6:f0:45:6f:8c IEEE 802.11: associated (aid 1)
Nov 6 15:54:59 raspberrypi hostapd: wlan0: STA 78:d6:f0:45:6f:8c RADIUS: starting accounting session 50992475-00000001
Nov 6 15:55:29 raspberrypi hostapd: wlan0: STA 78:d6:f0:45:6f:8c IEEE 802.11: disassociated
Nov 6 15:55:30 raspberrypi hostapd: wlan0: STA 78:d6:f0:45:6f:8c IEEE 802.11: authenticated
Nov 6 15:55:30 raspberrypi hostapd: wlan0: STA 78:d6:f0:45:6f:8c IEEE 802.11: associated (aid 1)
Nov 6 15:55:30 raspberrypi hostapd: wlan0: STA 78:d6:f0:45:6f:8c RADIUS: starting accounting session 50992475-00000002
Nov 6 15:56:00 raspberrypi hostapd: wlan0: STA 78:d6:f0:45:6f:8c IEEE 802.11: disassociated
Nov 6 15:56:01 raspberrypi hostapd: wlan0: STA 78:d6:f0:45:6f:8c IEEE 802.11: authenticated
Nov 6 15:56:01 raspberrypi hostapd: wlan0: STA 78:d6:f0:45:6f:8c IEEE 802.11: associated (aid 1)
Nov 6 15:56:01 raspberrypi hostapd: wlan0: STA 78:d6:f0:45:6f:8c RADIUS: starting accounting session 50992475-00000003
Nov 6 15:56:12 raspberrypi hostapd: wlan0: STA 78:d6:f0:45:6f:8c IEEE 802.11: disassociated
Nov 6 15:56:13 raspberrypi hostapd: wlan0: STA 78:d6:f0:45:6f:8c IEEE 802.11: deauthenticated due to inactivity
Nov 6 16:48:17 raspberrypi hostapd: wlan0: STA 78:d6:f0:45:6f:8c IEEE 802.11: authenticated
Nov 6 16:48:17 raspberrypi hostapd: wlan0: STA 78:d6:f0:45:6f:8c IEEE 802.11: associated (aid 1)
Nov 6 16:48:17 raspberrypi hostapd: wlan0: STA 78:d6:f0:45:6f:8c RADIUS: starting accounting session 50992475-00000004
Nov 6 16:48:41 raspberrypi hostapd: wlan0: STA 78:d6:f0:45:6f:8c IEEE 802.11: disassociated
Nov 6 16:48:42 raspberrypi hostapd: wlan0: STA 78:d6:f0:45:6f:8c IEEE 802.11: deauthenticated due to inactivity
Nov 7 12:40:07 raspberrypi udhcpd[2013]: udhcpd (v1.20.2) started
Nov 7 12:40:07 raspberrypi udhcpd[2013]: max_leases=235 is too big, setting to 19
Nov 7 12:40:07 raspberrypi udhcpd[2013]: can't open '/var/lib/misc/udhcpd.leases': No such file or directory
Nov 7 13:08:56 raspberrypi udhcpd[2013]: Received SIGTERM
Nov 7 13:09:13 raspberrypi udhcpd[2034]: udhcpd (v1.20.2) started
Nov 7 13:09:13 raspberrypi udhcpd[2034]: max_leases=235 is too big, setting to 19
Nov 7 13:09:13 raspberrypi udhcpd[2034]: can't open '/var/lib/misc/udhcpd.leases': No such file or directory
Nov 7 13:09:13 raspberrypi udhcpd[2034]: is interface wlan0 up and configured?: Cannot assign requested address
Code: Select all
wpa-roam /etc/wpa_supplicant/wpa_supplicant.conf
Code: Select all
auth_algs=0
Code: Select all
auth_algs=1 # for open authentication
auth_algs=2 # for WEP (requires more config, I'll update the tut when I have time)
auth_algs=3 # allow open and WEP
OK, that's weird. This evening I'll run through my tutorial with a fresh copy of Raspbian and see if I run into the same issues. I think the latest image changed some of the default configuration, which is causing issues with my tutorial.poing wrote:I changed the line to auth_algs=1 and commented out the line with wpa-roam, but still a no-go. Then I got a brainwave and disconnected the Ethernet![]()
After about 50 restarts I found I can get my phone and E-reader to connect to the Pi IF:
- I unplug the Ethernet cable
- I send the command "sudo shutdown -r now"
- I next log in and send the command "sudo halt"
- unplug and replug power
Shoot me if you like, but it only works in this combination. I tried everything else, but if I just do a few restarts or a few halts the phone and reader will not connect (also tried to restart the phone and E-reader a few times to make sure the problem isn't them). I realise this seems very unlikely but this is how it seems to work.
Anyway, once I have connection and plug the Ethernet cable in I get Internet on the Pi but not on the phone and E-reader. My guess is that eth0 has to be configured differently and maybe then the crazy restart sequence will not be necessary any more.
Code: Select all
#DAEMON_CONF=""
Code: Select all
DAEMON_CONF="/etc/hostapd/hostapd.conf"
Code: Select all
DHCPD_ENABLED="no"
Code: Select all
auth_algs=0
Code: Select all
auth_algs=1
Code: Select all
wpa-roam /etc/wpa_supplicant/wpa_supplicant.conf
iface default inet dhcp
Code: Select all
interface=wlan0
ssid=My_AP_Name
hw_mode=g
channel=4
wpa=2
wpa_passphrase=My_Passphrase
wpa_key_mgmt=WPA-PSK
wpa_pairwise=CCMP
rsn_pairwise=CCMP
wmm_enabled=1
auth_algs=3
beacon_int=100
Cool! I'll update the tutorial when I get a chance.poing wrote:IT WORKS! IT WORKS! IT WORKS!(dances around like a little kid
)
Thanks for your persistence in pulling us through, although I guess that will teach you to write a tutorial during lunch break without the hardware in front of you![]()
Anyway, all I had to change was comment out "iface default inet dhcp" for all the other changes were already made.
To make this complete, I copied some lines from the sirlagz tutorial to make the AP use WPA2 security. The file /etc/hostapd/hostapd.conf now reads like this:
Thanks again, getting this to work is very important to me.Code: Select all
interface=wlan0 ssid=My_AP_Name hw_mode=g channel=4 wpa=2 wpa_passphrase=My_Passphrase wpa_key_mgmt=WPA-PSK wpa_pairwise=CCMP rsn_pairwise=CCMP wmm_enabled=1 auth_algs=3 beacon_int=100
Per your suggestion, the tutorial is now on the eLinux wiki at http://elinux.org/RPi_Guides. Any problems/suggestions should still be posted in this thread.bredman wrote:A forum is not a good place to write a tutorial. It is difficult to fix errors, nobody can improve it, and it will get lost in the mess in a couple of weeks.
You might be better adding it to the RPi wiki.
http://elinux.org/RPi_Guides
Hmmmhunternet93 wrote: Per your suggestion, the tutorial is now on the eLinux wiki at http://elinux.org/RPi_Guides. Any problems/suggestions should still be posted in this thread.
I fixed the errors you mentioned in the tutorial, thanks. Having a second pair of eyes helps a lot.poing wrote:Hmmmhunternet93 wrote: Per your suggestion, the tutorial is now on the eLinux wiki at http://elinux.org/RPi_Guides. Any problems/suggestions should still be posted in this thread.![]()
Still does not work like it should. After a fresh install of the 2012-10-28 distro, running the tutorial gave success although without Internet connection for the phone, but after a reboot my phone can't connect anymore. I tried renewing the distro several times but every time I have the same result. The same goes for the [Distro] Raspberry Server: Web Edition: http://www.raspberrypi.org/phpBB3/viewt ... 36&t=19702, that I plan on using.
Sadly I lost track of what I did before exactly, which led to a working Access Point, and stupidly I have overwritten the SD card. But I now have a card with a fresh install and only the tutorial on it, so if you can give some pointers what to run I'll post the output.
Some remarks about the tutorial on eLinux;
- Where you write "Edit the file /etc/default/udhcpd.conf and change the line:" this should be "Edit the file /etc/default/udhcpd and change the line:"
- Where you write DAEMON_CONF="/etc/hostapd/hostapd.conf you omitted the last double quote.
- I can't execute sudo iptables-save > /etc/iptables.ipv4.nat as I'm not allowed to do that, had to do "sudo bash #' first; not sure everybody knows that. Subsequently the next commands were issued as root, without sudo. Don't know if that makes any difference.
Code: Select all
sudo service hostapd status
ps ax | grep udhcpd
Code: Select all
sudo ifconfig
sudo iptables --list
Code: Select all
hostapd is running.
Code: Select all
2435 pts/1 S+ 0:00 grep --color=auto udhcpd
Code: Select all
eth0 Link encap:Ethernet HWaddr b8:27:eb:13:26:2e
inet addr:192.168.1.123 Bcast:192.168.1.255 Mask:255.255.255.0
UP BROADCAST RUNNING MULTICAST MTU:1500 Metric:1
RX packets:4025 errors:0 dropped:0 overruns:0 frame:0
TX packets:1762 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 txqueuelen:1000
RX bytes:2765231 (2.6 MiB) TX bytes:213768 (208.7 KiB)
lo Link encap:Local Loopback
inet addr:127.0.0.1 Mask:255.0.0.0
UP LOOPBACK RUNNING MTU:16436 Metric:1
RX packets:0 errors:0 dropped:0 overruns:0 frame:0
TX packets:0 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 txqueuelen:0
RX bytes:0 (0.0 B) TX bytes:0 (0.0 B)
mon.wlan0 Link encap:UNSPEC HWaddr 00-0F-54-0A-AC-E2-00-00-00-00-00-00-00-00-00-00
UP BROADCAST RUNNING MULTICAST MTU:1500 Metric:1
RX packets:716 errors:0 dropped:0 overruns:0 frame:0
TX packets:0 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 txqueuelen:1000
RX bytes:62139 (60.6 KiB) TX bytes:0 (0.0 B)
wlan0 Link encap:Ethernet HWaddr 00:0f:54:0a:ac:e2
UP BROADCAST RUNNING MULTICAST MTU:1500 Metric:1
RX packets:3 errors:0 dropped:0 overruns:0 frame:0
TX packets:3 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 txqueuelen:1000
RX bytes:1036 (1.0 KiB) TX bytes:1090 (1.0 KiB)
Code: Select all
Chain INPUT (policy ACCEPT)
target prot opt source destination
Chain FORWARD (policy ACCEPT)
target prot opt source destination
ACCEPT all -- anywhere anywhere state RELATED,ESTABLISHED
ACCEPT all -- anywhere anywhere
Chain OUTPUT (policy ACCEPT)
target prot opt source destination
I haven't seen any similar errors. It might be power related, does your power adapter put out at least 1 amp? Also, updating shouldn't cause any problems. I'm working out a few issues with my tutorial currently, but I'm sure it'll work.anath3ma wrote:So, I did pretty much the same thing using the sirlagz.net tutorial and have a working hotspot with few complaints.
My one issue right now is: At least once every 24h from
cat /sys/devices/platform/bcm2708_usb/regvalue
i get 'invalid offset'
I'm using a ralink rt5370 wifi
uname -a = Linux raspberrypi 3.1.9+ #272 PREEMPT Tue Aug 7 22:51:44 BST 2012 armv6l GNU/Linux
So, how stable is USB and this adapter for everyone else? Am i alone with these problems? I really don't want to update/upgrade for fear of regressions, unless someone can verify that this combo works for them.
Tangentially related: What if any dwc_otg stability patches have been introduced since my version? I'd love to review them if i could find em.
Thanks
That's your issue right there: udhcpd isn't running. Try running:poing wrote: sudo ps ax | grep udhcpd:Code: Select all
2435 pts/1 S+ 0:00 grep --color=auto udhcpd
Code: Select all
sudo udhcpd -f
Code: Select all
sudo update-rc.d udhcpd enable