Trying to configure wifi AP (with VPN)


97 posts   Page 3 of 4   1, 2, 3, 4
by iOS_Neil » Wed Jun 01, 2016 5:40 pm
Just rebooted. Standing about 4 feet from it. I'll try now forgetting the network and trying again and then on another device...Be 5 minutes..
Posts: 61
Joined: Sun Dec 29, 2013 6:39 pm
by iOS_Neil » Wed Jun 01, 2016 5:46 pm
Ok, tried connecting to another network - fine;
Used my Kindle firestick, found AP, entered easypeasy it came back saying WPA-PSK, signal strength: very good, then signal strength: out of range, then invalid password. RPi was about 6 inches from the fire stick.

Would it be anything to do with the channel (1) ?
Posts: 61
Joined: Sun Dec 29, 2013 6:39 pm
by epoch1970 » Wed Jun 01, 2016 5:51 pm
Unlikely, I'm using the same. Channel 1 is very crowded, but I can't believe you'd receive an auth error for that.
Hmm. I've checked and we positively use the same hex key...
EDIT: Maybe an idea: can you disconnect your keyboard and all that? Maybe those USB devices are pumping too much power.
Also in my recipe I had "max_usb_current=1" in /boot/config.txt. But I'm not using it right now, and the Pi is powered by an USB port of my mac mini, it's not the greatest power source you could imagine and still it works ok.
EDIT: Yeah, another PSU?
Last edited by epoch1970 on Wed Jun 01, 2016 5:58 pm, edited 2 times in total.
"S'il n'y a pas de solution, c'est qu'il n'y a pas de problème." Les Shadoks, J. Rouxel
Posts: 808
Joined: Thu May 05, 2016 9:33 am
by iOS_Neil » Wed Jun 01, 2016 5:57 pm
:( Nothing else plugged into it...No keyboard, mouse..Just the wifi. Shall I try a different power supply?
Posts: 61
Joined: Sun Dec 29, 2013 6:39 pm
by epoch1970 » Wed Jun 01, 2016 6:06 pm
You're using a Pi original version so perhaps the max_usb_current=1 parameter in /boot/config.txt is more critical than on the Pi 2?
If a new PSU doesn't do it, I'm afraid we'll have to go into debug mode...

That would be you repost the hostapd.conf file in full, I try to run it (only country changed) under "-d" or "-dd" and see if I can figure something out of the trace.
EDIT: And also, post your /etc/modprobe.d/8192cu.conf file.
"S'il n'y a pas de solution, c'est qu'il n'y a pas de problème." Les Shadoks, J. Rouxel
Posts: 808
Joined: Thu May 05, 2016 9:33 am
by iOS_Neil » Wed Jun 01, 2016 6:15 pm
Still no joy. I tried looking on the Firestick again and noticed something - it says the security is WPA2-PSK ?

Here's my hostapd:
Code: Select all
# Basic AP parameters
ssid=worky
wpa_psk=6aad4c3ee371b077d2eb402ffe2428eb41021e4e8926da0e4da3d87859d48d4e
interface=wlan0
bridge=br0
channel=1
country_code=GB
# From Realtek docs
max_num_sta=8
# hostapd-rtl specific driver
driver=rtl871xdrv

# WPA 2 PSK
wpa=2
auth_algs=1
wpa_key_mgmt=WPA-PSK
rsn_pairwise=CCMP

# 2.4 GHz
hw_mode=g
# Wifi-N
ieee80211n=1
# QoS support - Can't find out if it's called wme or wmm !!
wme_enabled=1
wmm_enabled=1
# Avoid crash at startup with Realtek RTL8188CUS
noscan=1
# from Realtek's docs Quick_Start_Guide_for_SoftAP.pdf and
# SoftAP_Mode_features.pdf. The [DSSS_CCK-40][MAX-AMSDU-7935]
# part comes from the interweb. Use [HT40-] or [HT40+]
ht_capab=[SHORT-GI-20][SHORT-GI-40][HT40+][DSSS_CCK-40][MAX-AMSDU-7935]

And my /etc/modprobe.d/8192cu.conf
Code: Select all
options 8192cu rtw_power_mgnt=0 rtw_enusbss=0 rtw_hwpwrp_detect=0 rtw_ips_mode=1
# From Realtek's doc
# rtw_power_mgnt=1 is Min powersaving, =2 is max powersave, =0 is disable
# rtw_enusbss=0 is default, disable USB autosuspend =1 is enable.
# rtw_hwpwrp_detect=0 is disable hw power pin "RF on/off" detection, =1 is enab$
# rtw_ips_mode=0 is default, max powersave when unassociated, =1 is the faster,$
#
# From: http://curiouser.cheshireeng.com/2015/05/27/raspberry-pi-wifi-stability/
# options 8192cu rtw_power_mgnt=0 rtw_enusbss=1 rtw_ips_mode=1

I'm so sorry for all this!
Posts: 61
Joined: Sun Dec 29, 2013 6:39 pm
by epoch1970 » Wed Jun 01, 2016 6:17 pm
iOS_Neil wrote:I'm so sorry for all this!

Well I understood that was an AP right now or... :)

