Raspberry Pi PirateBox

Posted by uraliss 
This forum is currently read only. You can not log in or make any changes. This is a temporary situation.
Now, this forum is in read-only mode. You find details Details hereContinue on /r/PirateBox
Re: Raspberry Pi PirateBox
March 06, 2013 01:22PM
refering to the elinux.org wiki it should work without any additional steps [elinux.org]

can you check if "hostapd" shows up in the output of "ps ax" ?
Re: Raspberry Pi PirateBox
March 06, 2013 01:30PM
"can you check if "hostapd" shows up in the output of "ps ax" ? " hum.... how do I do that??
Thanks
Re: Raspberry Pi PirateBox
March 06, 2013 01:31PM
boot up and run

ps ax | grep hostapd

post the output
Re: Raspberry Pi PirateBox
March 06, 2013 01:42PM
Thanks. I get:
2166 ? S 0.00 /usr/sbin/hostapd /opt/piratebox/conf/hostapd.conf
2465 tty1 S+ 0.00 grep --color=auto hostapd
I get the same with WIPI direct on pi (succesful boot) and ALFA direct (unsuccessful) except for later 2465 is 2454
Re: Raspberry Pi PirateBox
March 06, 2013 02:28PM
what exactly does not work with the alpha card?

Aren't you able to see a SSID?
Aren't you able to connect?
Don't you get an IP address?
or is it the nasty ifconfig (wlan0 has no IP) problem?
Re: Raspberry Pi PirateBox
March 06, 2013 03:03PM
I can see an SSID but wifi client on a laptop pc can't get an IP address - 'Limited or no connectivety' The same fault symptom as before. This morning ALFA failed 6 out of 6. This afternoon ok 1 of 3 with ALFA direct on pi, ok 1 of 3 with ALFA via powered hub. In both cases it was cold boot that worked and reboots that didn't.
Re: Raspberry Pi PirateBox
March 06, 2013 03:25PM
then please run

ps ax | grep dnsmasq
ifconfig

and post the output please
Re: Raspberry Pi PirateBox
March 06, 2013 04:27PM
ps ax | grep dnsmasq
2208 ? S 0:00 /usr/sbin/dnsmasq -x /var/run/piratebox_dnsmasq.pid -C /opt/piratebox/conf/dnsmasq_generated.conf
2449 tty1 S+ 0:00 grep --color=auto dnsmasq

