Tutorial [HOW-TO] Have a homemade Streetpass Relay

  • Thread starter Thread starter dicamarques
  • Start date Start date
  • Views Views 2,174,476
  • Replies Replies 7,502
  • Likes Likes 27

What method you are using?

  • Linux

    Votes: 93 7.9%
  • Android

    Votes: 133 11.4%
  • Router

    Votes: 226 19.3%
  • Windows

    Votes: 426 36.4%
  • A pony with a wifi antenna O.o?

    Votes: 292 25.0%

  • Total voters
    1,170
Status
Not open for further replies.
Try to relocate nmcli nm wifi off before both rfkill


Looks like it has the same or similar errors. I've restarted the machine because the wlan0 wasn't working correctly after the changes. I've started nzone, some errors shown, stoped it, started it again, and more errors than before. Here's the output:
12:15:12 ~$ sudo /usr/local/sbin/nzone status
nzone is not running
12:15:29 ~$ sudo /usr/local/sbin/nzone start BASE256
starting nzone
net.ipv4.ip_forward = 1
Configuration file: /etc/wlan0_hostap.conf
nl80211: Could not configure driver mode
nl80211 driver initialization failed.
hostapd_free_hapd_data: Interface wlan0 wasn't started
12:15:41 ~$ sudo /usr/local/sbin/nzone stop
stopping nzone
network-manager stop/waiting
network-manager start/running, process 3573
Configuration file: /etc/wlan0_hostap.conf
Using interface wlan0 with hwaddr c4:85:08:1c:cf:6e and ssid "NZ@McD1"
Failed to set beacon parameters
wlan0: Unable to setup interface.
wlan0: Could not connect to kernel driver
12:15:55 ~$ sudo /usr/local/sbin/nzone start BASE256
starting nzone
net.ipv4.ip_forward = 1
SIOCSIFFLAGS: Operación imposible por estar la radiofrecuencia desactivada
SIOCSIFFLAGS: Operación imposible por estar la radiofrecuencia desactivada
Configuration file: /etc/wlan0_hostap.conf
rfkill: WLAN hard blocked
rfkill: WLAN soft blocked
Could not set interface wlan0 flags (UP): Operation not possible due to RF-kill
wlan0: Could not connect to kernel driver
Using interface wlan0 with hwaddr c4:85:08:1c:cf:6e and ssid "NZ@McD1"
Failed to set beacon parameters
wlan0: Unable to setup interface.
wlan0: Could not connect to kernel driver
ELOOP: remaining timeout: -1.936196 eloop_data=0xd15d80 user_data=0xd150e0 handler=0x4450d0

I don't know man, maybe I should write a simple .sh which reads a mac file, uses "macchanger -m $MAC wlan0" and does the iptables and hostapd stuff...
 
Looks like it has the same or similar errors. I've restarted the machine because the wlan0 wasn't working correctly after the changes. I've started nzone, some errors shown, stoped it, started it again, and more errors than before. Here's the output:
I don't know man, maybe I should write a simple .sh which reads a mac file, uses "macchanger -m $MAC wlan0" and does the iptables and hostapd stuff...
My script IS the simple shell file, the problem is how Ubuntu 14 and network manager works with wireless driver and how hostapd is affected with that.
There is no problem with changing MAC, just try
ifconfig wlan0
ifconfig wlan0 down hw ether 00:11:22:33:44:55 up
ifconfig wlan0
 
My script IS the simple shell file, the problem is how Ubuntu 14 and network manager works with wireless driver and how hostapd is affected with that.
There is no problem with changing MAC, just try
ifconfig wlan0
ifconfig wlan0 down hw ether 00:11:22:33:44:55 up
ifconfig wlan0


I know, I know, I'll have a look at hostapd so maybe I can find a way to fix this...
 
That will be great because I'm actually have no time to check and fix it by myself for Ubuntu 14


Ok after a quick search on Ubuntu the idea is to downgrade hostapd to version 1.0-3ubuntu2.1 which wasn't buggier:
sudo apt-get remove hostapd
cd ~/tmp
wget http://archive.ubuntu.com/ubuntu/pool/universe/w/wpa/hostapd_1.0-3ubuntu2.1_amd64.deb
sudo dpkg -i hostapd*.deb
sudo apt-mark hold hostapd #so we will not update the package with apt-get upgrade