I'll see what I can do with your files. Keep you posted.
"S'il n'y a pas de solution, c'est qu'il n'y a pas de problème." Les Shadoks, J. Rouxel
Posts: 808
Joined: Thu May 05, 2016 9:33 am
by iOS_Neil » Wed Jun 01, 2016 6:20 pm
:lol:

Thanks! I'll check back and see how you get on :)
Posts: 61
Joined: Sun Dec 29, 2013 6:39 pm
by epoch1970 » Wed Jun 01, 2016 6:35 pm
Yes, WPA-PSK2 is what we want.

I haven't run the files yet, but I've compared them.
We seem to have the same 8192cu.conf file (although you probably did cut/paste from the nano window, commented lines are truncated with '$')
But there might be a difference in the hostapd.conf file. The last line on your file does not include a carriage return. Mine has 2 CRs. It could be the effect of pasting to the forum, I'll see if running it as is breaks things for me. That line is about the radio config, it hope it breaks my AP...

EDIT: plus we have a diff on the ssid name??
Code: Select all
root@raspberrypi:/etc/hostapd# diff hostapd.conf hostapd.conf.epoch1970
2d1
< ssid=worky
3a3
> ssid=worky
7c7
< country_code=GB
---
> country_code=FR
9a10
>
31c32,33
< ht_capab=[SHORT-GI-20][SHORT-GI-40][HT40+][DSSS_CCK-40][MAX-AMSDU-7935]
\ No newline at end of file
---
> ht_capab=[SHORT-GI-20][SHORT-GI-40][HT40+][DSSS_CCK-40][MAX-AMSDU-7935]
>
root@raspberrypi:/etc/hostapd#

EDIT2: Crap. It works for me, even with country=GB...
"S'il n'y a pas de solution, c'est qu'il n'y a pas de problème." Les Shadoks, J. Rouxel
Posts: 808
Joined: Thu May 05, 2016 9:33 am
by iOS_Neil » Wed Jun 01, 2016 7:18 pm
:( Just wish I could be looking into things at this end too but I'm completely clueless! Do you think it's tje RPi itself that can't handle it?

EDIT: Just spoken to my brother in law. He has a RPi 2 he's going to lend me - I'll put the SD in that one and se what happens...If it works, it has to be my RPi...?
Posts: 61
Joined: Sun Dec 29, 2013 6:39 pm
by epoch1970 » Wed Jun 01, 2016 7:25 pm
iOS_Neil wrote::( Just wish I could be looking into things at this end too but I'm completely clueless! Do you think it's tje RPi itself that can't handle it?

I don't know... I'm not too good at reading hostapd traces, mine or yours.
It could have something to do with timings (Pi too slow?), or power feed. I'm looking at defining a few hostapd.conf that might be more tolerant (or plain better), and push that to you for testing. Past that, I don't know.
"S'il n'y a pas de solution, c'est qu'il n'y a pas de problème." Les Shadoks, J. Rouxel
Posts: 808
Joined: Thu May 05, 2016 9:33 am
by JPWhite » Wed Jun 01, 2016 7:29 pm
Rather than get Raspbian to act as a wifi device/AP why not install OpenWrt instead?

https://www.all4os.com/router/how-to-install-openwrt-on-raspberry-pi.html

JP
RPi3 configured as Google Cloud Print Server.
2nd RPi3 on order.
User avatar
Posts: 6
Joined: Sat May 28, 2016 2:13 am
by epoch1970 » Wed Jun 01, 2016 7:33 pm
This is an OPEN ap config. I could connect an iphone and an ipad, same as half the neighborhood I guess :D
I have gzipped the file. Uncompress it with "gzip -d hostapd.conf.open.gz"
Then try it with "sudo hostapd -d ./hostapd.conf.open"
hostapd.conf.open.gz
(233 Bytes) Downloaded 29 times
"S'il n'y a pas de solution, c'est qu'il n'y a pas de problème." Les Shadoks, J. Rouxel
Posts: 808
Joined: Thu May 05, 2016 9:33 am
by epoch1970 » Wed Jun 01, 2016 7:37 pm
JPWhite wrote:Rather than get Raspbian to act as a wifi device/AP why not install OpenWrt instead?

https://www.all4os.com/router/how-to-install-openwrt-on-raspberry-pi.html

JP

I think *we* terribly want to see this Pi run hostapd under raspbian :)
But this is certainly a good option if we fail in the end.
"S'il n'y a pas de solution, c'est qu'il n'y a pas de problème." Les Shadoks, J. Rouxel
Posts: 808
Joined: Thu May 05, 2016 9:33 am
by iOS_Neil » Wed Jun 01, 2016 7:40 pm
epoch1970 wrote:This is an OPEN ap config. I could connect an iphone and an ipad, same as half the neighborhood I guess :D
I have gzipped the file. Uncompress it with "gzip -d hostapd.conf.open.gz"
Then try it with "sudo hostapd -d ./hostapd.conf.open"
hostapd.conf.open.gz


"Unable to join the network "worky" " :|

Hopefully, my B.I.L. will be round soon - I'll let you know how that goes...I'm starting to be pretty convinced it's my Pi.
Posts: 61
Joined: Sun Dec 29, 2013 6:39 pm
by iOS_Neil » Wed Jun 01, 2016 7:42 pm
epoch1970 wrote:
JPWhite wrote:Rather than get Raspbian to act as a wifi device/AP why not install OpenWrt instead?

https://www.all4os.com/router/how-to-install-openwrt-on-raspberry-pi.html

JP

I think *we* terribly want to see this Pi run hostapd under raspbian :)
But this is certainly a good option if we fail in the end.