ifconfig
eth0 Link encap:Ethernet HWaddr b8:27:eb:0a:54:7e
inet addr:192.168.1.79 Bcast:192.168.1.255 Mask:255.255.255.0
UP BROADCAST RUNNING MULTICAST MTU:1500 Metric:1
Rx packets:171 errors:0 dropped:0 overruns:0 frame:0
Tx packets:48 errors:0 dropped:0 oerruns:0 carrier:0
collisions:0 txqueuelen:1000
RX bytes:12703 (12.4Kicool smiley TXbytes:4900 (4.7Kicool smiley

lo Link encap:Local Loopback
inet addr:127.0.0.1 Mask:255.0.0.0
UP LOOPBACK RUNNING MULTICAST MTU:16436Metric:1
Rx packets: 0 errors:0 dropped:0 overruns:0 frame:0
Tx packets:0 errors:0 dropped:0 oerruns:0 carrier:0
collisions:0 txqueuelen:1000
RX bytes:0 (0.0 cool smiley TXbytes:0 (0.0 cool smiley

mon.wlan0 Link encap:UNSPEC HWaddr 00-C0-CA-58-E3-87-00-00-00-00-00-00-00-00-00-00
UP BROADCAST RUNNING MULTICAST MTU:1500 Metric:1
Rx packets:1749 errors:0 dropped:0 overruns:0 frame:0
Tx packets:0 errors:0 dropped:0 oerruns:0 carrier:0
collisions:0 txqueuelen:1000
RX bytes:7520 (7.3Kicool smiley TXbytes:8546 (8.3Kicool smiley

wlan0 Link encap:Ethernet HWaddr 00:c0:ca:58:e3:87
UP BROADCAST RUNNING MULTICAST MTU:1500 Metric:1
Rx packets:57 errors:0 dropped:0 overruns:0 frame:0
Tx packets:57 errors:0 dropped:0 oerruns:0 carrier:0
collisions:0 txqueuelen:1000
RX bytes:7520 (7.3Kicool smiley TXbytes:8546 (8.3Kicool smiley

The above is from a failed run with the ALFA direct on the pi. Comparing it to a successful run with WIPI direct on pi the latter has an additional line in wlan0: (and the RX/TX count nos are different)
inet addr:192.168.77.1 Bcast:192.168.77.255 Mask:255.255.255.0
Re: Raspberry Pi PirateBox
March 06, 2013 04:51PM
yeah exact, this is the problem with the ip address again
Re: Raspberry Pi PirateBox
March 07, 2013 07:32PM
can you please post the complete output of the command "iw" while your Alfa-Wifi is attached ?

Edit, the card you are using, uses the rt200usb driver, correct?

Edit 2: please post the output lsusb



Edited 2 time(s). Last edit at 03/07/2013 07:36PM by Matthias.
Re: Raspberry Pi PirateBox
March 08, 2013 03:52PM
This is the output of lsusb (It's identical on runs where ALFA boots ok and where it doesn't)
Bus 001 Device 001: ID 1d6b:0002 Linux Foundation 2.0 root hub
Bus 001 Device 002: ID 0424:9512 Standard Microsystems Corp.
Bus 001 Device 003: ID 0424:ec00 Standard Microsystems Corp.
Bus 001 Device 004: ID 1c4f:0002 Sigma Micro Keyboard Tracer Gamma Ivory
Bus 001 Device 005: ID 148f:3070 Ralink Technology, Corp. RT2870/RT3070 Wireless Adapter

How do I find the rt200usb driver info?

output of iw is 1.5pages of boot screen - don't know how to efficiently capture that. I've taken screen shots with camera of 'visible' page and it is the same wether successful or not.

The WIPI has been exhibiting the IP boot prob today but still seems more successful than ALFA
Thanks for help
Re: Raspberry Pi PirateBox
March 11, 2013 06:46AM
run

 iw phy phy0 info
Re: Raspberry Pi PirateBox
March 11, 2013 02:50PM
Hi - Thats another 1.5 pages of screen so same prob. Is there a specific line(s) I can capture or send you a jpg? Nothing stands out with warning message.
Re: Raspberry Pi PirateBox
March 11, 2013 04:16PM
you can always redirect output with a >

so
 iw phy phy0 info  > iw-info.txt

then you have txt file for copy& paste it
Re: Raspberry Pi PirateBox
March 11, 2013 05:00PM
Thanks - thats a lot easier. Here it is:

Wiphy phy0
Band 1:
Capabilities: 0x172
HT20/HT40
Static SM Power Save
RX Greenfield
RX HT20 SGI
RX HT40 SGI
RX STBC 1-stream
Max AMSDU length: 3839 bytes
No DSSS/CCK HT40
Maximum RX AMPDU length 65535 bytes (exponent: 0x003)
Minimum RX AMPDU time spacing: 2 usec (0x04)
HT RX MCS rate indexes supported: 0-7, 32
TX unequal modulation not supported
HT TX Max spatial streams: 1
HT TX MCS rate indexes supported may differ
Frequencies:
* 2412 MHz [1] (20.0 dBm)
* 2417 MHz [2] (20.0 dBm)
* 2422 MHz [3] (20.0 dBm)
* 2427 MHz [4] (20.0 dBm)
* 2432 MHz [5] (20.0 dBm)
* 2437 MHz [6] (20.0 dBm)
* 2442 MHz [7] (20.0 dBm)
* 2447 MHz [8] (20.0 dBm)
* 2452 MHz [9] (20.0 dBm)
* 2457 MHz [10] (20.0 dBm)
* 2462 MHz [11] (20.0 dBm)
* 2467 MHz [12] (20.0 dBm) (passive scanning, no IBSS)
* 2472 MHz [13] (20.0 dBm) (passive scanning, no IBSS)
* 2484 MHz [14] (20.0 dBm) (passive scanning, no IBSS)
Bitrates (non-HT):
* 1.0 Mbps
* 2.0 Mbps (short preamble supported)
* 5.5 Mbps (short preamble supported)
* 11.0 Mbps (short preamble supported)
* 6.0 Mbps
* 9.0 Mbps
* 12.0 Mbps
* 18.0 Mbps
* 24.0 Mbps
* 36.0 Mbps
* 48.0 Mbps
* 54.0 Mbps
max # scan SSIDs: 4
max scan IEs length: 2257 bytes
Coverage class: 0 (up to 0m)
Supported Ciphers:
* WEP40 (00-0f-ac:1)
* WEP104 (00-0f-ac:5)
* TKIP (00-0f-ac:2)
* CCMP (00-0f-ac:4)
Available Antennas: TX 0 RX 0
Supported interface modes:
* IBSS
* managed
* AP
* AP/VLAN
* WDS
* monitor
* mesh point
software interface modes (can always be added):
* AP/VLAN
* monitor
interface combinations are not supported
Supported commands:
* new_interface
* set_interface
* new_key
* new_beacon
* new_station
* new_mpath
* set_mesh_params
* set_bss
* authenticate
* associate
* deauthenticate
* disassociate
* join_ibss
* join_mesh
* remain_on_channel
* set_tx_bitrate_mask
* action
* frame_wait_cancel
* set_wiphy_netns
* set_channel
* set_wds_peer
* connect
* disconnect
Supported TX frame types:
* IBSS: 0x00 0x10 0x20 0x30 0x40 0x50 0x60 0x70 0x80 0x90 0xa0 0xb0 0xc0 0xd0 0xe0 0xf0
* managed: 0x00 0x10 0x20 0x30 0x40 0x50 0x60 0x70 0x80 0x90 0xa0 0xb0 0xc0 0xd0 0xe0 0xf0
* AP: 0x00 0x10 0x20 0x30 0x40 0x50 0x60 0x70 0x80 0x90 0xa0 0xb0 0xc0 0xd0 0xe0 0xf0
* AP/VLAN: 0x00 0x10 0x20 0x30 0x40 0x50 0x60 0x70 0x80 0x90 0xa0 0xb0 0xc0 0xd0 0xe0 0xf0
* mesh point: 0x00 0x10 0x20 0x30 0x40 0x50 0x60 0x70 0x80 0x90 0xa0 0xb0 0xc0 0xd0 0xe0 0xf0
* P2P-client: 0x00 0x10 0x20 0x30 0x40 0x50 0x60 0x70 0x80 0x90 0xa0 0xb0 0xc0 0xd0 0xe0 0xf0
* P2P-GO: 0x00 0x10 0x20 0x30 0x40 0x50 0x60 0x70 0x80 0x90 0xa0 0xb0 0xc0 0xd0 0xe0 0xf0
Supported RX frame types:
* IBSS: 0xd0
* managed: 0x40 0xd0
* AP: 0x00 0x20 0x40 0xa0 0xb0 0xc0 0xd0
* AP/VLAN: 0x00 0x20 0x40 0xa0 0xb0 0xc0 0xd0
* mesh point: 0xb0 0xc0 0xd0
* P2P-client: 0x40 0xd0
* P2P-GO: 0x00 0x20 0x40 0xa0 0xb0 0xc0 0xd0
Re: Raspberry Pi PirateBox
March 12, 2013 06:25AM
Ok, your device is able to...
It is the ALFA AWUS036NH correct?

If yes, I'm going to buy me one....
Re: Raspberry Pi PirateBox
March 12, 2013 09:30AM
Yes its an AWUS036NH - but it isn't the only wifi adapter I'm having probs with. The IP failure on bootup happens in about 80% of boots on the ALFA compared with about 20% on the WIPI adapter
Re: Raspberry Pi PirateBox
March 12, 2013 09:42AM
Because the alfa is cause the most trouble, I'll use this one.

Thanks
Matthias
Re: Raspberry Pi PirateBox
March 12, 2013 05:31PM
I want to use WINSCP to SSH into the PI, dump lots of DATA on the SD card. I can then also control some of the content.

Where the location of the folder for the data than can be shared, i've seen nothing
Re: Raspberry Pi PirateBox
March 12, 2013 07:05PM
/opt/piratebox/shared
Re: Raspberry Pi PirateBox
March 14, 2013 02:54PM
Matthias Wrote:
-------------------------------------------------------
> /opt/piratebox/shared


Thank you
Re: Raspberry Pi PirateBox
March 14, 2013 08:06PM
Matthias Wrote:
-------------------------------------------------------

> this works and is double tested.
>
> edit: If you give me the feedback that it works,
> I'll upload a new RPi image containing the new
> sources

Sorry, been out for a bit....

I installed the patches give above, and did some testing.

When running with the patched piratebox_setup_wlan.sh file, it seemed that I was getting about a 50-50
chance of the wlan0 interface being configured after full bootup. Pulling the power (which is forcing an fsck),
seems to be the most likely way for it to fail.

I never entered the wait loop in the patched code after the ifconfig "$INTERFACE". There was never a "."
printed out after "Probing interface". This includes failures of the interface to be configured, as well as when
the interface was configured properly.

I threw in some debug statements to see what was going on. I was outputting "ifconfig $INTERFACE" after the
assignment of the IP and NETMASK (ifconfig $INTERFACE $IP netmask $NETMASK), and saw that everything
was OK with the wlan0 interface (IP and netmask assigned). Then I login to the system, and run ifconfig wlan0,
and find that wlan0 has no IP or netmask!

My conclusion is that the configuration of the interface in piratebox_setup_wlan0.sh script is fine (without the
checking delay loops), and that something else after this script is causing a problem. I'll keep digging as I get
time.
Re: Raspberry Pi PirateBox
March 14, 2013 09:11PM
OK, it appears that we are losing the wlan0 configuration when hostapd is being started from /etc/init.d/piratebox.

Also note that killing hostapd on a system with a configured wlan0, will cause wlan0 to be de-configured.
Re: Raspberry Pi PirateBox
March 14, 2013 10:00PM
that can be. my first idea was to change the order of the steps done during bootup.
but this would take some testing.

maybe you can try it for yourself and give feedback? I'm a bit out of time.

in fact I can't understand why it only causes trouble on startup and not during manual start. sad smiley

btw: I did the same test like you (ifconfig at every step) and this reduced the effect sad smiley

a debug output out hostapd into a logfile should be useful too.
Re: Raspberry Pi PirateBox
March 14, 2013 11:59PM
How do i change it to share via USB? I have a 250GB drive thats screaming for this
Re: Raspberry Pi PirateBox
March 15, 2013 06:25AM
you have to enable an automount of you usb device and then link/move the shared folder, like

mv /opt/piratebox/share  <usb-mountpoint>
ln -s <usb-mountpoint>/share  /opt/piratebox/share

this may help.
Re: Raspberry Pi PirateBox
March 16, 2013 04:44PM
Hi,
about the start-up problem with the alfa-device.:

I received my Alfa today and made a short test:

1. Yes, I can reproduce it on every reboot
2. Yes, if you move the setup-wlan script in the startup, the ip stays assigned after bootup.

It seems that the alfa-driver reinitializes the wlan0, I came to the conclusion, that it must be the driver behavior because it does not appear on any other usb stick.

I'll provide a fix soon.

Stay tuned,
Matthias
Re: Raspberry Pi PirateBox
March 17, 2013 08:41PM
Matthias Wrote:
-------------------------------------------------------
> you have to enable an automount of you usb device
> and then link/move the shared folder, like
>
>
> mv /opt/piratebox/share
> ln -s /share /opt/piratebox/share
>
>
> this may help.


Tried doing this an getting some massive errors. Maybe I'm doing it wrong. Have a USB 3 128GB USB now to use.
Re: Raspberry Pi PirateBox
March 19, 2013 10:51PM
I've been having the same problem with my Alfa. I have been able to make a jerry rig fix... I noticed that if I ran the pirate box script twice in a row with out stopping it everything worked ... every time.

so what I did was create another script and placing it in /etc/init.d/ that would start your piratebox script twice and then added that my script to update-rc.d

rebooted multiple times and everything looks to be working smiling smiley

I know it's not the most elegant fix... but it works so far
Re: Raspberry Pi PirateBox
March 22, 2013 05:14PM
I created a fix today [github.com]

I'm currently testing it...