Tutorial [HOW-TO] Have a homemade Streetpass Relay

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.

William Knights

Member
Newcomer
Joined
Jan 4, 2013
Messages
20
Trophies
0
XP
103
Country
Italy
If manual nzone.exe changes MAC, then just must do the same, just check the job result code for any errors.

William Knights That,s right, yo can't start hosted network just after you disallowed it! Try this:
netsh wlan set hostednetwork disallow
netsh wlan set hostednetwork allow testtest testtest
netsh wlan start hostednetwork
netsh wlan show hostednetwork

It also happens when it's allowed!
 

Marco RamLey

Member
Newcomer
Joined
Dec 9, 2014
Messages
8
Trophies
0
XP
41
Country
Mexico
Yes it only changed once per 30 minutes for BASE16 or pet 2 more minutes for BASE256. So if you see at least one MAC change, the next step is to check if Nintendo Zone application can download a page.

Hey Duke: After 2 daysI haven't got any streetpass.

I'm using the nzone.exe with BASE256, the MAC address on my connection change correctly (every 2 minutes), my network is shared with the "ConsoleNintendo3DS" connection and the Nintendo Zone application is activated on my 3DS, but every time I start the NZ application I keep getting the 003-2105 communication error.

By the way I'm using Windows 7.

Can you provide any help?
Thank you!
 

duke_srg

Well-Known Member
Member
Joined
Mar 1, 2011
Messages
1,862
Trophies
0
Age
44
Location
Moscow
XP
807
Country
Serbia, Republic of
Hey Duke: After 2 daysI haven't got any streetpass.

I'm using the nzone.exe with BASE256, the MAC address on my connection change correctly (every 2 minutes), my network is shared with the "ConsoleNintendo3DS" connection and the Nintendo Zone application is activated on my 3DS, but every time I start the NZ application I keep getting the 003-2105 communication error.

By the way I'm using Windows 7.

Can you provide any help?
Thank you!
Check ICS is properly enabled by mzone.exe. Disable any network security software and windows firewall custom settings, if any.
 

miilon

New Member
Newbie
Joined
Dec 16, 2014
Messages
4
Trophies
0
Age
32
XP
80
Country
France
miilon You can check the actual MAC with ifconfig wlan0 but it sounds bad that you can't get IP settings automatically, dnsmasq may not work properly in your case.

Sadly this isn't working properly, MAC hasn't changed at first.
So I did
sudo /usr/local/sbin/nzone stop
sudo /usr/local/sbin/nzone start
MAC has changed but wired connection still going crazy every 20 secs and my AP disappears about 20 secs after started nzone and never appears again. It may work because during these first 20 seconds my 3ds managed to catch some streetpassers.

I read some of ubuntu's posts I guess it has something with crontab but still confused.
Anyway how can I fix it ?

Thanks in advance. Awaiting kind reply
 

duke_srg

Well-Known Member
Member
Joined
Mar 1, 2011
Messages
1,862
Trophies
0
Age
44
Location
Moscow
XP
807
Country
Serbia, Republic of
Sadly this isn't working properly, MAC hasn't changed at first.
So I did
sudo /usr/local/sbin/nzone stop
sudo /usr/local/sbin/nzone start
MAC has changed but wired connection still going crazy every 20 secs and my AP disappears about 20 secs after started nzone and never appears again. It may work because during these first 20 seconds my 3ds managed to catch some streetpassers.

I read some of ubuntu's posts I guess it has something with crontab but still confused.
Anyway how can I fix it ?

Thanks in advance. Awaiting kind reply
It can't be crontab because it works one per minute only. You can run nzone start then disable crown job and manually launch nzone BASE256 to check for the possible errors. Also please do cat /usr/local/sbin/nzone and post the output, I just need to check that interfaces was detected properly by install part of the script
 

miilon

New Member
Newbie
Joined
Dec 16, 2014
Messages
4
Trophies
0
Age
32
XP
80
Country
France
Still stuck.
sudo /usr/local/sbin/nzone stop
sudo /tmp/nzone.sh BASE256

