Thursday, November 13, 2014

Changing the SSID in SpillPass-Pi

Why would you want to change the SSID you're using for HomePass?  Well, the Nintendo Zone system combines the SSID with the MAC address when choosing which StreetPasses to send to you, so using the same MAC with a different SSID will give you completely different StreetPasses.  This becomes important when you're desperately trying to finish a panel in Puzzle Swap and you're not getting anyone who has the pieces you need.  Changing your SSID can get you a better chance at the missing pieces.

Since SpillPass-Pi pretty much isn't documented at all, I'll make my best attempt at describing this process.  I'll even go so far even as decided to use even go want to do look more like.

I mean, make it simple enough that you don't really need any Linux knowledge to do it.

The hardest part of doing this is connecting to your Raspberry Pi so you can make the changes.  Here, you have two options:
  1. Connect a monitor and keyboard.
  2. Find its IP address, and use an SSH client such as PuTTY (for Windows) or the command-line ssh client (Mac OS X, Linux) to connect.
I personally connect via SSH, but that's because my router always gives the Raspberry Pi the same IP address whenever SpillPass-Pi rotates MAC addresses.  If yours doesn't, you'll get your connection interrupted every five minutes.  It's for this reason that I'll recommend connecting a monitor and keyboard instead.  There is a rather weird issue with connecting a monitor and keyboard, and that would be that the default keyboard layout isn't the standard US QWERTY layout.  It's still QWERTY, but some of the non-alphanumeric symbols are moved around.

To log in, the username and password are the same as the web interface:
  • Username: root
  • Password: SpillPassPi
If logging in via SSH, in PuTTY, type root@<IP of your Raspberry Pi> into the "Host Name (or IP address)" field and click "Open". Enter the password when prompted.

If logging in via SSH, with the command-line SSH client in Mac OS X or Linux, just type ssh root@<IP of your Raspberry Pi> and press Enter. Enter the password when prompted.

If connecting a monitor and keyboard, you'll have to press Ctrl+A and then D to get to the login prompt.  From there, you can just type both the username and the password.

Anyone with Linux knowledge can tell you how bad it is to be logging in as root, but apparently nobody told that to spillmonkey.  You'll need root privileges for this anyway, so just beware: you can seriously mess things up with root if you don't follow these instructions verbatim.  Also, Linux filesystems and commands are case-sensitive.

Now that you're connected and logged in, all you need to do is edit a text file and reboot.  For the purposes of this example, we'll be using this SSID: NZ@McD1
  1. At the prompt, type nano /etc/hostapd/ and press Enter.
  2. Look for the line that says cat > $CONFIG_FILE <<EOF
  3. On a blank line just above that line, type SSID="NZ@McD1"
  4. Now press Ctrl+X, and then press Y to save the changes and exit.
  5. Finally, at the prompt, type shutdown -r now to reboot your Raspberry Pi.  When it comes back up, it will be using the new SSID.
The more Linux-savvy out there may realize that you don't really need to do a full reboot.  That's fine.  I just wanted to make things as simple as possible, so that anyone could do it.

What's that, you want to change back to the default?  Well, that's easy too.
  1. At the command prompt, type nano /etc/hostapd/ and press Enter.
  2. Go down to the line you added in the above instructions, and insert a # before it.  Using our example above, the line will now read #SSID="NZ@McD1"
  3. Press Ctrl+X, then Y to save and exit.
  4. Type shutdown -r now at the prompt and press Enter to reboot.
The # character makes the line a comment, which prevents that one line from being executed.  In the future, if you want to change the SSID again, all you need to do is delete that character and then change the SSID.

No comments:

Post a Comment

I moderate comments because when Blogger originally implemented a spam filter it wouldn't work without comment moderation enabled. So if your comment doesn't show up right away, that would be why.