Agreed...Thanks JP. I'm at a point now where, "this bloody thing isn't going to beat me, it WILL work"! Ultimately, if it's because my Pi can't handle it, fair enough and I will need to look at something else so will definitely keep it in mind.
Posts: 61
Joined: Sun Dec 29, 2013 6:39 pm
by epoch1970 » Wed Jun 01, 2016 7:50 pm
iOS_Neil wrote:
epoch1970 wrote:This is an OPEN ap config. I could connect an iphone and an ipad, same as half the neighborhood I guess :D
I have gzipped the file. Uncompress it with "gzip -d hostapd.conf.open.gz"
Then try it with "sudo hostapd -d ./hostapd.conf.open"
The attachment hostapd.conf.open.gz is no longer available


"Unable to join the network "worky" " :|

Man, I don't know what to say. With open, we remove any chance the Pi spends too much time computing keys or stuff. Gzip removes the copy-paste operation.
The only diff is that I run Pi 2, not Pi...
Do you use a custom /boot/config.txt file?

I will post below a wpa+wpa2 conf I just tested fine, and a wpa2-only version (normally you'd want this one), they are closer to what Jeka Der packaged as default config, and they work on my Pi 2. I can't see what the problem is... :(

Hopefully, my B.I.L. will be round soon - I'll let you know how that goes...I'm starting to be pretty convinced it's my Pi.

Is he angry, now? :D
The attachment hostapd.conf.wpa+wpa2.gz is no longer available

hostapd.conf.wpa+wpa2.gz
(523 Bytes) Downloaded 25 times
Last edited by epoch1970 on Wed Jun 01, 2016 8:00 pm, edited 1 time in total.
"S'il n'y a pas de solution, c'est qu'il n'y a pas de problème." Les Shadoks, J. Rouxel
Posts: 808
Joined: Thu May 05, 2016 9:33 am
by iOS_Neil » Wed Jun 01, 2016 7:58 pm
epoch1970 wrote:Is he angry, now? :D

He'll be angry if it works and I refuse to give him his Pi back :lol:

My config.txt is standard - everything was commented out except:
Code: Select all
dtparam=audio=on

I tried adding
Code: Select all
max_usb_current=1

but it made no difference.
Posts: 61
Joined: Sun Dec 29, 2013 6:39 pm
by epoch1970 » Wed Jun 01, 2016 8:05 pm
:(
I don't know why but I couldn't manage adding 2 attachments to the same post. Here is the wpa2-only file.
hostapd.conf.wpa2only.gz
(521 Bytes) Downloaded 28 times


I'm signing off for now, but I'm subscribed to the thread. Yell if your can make it work...
"S'il n'y a pas de solution, c'est qu'il n'y a pas de problème." Les Shadoks, J. Rouxel
Posts: 808
Joined: Thu May 05, 2016 9:33 am
by iOS_Neil » Wed Jun 01, 2016 8:06 pm
I just tried connecting to the unsecured one with my laptop, I saw some output on the Pi:
Code: Select all
wlan0: Setup of interface done.
+rtl871x_get_sta_wpaie, 20:10:7a:26:c4:15 is sta's address
wlan0: Event ASSOC (0) received
wlan0: STA 20:10:7a:26:c4:15 IEEE 802.11: associated
STA did not include WPS/RSN/WPA IE in (Re)AssocReq
  New STA
ap_sta_add: register ap_handle_timer timeout for 20:10:7a:26:c4:15 (300 seconds - ap_max_inactivity)
wlan0: AP-STA-CONNECTED 20:10:7a:26:c4:15
wlan0: STA 20:10:7a:26:c4:15 RADIUS: starting accounting session 574F3F7C-00000000
IEEE 802.1X: Ignore STA - 802.1X not enabled or forced for WPS
hostapd_new_assoc_sta: reschedule ap_handle_timer timeout for 20:10:7a:26:c4:15 (300 seconds - ap_max_inactivity)
^CSignal 2 received - terminating
hostapd_interface_deinit_free(0x8df128)
hostapd_interface_deinit_free: num_bss=1 conf->num_bss=1
hostapd_interface_deinit(0x8df128)
wlan0: interface state ENABLED->DISABLED
hostapd_bss_deinit: deinit bss wlan0
wlan0: STA 20:10:7a:26:c4:15 MLME: MLME-DEAUTHENTICATE.indication(20:10:7a:26:c4:15, 1)
wlan0: STA 20:10:7a:26:c4:15 MLME: MLME-DELETEKEYS.request(20:10:7a:26:c4:15)
Removing station 20:10:7a:26:c4:15
wlan0: AP-STA-DISCONNECTED 20:10:7a:26:c4:15
+rtl871x_sta_remove_ops, 20:10:7a:26:c4:15 is sta address removed
hostapd_ht_operation_update current operation mode=0x0
hostapd_ht_operation_update new operation mode=0x0 changes=0
ap_free_sta: cancel ap_handle_timer for 20:10:7a:26:c4:15
wlan0: Flushing old station entries
wlan0: Deauthenticate all stations
+rtl871x_sta_deauth_ops, ff:ff:ff:ff:ff:ff is deauth, reason=3
rtl871x_set_key_ops
rtl871x_set_key_ops
rtl871x_set_key_ops
rtl871x_set_key_ops
wlan0: AP-DISABLED
hostapd_cleanup(hapd=0x8dfd28 (wlan0))
hostapd_free_hapd_data(wlan0)
hostapd_interface_deinit_free: driver=0x7582c drv_priv=0x8df640 -> hapd_deinit
hostapd_interface_free(0x8df128)
hostapd_interface_free: free hapd 0x8dfd28
hostapd_cleanup_iface(0x8df128)
hostapd_cleanup_iface_partial(0x8df128)
hostapd_cleanup_iface: free iface=0x8df128
ELOOP: remaining socket: sock=7 eloop_data=0x8e03c0 user_data=(nil) handler=0x435a8
pi@raspberrypi:/etc/hostapd $


??
Posts: 61
Joined: Sun Dec 29, 2013 6:39 pm
by iOS_Neil » Wed Jun 01, 2016 8:11 pm
epoch1970 wrote::(
I don't know why but I couldn't manage adding 2 attachments to the same post. Here is the wpa2-only file.
hostapd.conf.wpa2only.gz


I'm signing off for now, but I'm subscribed to the thread. Yell if your can make it work...

"Incorrect password" - easypeasy

Ah well...Thanks so much for all your help over the past 2 days. It's thoroughly appreciated and a real step above the call of duty :)
Posts: 61
Joined: Sun Dec 29, 2013 6:39 pm
by epoch1970 » Wed Jun 01, 2016 8:14 pm
^CSignal 2 received - terminating

Did you ctrl-c in the window? I'm not sure that trace was showing something bad.

And yeah, tough luck.
Now you see why my original forum post was written as it was... Perhaps if you can put the SD in a Pi2 it would work?
"S'il n'y a pas de solution, c'est qu'il n'y a pas de problème." Les Shadoks, J. Rouxel
Posts: 808
Joined: Thu May 05, 2016 9:33 am
by iOS_Neil » Wed Jun 01, 2016 8:19 pm
epoch1970 wrote:
^CSignal 2 received - terminating

Did you ctrl-c in the window? I'm not sure that trace was showing something bad.

And yeah, tough luck.
Now you see why my original forum post was written as it was... Perhaps if you can put the SD in a Pi2 it would work?


No, didn't crtl-c out.

No worries, I'll hold fire and wait for the Pi2 and will let you know...
Posts: 61
Joined: Sun Dec 29, 2013 6:39 pm
by iOS_Neil » Thu Jun 02, 2016 8:36 pm
Evening :)

Well...Borrowed the Pi2 and facing the same problems I had with mine. I think I may wait until the weekend with spare time and start from scratch again, format card and start right at the top.

Neil.
Posts: 61
Joined: Sun Dec 29, 2013 6:39 pm
by epoch1970 » Thu Jun 02, 2016 10:00 pm
iOS_Neil wrote:Evening :)

Well...Borrowed the Pi2 and facing the same problems I had with mine. I think I may wait until the weekend with spare time and start from scratch again, format card and start right at the top.

Neil.

This is getting seriously weird. This is a long post, make sure you don't miss the hostapd-rt binary package I've linked at the end.

Can you check you run the same OS as I do, with similar boot options? (no need to be logged in as root for any of these commands, and besides this is bad practice. Just run the commands as normal user pi)
Code: Select all
root@raspberrypi:~# uname -a
Linux raspberrypi 4.4.11-v7+ #888 SMP Mon May 23 20:10:33 BST 2016 armv7l GNU/Linux

root@raspberrypi:/home/pi# cat /proc/cmdline
dma.dmachans=0x7f35 bcm2708_fb.fbwidth=656 bcm2708_fb.fbheight=416 bcm2709.boardrev=0xa01041 bcm2709.serial=0x50b5d749 smsc95xx.macaddr=B8:27:EB:XX:YY:ZZ bcm2708_fb.fbswap=1 bcm2709.uart_clock=3000000 bcm2709.disk_led_gpio=47 bcm2709.disk_led_active_low=0 vc_mem.mem_base=0x3dc00000 vc_mem.mem_size=0x3f000000  dwc_otg.lpm_enable=0 console=ttyAMA0,115200 console=tty1 root=/dev/mmcblk0p2 rootfstype=ext4 elevator=deadline fsck.repair=yes rootwait

root@raspberrypi:~# cat /boot/cmdline.txt
dwc_otg.lpm_enable=0 console=serial0,115200 console=tty1 root=/dev/mmcblk0p2 rootfstype=ext4 elevator=deadline fsck.repair=yes rootwait


Does your wpa_supplicant.conf file for wlan0 (it is referred to in /etc/network/interfaces) look like this?
Code: Select all
root@raspberrypi:/home/pi# cat /etc/wpa_supplicant/wpa_supplicant.conf
country=FR
ctrl_interface=DIR=/var/run/wpa_supplicant GROUP=netdev
update_config=1


Also verify you can ping something like www(dot)google(dot)com from the machine, and install the hostapd I compiled the other day, from this dropbox link.
After the DL, on your pi, check the file was not altered during transport (you must get the same signature):
Code: Select all
root@raspberrypi:/usr/src# md5sum hostapd-rtl_2.4-4_armhf.deb
773fc8b363b697a90a9f30c28cd4ea0d  hostapd-rtl_2.4-4_armhf.deb

Then set aside /etc/hostapd/hostapd.conf as it will get overwritten, and install my binary:
Code: Select all
sudo dpkg -i hostapd-rtl_2.4-4_armhf.deb


Except the ethernet cable and the USB card, nothing is attached to my Pi: no screen, and I am not logged in the graphical user interface. I access the Pi via ssh from another machine.

Fingers crossed...
Last edited by epoch1970 on Fri Jun 03, 2016 12:24 pm, edited 1 time in total.
"S'il n'y a pas de solution, c'est qu'il n'y a pas de problème." Les Shadoks, J. Rouxel
Posts: 808
Joined: Thu May 05, 2016 9:33 am