Code:
~$ cat /usr/local/sbin/nzone
#!/bin/sh
export PATH=/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin
WLINT=wlan0
WLMAC=00:02:72:7d:96:0c
WLSSID=NZ@McD1
EXTINT=eth0
HOSTAPDCONF=/etc/${WLINT}_hostap.conf
HOSTAPDPID=/var/run/${WLINT}_hostapd.pid
DNSMASQPID=/var/run/${WLINT}_dnsmasq.pid
DNSPORT=53
fuser -s $DNSPORT/tcp && DNSPORT=0
CRON="sudo crontab"
JOBS=$($CRON -l)
URL=http://nintendozone.no-ip.org?
MACS=/tmp/${0##*/}.macs
SPDELAY=480
MACNUM=0
setwl (){
        [ -f $HOSTAPDPID ] && (kill $(cat $HOSTAPDPID); rm -f $HOSTAPDPID)
        rfkill unblock wlan
        service network-manager stop
        ifconfig $WLINT down hw ether $1 up
        service network-manager start
        sed -ri "s/^bssid=.*/bssid=$1/;s/^ssid=.*/ssid=$2/" $HOSTAPDCONF
        hostapd -B -P $HOSTAPDPID $HOSTAPDCONF
}
case "$1" in
start)
        echo starting ${0##*/}>&2
        [ -f $DNSMASQPID ] || [ -f $HOSTAPDPID ] && echo Already running && exit
        dnsmasq -i $WLINT -x $DNSMASQPID -F 192.168.23.50,192.168.23.150,255.255.255.0,12h -p $DNSPORT
        sysctl -w net.ipv4.ip_forward=1
        iptables -t nat -I POSTROUTING -o $EXTINT -j MASQUERADE
        iptables -I FORWARD -i $WLINT -j ACCEPT
        ifconfig $WLINT 192.168.23.1 up
        sed -ri "s/^bssid=.*/bssid=$WLMAC/;s/^ssid=.*/ssid=$WLSSID/" $HOSTAPDCONF
        hostapd -B -P $HOSTAPDPID $HOSTAPDCONF
        if [ -z $2 ]; then
                echo "$JOBS" | sed -r "s:#*(.*$0.*):\1:" | $CRON -
        else
                echo "$JOBS" | grep -v $0 | sed "\$a* * * * * $0 $2" | $CRON -
        fi
;;
stop)
        echo stopping ${0##*/}>&2
        setwl $WLMAC $WLSSID
        echo "$JOBS" | sed -r "s:#*(.*$0.*):#\1:" | $CRON -
        ifconfig $WLINT down
        [ -f $DNSMASQPID ] && (kill $(cat $DNSMASQPID); rm -f $DNSMASQPID)
        [ -f $HOSTAPDPID ] && (kill $(cat $HOSTAPDPID); rm -f $HOSTAPDPID)
        iptables -t nat -D POSTROUTING -o $EXTINT -j MASQUERADE
        iptables -D FORWARD -i $WLINT -j ACCEPT
;;
toggle)
        if $($0 status); then
                $0 stop
        else
                $0 start
        fi
;;
restart)
        $0 stop
        $0 start