The install shows several errors:
13:45:06 ~/homepass$ sudo ./nzone.sh install BASE16
update-rc.d: warning: /etc/init.d/nzone missing LSB information
update-rc.d: see <http://wiki.debian.org/LSBInitScripts>
Use of uninitialized value $argv[1] in pattern match (m//) at /usr/sbin/update-rc.d line 299.
update-rc.d: error: expected NN after start
usage: update-rc.d [-n] [-f] <basename> remove
update-rc.d [-n] <basename> defaults [NN | SS KK]
update-rc.d [-n] <basename> start|stop NN runlvl [runlvl] [...] .
update-rc.d [-n] <basename> disable|enable [S|2|3|4|5]
-n: not really
-f: force

The disable|enable API is not stable and might change in the future.
starting nzone
net.ipv4.ip_forward = 1
Configuration file: /etc/wlan0_hostap.conf
Failed to update rate sets in kernel module
Using interface wlan0 with hwaddr c4:85:08:1c:cf:6e and ssid 'NZ@McD1'

After that, I've stopped it:
13:54:13 ~/homepass$ sudo /usr/local/sbin/nzone stop
stopping nzone
network-manager stop/waiting
network-manager start/running, process 4550
Configuration file: /etc/wlan0_hostap.conf
Failed to update rate sets in kernel module
Using interface wlan0 with hwaddr c4:85:08:1c:cf:6e and ssid 'NZ@McD1'

And started it again:
13:54:30 ~/homepass$ sudo /usr/local/sbin/nzone start BASE16
starting nzone
net.ipv4.ip_forward = 1
Configuration file: /etc/wlan0_hostap.conf
Failed to update rate sets in kernel module
Using interface wlan0 with hwaddr c4:85:08:1c:cf:6e and ssid 'NZ@McD1'

There are some fails as you can see. It works during some seconds... I've managed to make it a few longer commenting the crontab line just after start nzone but even with all these things it still doesn't work. I've also added mac filtering on hostapd config in order to allow only my 3DS, that works. Searching for this I've found ap-hotspot, an app that creates a hotspot correctly, maybe joining that app with the mac change could work...
 
Ok after a quick search on Ubuntu the idea is to downgrade hostapd to version 1.0-3ubuntu2.1 which wasn't buggier:
The install shows several errors:
After that, I've stopped it:
And started it again:
There are some fails as you can see. It works during some seconds... I've managed to make it a few longer commenting the crontab line just after start nzone but even with all these things it still doesn't work. I've also added mac filtering on hostapd config in order to allow only my 3DS, that works. Searching for this I've found ap-hotspot, an app that creates a hotspot correctly, maybe joining that app with the mac change could work...

"Failed to update rate sets in kernel module"
This is not actually a problem, dicamarques had the same errors on Debian but streetpass worked fine. But the unchanged MAC is not good. Have you tried ifconfig wlan0 down hw ether .... up?
 
"Failed to update rate sets in kernel module"
This is not actually a problem, dicamarques had the same errors on Debian but streetpass worked fine. But the unchanged MAC is not good. Have you tried ifconfig wlan0 down hw ether .... up?


Yep... I did. Don't worry, I'm trying a workaround with ap-hotspot, something like...
ifconfig wlan0 down hw ether $MAC up
ap-hotspot start
ifconfig mon.wlan0 down hw ether $MAC up #just in case
wait several minutes and start again

And for the ap-hotspot configuration, in /etc/ap-hotspot.conf I've changed it a few so I can filter macs and remove wpa
# WiFi Hotspot
interface=wlan0
driver=nl80211
#Access Point
ssid=NZ@McD1
hw_mode=g
# WiFi Channel:
channel=1
macaddr_acl=1
accept_mac_file=/etc/hostapd/accept
auth_algs=1
It's working so I can automate it with no problems.

So an important thing to make yours work in U14.04 (if you manage to get some time) is to downgrade hostapd :)
 
Yep... I did. Don't worry, I'm trying a workaround with ap-hotspot, something like...


And for the ap-hotspot configuration, in /etc/ap-hotspot.conf I've changed it a few so I can filter macs and remove wpa

It's working so I can automate it with no problems.

So an important thing to make yours work in U14.04 (if you manage to get some time) is to downgrade hostapd :)
If ap-hotspot is obtainable with apt-get, then this is not a big deal adopt the script for it just for Ubuntu 14
 
A first and dirty approach having the ap-hotspot installed and already well configured like this works:
Code:
#!/bin/bash
macs=(
    "4e:53:50:4f:4f:40" "4e:53:50:4f:4f:41" "4e:53:50:4f:4f:42" "4e:53:50:4f:4f:43"
    "4e:53:50:4f:4f:44" "4e:53:50:4f:4f:45" "4e:53:50:4f:4f:46" "4e:53:50:4f:4f:47"
    "4e:53:50:4f:4f:48" "4e:53:50:4f:4f:49" "4e:53:50:4f:4f:4A" "4e:53:50:4f:4f:4B"
    "4e:53:50:4f:4f:4C" "4e:53:50:4f:4f:4D" "4e:53:50:4f:4f:4E" "4e:53:50:4f:4f:4F"
)
 
for i in "${macs[@]}"
do
    echo "Using $i MAC address for the hotspot"
    sudo ap-hotspot stop
    sleep 10
    sudo ifconfig wlan0 down hw ether "$i" up
    sleep 5
    sudo ap-hotspot start
    #sleep 10
    #sudo ifconfig mon.wlan0 down hw ether "$i" up
    echo "Waiting 10 minutes..."
    sleep 600
done

So adding to this the generation of your mac lists and read the file, adding in the install script the hostapd fix