;;
reload|force-reload)
        echo ${0##*/} MAC lists reloaded>&2
        rm -f $MACS
;;
status)
        if $(echo "$JOBS" | grep $0 | grep -qe '^#'); then
                echo ${0##*/} is not running>&2
                exit 1
        else
                echo ${0##*/} is running>&2
                exit 0
        fi
;;
*)
        [ -f $MACS ] && MACNUM=$(grep -v ^x $MACS | wc -l) && DELAY=$((($(date +%s)-$(date -r $MACS +%s))/60))
        [ $MACNUM = 0 ] && NEWMACS=$(wget -q -O - $URL$1)
        [ $(echo -n "$NEWMACS" | wc -c) != 0 ] && echo "$NEWMACS" > $MACS && MACNUM=$(cat $MACS | wc -l)
        [ $MACNUM = 0 ] && sed -ri "s/^x//" $MACS && MACNUM=$(grep -v ^x $MACS | wc -l)
        MACTOTAL=$(cat $MACS | wc -l)
        [ $MACNUM = 0 ] || ([ $MACTOTAL -lt $SPDELAY ] && [ ${DELAY:-$SPDELAY} -lt $(($SPDELAY/$MACTOTAL)) ]) && exit
        RANDOM=$(head /dev/urandom | hexdump -d | head -n 1 | sed -r "s/^([0-9]+ +0{0,4})+//")
        MAC=$(grep -v ^x $MACS | head -n $(($RANDOM%${MACNUM}+1)) | tail -n 1)
        sed -ri "s/^$MAC/x&/" $MACS
        SSID=$(echo $MAC | cut -d , -f 2 -s)
        MAC=$(echo $MAC | cut -d , -f 1)
        : ${SSID:=$WLSSID}
        setwl $MAC $SSID
;;
esac
 

duke_srg

Well-Known Member
Member
Joined
Mar 1, 2011
Messages
1,862
Trophies
0
Age
44
Location
Moscow
XP
807
Country
Serbia, Republic of
Still stuck.
sudo /usr/local/sbin/nzone stop
sudo /tmp/nzone.sh BASE256

Code:
~$ cat /usr/local/sbin/nzone
#!/bin/sh
export PATH=/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin
WLINT=wlan0
WLMAC=00:02:72:7d:96:0c
WLSSID=NZ@McD1
EXTINT=eth0
HOSTAPDCONF=/etc/${WLINT}_hostap.conf
HOSTAPDPID=/var/run/${WLINT}_hostapd.pid
DNSMASQPID=/var/run/${WLINT}_dnsmasq.pid
DNSPORT=53
fuser -s $DNSPORT/tcp && DNSPORT=0
CRON="sudo crontab"
JOBS=$($CRON -l)
URL=http://nintendozone.no-ip.org?
MACS=/tmp/${0##*/}.macs
SPDELAY=480
MACNUM=0
setwl (){
        [ -f $HOSTAPDPID ] && (kill $(cat $HOSTAPDPID); rm -f $HOSTAPDPID)
        rfkill unblock wlan
        service network-manager stop
        ifconfig $WLINT down hw ether $1 up
        service network-manager start
        sed -ri "s/^bssid=.*/bssid=$1/;s/^ssid=.*/ssid=$2/" $HOSTAPDCONF
        hostapd -B -P $HOSTAPDPID $HOSTAPDCONF
}
case "$1" in
start)
        echo starting ${0##*/}>&2
        [ -f $DNSMASQPID ] || [ -f $HOSTAPDPID ] && echo Already running && exit
        dnsmasq -i $WLINT -x $DNSMASQPID -F 192.168.23.50,192.168.23.150,255.255.255.0,12h -p $DNSPORT
        sysctl -w net.ipv4.ip_forward=1
        iptables -t nat -I POSTROUTING -o $EXTINT -j MASQUERADE
        iptables -I FORWARD -i $WLINT -j ACCEPT
        ifconfig $WLINT 192.168.23.1 up
        sed -ri "s/^bssid=.*/bssid=$WLMAC/;s/^ssid=.*/ssid=$WLSSID/" $HOSTAPDCONF
        hostapd -B -P $HOSTAPDPID $HOSTAPDCONF
        if [ -z $2 ]; then
                echo "$JOBS" | sed -r "s:#*(.*$0.*):\1:" | $CRON -
        else
                echo "$JOBS" | grep -v $0 | sed "\$a* * * * * $0 $2" | $CRON -
        fi
;;
stop)
        echo stopping ${0##*/}>&2
        setwl $WLMAC $WLSSID
        echo "$JOBS" | sed -r "s:#*(.*$0.*):#\1:" | $CRON -
        ifconfig $WLINT down
        [ -f $DNSMASQPID ] && (kill $(cat $DNSMASQPID); rm -f $DNSMASQPID)
        [ -f $HOSTAPDPID ] && (kill $(cat $HOSTAPDPID); rm -f $HOSTAPDPID)
        iptables -t nat -D POSTROUTING -o $EXTINT -j MASQUERADE
        iptables -D FORWARD -i $WLINT -j ACCEPT
;;
toggle)
        if $($0 status); then
                $0 stop
        else
                $0 start
        fi
;;
restart)
        $0 stop
        $0 start
;;
reload|force-reload)
        echo ${0##*/} MAC lists reloaded>&2
        rm -f $MACS
;;
status)
        if $(echo "$JOBS" | grep $0 | grep -qe '^#'); then
                echo ${0##*/} is not running>&2
                exit 1
        else
                echo ${0##*/} is running>&2
                exit 0
        fi
;;
*)
        [ -f $MACS ] && MACNUM=$(grep -v ^x $MACS | wc -l) && DELAY=$((($(date +%s)-$(date -r $MACS +%s))/60))
        [ $MACNUM = 0 ] && NEWMACS=$(wget -q -O - $URL$1)
        [ $(echo -n "$NEWMACS" | wc -c) != 0 ] && echo "$NEWMACS" > $MACS && MACNUM=$(cat $MACS | wc -l)
        [ $MACNUM = 0 ] && sed -ri "s/^x//" $MACS && MACNUM=$(grep -v ^x $MACS | wc -l)
        MACTOTAL=$(cat $MACS | wc -l)
        [ $MACNUM = 0 ] || ([ $MACTOTAL -lt $SPDELAY ] && [ ${DELAY:-$SPDELAY} -lt $(($SPDELAY/$MACTOTAL)) ]) && exit
        RANDOM=$(head /dev/urandom | hexdump -d | head -n 1 | sed -r "s/^([0-9]+ +0{0,4})+//")
        MAC=$(grep -v ^x $MACS | head -n $(($RANDOM%${MACNUM}+1)) | tail -n 1)
        sed -ri "s/^$MAC/x&/" $MACS
        SSID=$(echo $MAC | cut -d , -f 2 -s)
        MAC=$(echo $MAC | cut -d , -f 1)
        : ${SSID:=$WLSSID}
        setwl $MAC $SSID
;;
esac
Wrong, nzone.sh must be run only once on install!
 

miilon

New Member
Newbie
Joined
Dec 16, 2014
Messages
4
Trophies
0
Age
32
XP
80
Country
France
Wrong, nzone.sh must be run only once on install!
Okay, my apologies.
So I reinstalled from scratch with BASE16,GBATEMP then
sudo /usr/local/sbin/nzone BASE256 while running

I've got the same result. Do you still need a cat on nzone ? Also how do I disable the cron job ? even though I don't know how it works.
 

serginator

Member
Newcomer
Joined
Dec 14, 2014
Messages
19
Trophies
0
Age
37
XP
54
Country
Okay, my apologies.
So I reinstalled from scratch with BASE16,GBATEMP then
sudo /usr/local/sbin/nzone BASE256 while running

I've got the same result. Do you still need a cat on nzone ? Also how do I disable the cron job ? even though I don't know how it works.


Execute "sudo crontab -e" and comment the line of nzone with "#"
 

Tin_Whiskers

Member
Newcomer
Joined
Dec 8, 2014
Messages
19
Trophies
0
Age
45
XP
42
Country
United States
http://www.dd-wrt.com/phpBB2/viewtopic.php?t=172030&highlight=wnr2000
Looks like flashing the WNR could be a bit of a chore.

If you're talking about the wrt54g, the link depends on the specific model.
http://www.dd-wrt.com/site/support/router-database


It certainly was a pain in the ass. :) I had very little idea what I was doing with the command line in Linux, particularly for the final step (TFTP). Got it all squared away, though, and it works! I'm changing the MACs manually. Going to try Duke's WRT script here in the next day or so.
 

shadowdogg

Member
Newcomer
Joined
Sep 11, 2012
Messages
24
Trophies
0
XP
49
Country
shadowdogg the actual MAC is mot shown on tge WEB GUO, check the actual MAC with
ifconfig $(nvram get wl0_ifname)
What is the router model, dd-wrt type (mini,micro,...) and build number (5 digit number)?
Also I need the output for
cat /proc/version;cat /proc/cpuinfo

Thanks for the reply. I am using wifi analyser on my phone to tell me the mac as I find it the most straight forward

Buffalo G300NV2, Not sure on type, there wasn't any. Build number: 25628


Code:
root@Streetpass-RELAY:~# cat /proc/version;cat /proc/cpuinfo
Linux version 3.10.62 ([EMAIL][email protected][/EMAIL]) (gcc version 4.8.3 (OpenWrt/Linaro GCC 4.8-2014.04 r42002) ) #4550 Thu Dec 11 05:25:42 CET 2014
system type : Atheros AR7240 rev 1.2 (0x00c2)
processor : 0
cpu model : MIPS 24Kc V7.4
BogoMIPS : 265.42
CPUClock : 400
wait instruction : yes
microsecond timers : yes
tlb_entries : 16
extra interrupt vector : yes
hardware watchpoint : yes, count: 4, address/irw mask: [0x0000, 0x0f18, 0x0aa0, 0x0c48]
isa : mips1 mips2 mips32r1 mips32r2
ASEs implemented : mips16
shadow register sets : 1
kscratch registers : 0
core : 0
VCED exceptions : not available
VCEI exceptions : not available
 

Jarathaxe