sudo apt-get remove hostapd
cd ~/tmp
wget http://archive.ubuntu.com/ubuntu/pool/universe/w/wpa/hostapd_1.0-3ubuntu2.1_amd64.deb
sudo dpkg -i hostapd*.deb
sudo apt-mark hold hostapd #so we will not update the package with apt-get upgrade

and the ap-hotspot install:

sudo add-apt-repository ppa:nilarimogard/webupd8
sudo apt-get update
sudo apt-get install ap-hotspot



and lastly echoing a file in /etc/ap-hotspot.conf with the content:

# WiFi Hotspot
interface=wlan0
driver=nl80211
#Access Point
ssid=NZ@McD1
hw_mode=g
# WiFi Channel:
channel=1
macaddr_acl=1
accept_mac_file=/etc/hostapd/accept
auth_algs=1

would do the trick :)
 
A first and dirty approach having the ap-hotspot installed and already well configured like this works:
Code:
#!/bin/bash
macs=(
    "4e:53:50:4f:4f:40" "4e:53:50:4f:4f:41" "4e:53:50:4f:4f:42" "4e:53:50:4f:4f:43"
    "4e:53:50:4f:4f:44" "4e:53:50:4f:4f:45" "4e:53:50:4f:4f:46" "4e:53:50:4f:4f:47"
    "4e:53:50:4f:4f:48" "4e:53:50:4f:4f:49" "4e:53:50:4f:4f:4A" "4e:53:50:4f:4f:4B"
    "4e:53:50:4f:4f:4C" "4e:53:50:4f:4f:4D" "4e:53:50:4f:4f:4E" "4e:53:50:4f:4f:4F"
)
 
for i in "${macs[@]}"
do
    echo "Using $i MAC address for the hotspot"
    sudo ap-hotspot stop
    sleep 10
    sudo ifconfig wlan0 down hw ether "$i" up
    sleep 5
    sudo ap-hotspot start
    #sleep 10
    #sudo ifconfig mon.wlan0 down hw ether "$i" up
    echo "Waiting 10 minutes..."
    sleep 600
done

So adding to this the generation of your mac lists and read the file, adding in the install script the hostapd fix



and the ap-hotspot install:





and lastly echoing a file in /etc/ap-hotspot.conf with the content:



would do the trick :)
Using sleep is not a good options, is there a pid file option for ap-hotspot? Also what is the minimum set of configuration file pareters, two macfilter may be omittet for sure at least. It is for easy setup.
Also it is likely that ap-hotspot utilizes hostapd and have an integrated DHCP server. So it is better to solve the hostapd problems than exploiting one more level of abstraction.
 
Using sleep is not a good options, is there a pid file option for ap-hotspot? Also what is the minimum set of configuration file pareters, two macfilter may be omittet for sure at least. It is for easy setup.


Yep, there is one: pidfile="/tmp/hotspot.pid"

AFAIK you need to downgrade hostapd, install ap-hotspot, create the /etc/ap-hotspot.conf, create the /etc/hostapd/accept, probably with the install script asking the user which mac address want to add to the whitelist, create the mac lists for homepasses, and that would do it.

About the minimum config params for ap-hotspot.conf you can execute "sudo ap-hotspot configure" and it will ask you several things and configure it for WPA, but the minimum is the following I think:

interface=wlan0
driver=nl80211
ssid=NZ@McD1
hw_mode=g
channel=1
auth_algs=1

About my shitty script, I've commented the change of the mac for the mon.wlan0 because it's not needed, it works just modifying wlan0's one.
 
Hiya, tried doing method 1 for ubuntu, but I get "No wireless interfaces found" although I'm pretty sure my laptop has wireless, as I'm connected to the internet right now. Tried searching for it, but I got 9 results that all seem to be windows-based (and a different error at that). Any ideas of how to find out what's wrong?
 
So I'm doing this via the win7 virtual router 1.0 method. I followed through all the steps, my 3DS recognizes the Nintendo Zone, everything connects to the Virtual Router, and the MAC address has been spoofed. But for whatever reason I'm still not getting any streetpasses.
I feel like I may have messed it up trying to solve the other problems it had(virtual router failing and internet sharing malfunctioning). I'm not sure what to do now...
 
Just wondering, if all is set and done and i connect to the newly made "attwifi" this will push the latest fw update to my 3DS right?
 
tjtj12 If your 3DS is updated to 9.3.0 or 9.4.0 the only way to have homepass from the Windows system is described under Before anything else link in the first post of the thresd. Virtual Router must be installed.

Arithmatics Yes, it will prompt you that new update is available, but don't install it untill you select to do so.
 
Yep, it works too commenting that hw_mode=g line.

So this is the native hostapd config used by the ap-hotspot. Can't find full man for ap-hotspot so wait till I'll intall the latest U 14 Desktop on VMWare and check it options. I agree if it is working it should be used as a workaround for that distro as long as we do not investigate the native hostapd method.
 
Status
Not open for further replies.

Site & Scene News

Popular threads in this forum