Active Member
Newcomer
Joined
May 16, 2011
Messages
32
Trophies
0
XP
136
Country
United States
I use the Sanoxy Wifi Repeater method. And that had worked fine for me after I changed the ssid to the NZ@mcd1 a few months back. But after the recent updates It stopped working. I've tried back to the attwifi with no encrytpion, and NZ@mcD1 with no encryption to no avail. Does anybody have any ideas?
 

duke_srg

Well-Known Member
Member
Joined
Mar 1, 2011
Messages
1,862
Trophies
0
Age
44
Location
Moscow
XP
807
Country
Serbia, Republic of
William Knights toggle ICS on any connection on and off and try to start hostednetwork once more.

shadowdogg try this and show me the output:
ifconfig $(nvram get wl0_ifname)
killall hostapd
ifconfig hw $(nvram get wl0_ifname) down hw ether 00:11:22:33:44:55 up
hostapd -B -P /var/run/$(nvram get wl0_ifname)_hostapd.pid /tmp/$(nvram get wl0_ifname)_hostap.conf
ifconfig $(nvram get wl0_ifname)
 

serginator

Member
Newcomer
Joined
Dec 14, 2014
Messages
19
Trophies
0
Age
37
XP
54
Country
Don't alter the SPDELAY, if you need to limit the minimum delay just change cron job like */5 * * * * will give at least 5 minutes delay between MAC change regardless of the total MAC number in the list.
Don't enable WPA at least at the time of testing, also it will not work with WPA if your 3DS firmware is 9.3.0 or higher. /usr/local/sbin/nzone status only shows whether cron job is enabled, because the script is not like a daemon, it just launched by the cron job periodically. There are plenty of issues with U14, I believe even the various installed X Server and its applications can produce various error. Anyway try to install the script from the scratch like:
nzone.sh install BASE256
Post the errors, disable cron job an run
nzone
And post the errors once more.


Hi, I've reinstalled it with "nzone.sh install BASE256" and I got some errors:
09:22:54 ~/homepass$ sudo ./nzone.sh install BASE256
[sudo] password for serginator:
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
nl80211: Could not configure driver mode
nl80211 driver initialization failed.
hostapd_free_hapd_data: Interface wlan0 wasn't started

After that, if I run "sudo /usr/local/sbin/nzone start BASE256" it starts and creates the AP (there is no connection) and after a few seconds it still says it's working but the ap disappears. If I stop it and start it again, the ap shows again and after a few seconds the same, disappears. I don't know if the error during the install can help you to figure out what's going wrong. I'm executing it on a U14.04.
 

duke_srg

Well-Known Member
Member
Joined
Mar 1, 2011
Messages
1,862
Trophies
0
Age
44
Location
Moscow
XP
807
Country
Serbia, Republic of
serginator: Please try to edit nzone file, locate a lne with
rfkill unblock wlan
and add two lines after that
rfkill unblock wifi
nmcli nm wifi off
And check what changed
 

serginator

Member
Newcomer
Joined
Dec 14, 2014
Messages
19
Trophies
0
Age
37
XP
54
Country
serginator: Please try to edit nzone file, locate a lne with
rfkill unblock wlan
and add two lines after that
rfkill unblock wifi
nmcli nm wifi off
And check what changed


Done, these are the new errors:

11:10:38 ~/homepass$ sudo /usr/local/sbin/nzone start BASE16

starting nzone
net.ipv4.ip_forward = 1
SIOCSIFFLAGS: Operación imposible por estar la radiofrecuencia desactivada (it says 'operation impossible due to rf deactivated')
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.952378 eloop_data=0x18cfd80 user_data=0x18cf0e0 handler=0x4450d0
 

danone42

Member
Newcomer
Joined
Oct 30, 2013
Messages
14
Trophies
0
XP
80
Country
duke_srg

I'm trying to set up my homepass using a laptop running on Windows 8 with ethernet cable. My 3DS did connect to the Internet and the Nintendo Zone responded but I can't get any streetpases.

It seems that my wireless adapter can't change MAC address. I checked it with maccheck.cmd. But my hostednetwork did change the bssid.
My hostednetwork also requires a password so there's that. And my 3DS is updated to the latest firmware. I think these are my main problems.

Would a WiFi USB dongle fix my problem? If so, is there a specific model/specifications or I can just get a cheap one? Thanks for the help.
 
Status
Not open for further replies.

Site & Scene News

Popular threads in this forum

General chit-chat
Help Users
    HiradeGirl @ HiradeGirl: Have a nice day. Life. Week. Month. year.