FAQ  •  Search  •  Profile  •  Log in to check your private messages  •  Log in
 Ubuntu 10.04 Xlink Kai PSP SSID Scripts View next topic
View previous topic
Post new topicReply to topic
Author Message
Coldbird
Kai Beginner
Kai Beginner


Joined: 07 Dec 2009
Posts: 26

PostPosted: Sun Jun 13, 2010 5:36 pm Reply with quoteBack to top

This scripts address several problems with Xlink Kai + Ubuntu.

As we all know Ubuntu comes bundled with the Gnome Network Manager which isn't suited for quick SSID changes...

In fact I don't know of any Network Manager actually being a HELP for Kai... Evil or Very Mad

Here I will list some of the known problems with Ubuntu + Network Managers...

1. Weird disconnect behaviour for Adhoc-Networks...
2. Sucky Refresh Rate - making it impossible to join SSID changing games...
3. No way to copy the changing SSID for your clients...

The following two scripts will do the following for you...

1. Temporarly deactivate the Network Manager.
2. Reconnect your Wired Network via DHCP so you have Internet Access.
3. Switch your WLAN Interface into Adhoc Mode + Channel 1.
4. Auto-Connect to the initial PSP SSID (Lobby).
5. Allow you to easily get connected to other players.

The following scripts need to be executed as root using sudo.

The clientman.sh script is for clients (joiners) while the hostman.sh is for the server (host).

The scripts are similiar in working, but have a few differences.

The hostman.sh changes SSID 100% automatically... and displays the new SSID it joins... this allows the host to easily copy the new SSID (hostkey) and pass it onto others...

The clientman.sh connects to the initial lobby SSID... and keeps asking for hostkeys (ex. PSP_AULES12345_zXaB12h, zXaB12h would be the hostkey...).

Just copy the hostkey into the terminal, press enter and you are done.
The client now joined the right SSID network.

Once you are done playing and want the Network-Manager back, simply terminate the script using Ctrl + C and it will undo all the changes to the interfaces, reactivating the Network-Manager.

Good Luck fellow Kaians, this should make Xlink Kai a lot more attractive for Linux Users because Linux has a way better WLAN Device Compatiblity for Xlink Kai.

The scripts are configured to use eth0 as your wired (internet) and wlan0 as your wlan (kai) interface...

If your devices have different names, you will have to alter the scripts to reflect those differences.

I wont be updating those scripts ever I fear though, cause they work for me and that is all I wanted to achieve with those.

Support is given if someone absolutely cannot handle them. Twisted Evil

hostman.sh -> http://pastebin.com/t7F8NKkR
clientman.sh -> http://pastebin.com/442RCq07

Keep in mind that the hostman.sh script is a one-way-ticket...
Lobby to Ingame Auto-Pickup of SSID works, but not the other way around...

The initial version of it supported it, but I had to limit "both-way-detection" because of the way the CLI WLAN Tools work...

Which means... you have to restart the hostman.sh script for each new "round" you host.

Keep in mind to remove the tick in the "Automatically Connect" Checkbox in the Ubuntu Network Manager for every Infrastructure WLAN Connection.

For some reason the WLAN device can't get switched into Adhoc Mode if you have a "Auto-Connect" Infrastructure Network in your Network-Manager... even though my script deactivates it...

Strange but... oh well, atleast we know we have to deactivate that before starting the script. Twisted Evil

_________________
ImageImage

Last edited by Coldbird on Mon Jun 14, 2010 8:56 pm; edited 2 times in total
View user's profileSend private message
CrunchBite
Team XLink Developer
Team XLink Developer


Joined: 28 Nov 2007
Posts: 2338

PostPosted: Sun Jun 13, 2010 5:42 pm Reply with quoteBack to top

Nice Very Happy Stickied!

I'll copy them into the forum in case they are lost on pastebin

hostman.sh
Code:
#!/bin/bash

# shutdown handler
shutdown()
{
  # start network-manager
  start network-manager > /dev/null
 
  # shutdown follower
  exit 0
}

# add shutdown handler
trap shutdown SIGINT

# clear screen
clear

# display credits
echo "KAI SSID Host Tool for Ubuntu Linux 10.04 by Coldbird"

# stop network-manager
stop network-manager > /dev/null

# bring down cable interface
ifconfig eth0 down

# bring down wlan interface
ifconfig wlan0 down

# bring up cable network (internet)
ifconfig eth0 up

# connect cable network (internet)
dhclient eth0 2> /dev/null

# switch wlan device into adhoc mode
iwconfig wlan0 mode ad-hoc

# repeat till it works
while [ $? != 0 ]; do
iwconfig wlan0 mode ad-hoc
done

# switch to channel 1
iwconfig wlan0 channel 1

# repeat till it works
while [ $? != 0 ]; do
iwconfig wlan0 channel 1
done

# start wlan device
ifconfig wlan0 up

# previous playstation ssid
PREVSSID="NOTHING"

# current playstation ssid
CURSSID="NOTHING"

# follower loop start
while true; do

# get playstation ssid
NEWSSID=`iwlist wlan0 scan 2> /dev/null | grep PSP_ | cut -d : -f 2 | cut -d \" -f 2 | cut -d \" -f 1 | grep -x -v $CURSSID`

# new playstation ssid start
if [ "$CURSSID" != "$NEWSSID" -a "$PREVSSID" != "$NEWSSID" -a -n "$NEWSSID" ]; then

# connect to network
iwconfig wlan0 essid $NEWSSID

# set link local
ifconfig wlan0 169.254.34.2

# save previous ssid
PREVSSID=$CURSSID

# save playstation ssid
CURSSID=$NEWSSID

# display change
echo Switched to $NEWSSID.

# new playstation ssid end
fi

# delay polling
sleep 3

# follower loop end
done
View user's profileSend private message
CrunchBite
Team XLink Developer
Team XLink Developer


Joined: 28 Nov 2007
Posts: 2338

PostPosted: Sun Jun 13, 2010 5:44 pm Reply with quoteBack to top

clientman.sh
Code:
#!/bin/bash

# shutdown handler
shutdown()
{
  # start network-manager
  start network-manager > /dev/null
 
  # shutdown follower
  exit 0
}

# add shutdown handler
trap shutdown SIGINT

# clear screen
clear

# display credits
echo "KAI SSID Client Tool for Ubuntu Linux 10.04 by Coldbird"

# stop network-manager
stop network-manager > /dev/null

# bring down cable interface
ifconfig eth0 down

# bring down wlan interface
ifconfig wlan0 down

# bring up cable network (internet)
ifconfig eth0 up

# connect cable network (internet)
dhclient eth0 2> /dev/null

# switch wlan device into adhoc mode
iwconfig wlan0 mode ad-hoc

# repeat till it works
while [ $? != 0 ]; do
iwconfig wlan0 mode ad-hoc
done

# switch to channel 1
iwconfig wlan0 channel 1

# repeat till it works
while [ $? != 0 ]; do
iwconfig wlan0 channel 1
done

# start wlan device
ifconfig wlan0 up

# current playstation ssid
CURSSID="NOTHING"

# initial ssid loop start
while [ "$CURSSID" = "NOTHING" ]; do

# get playstation ssid
NEWSSID=`iwlist wlan0 scan 2> /dev/null | grep PSP_ | cut -d : -f 2 | cut -d \" -f 2 | cut -d \" -f 1`

# new playstation ssid start
if [ "$CURSSID" != "$NEWSSID" -a -n "$NEWSSID" ]; then

# connect to network
iwconfig wlan0 essid $NEWSSID

# set link local
ifconfig wlan0 169.254.34.2

# save playstation ssid
CURSSID=$NEWSSID

# display change
echo Switched to $NEWSSID.

# new playstation ssid end
fi

# delay polling
sleep 3

# initial ssid loop end
done

# ssid change loop
while true; do

# output message
echo Paste the Host-Key \(PSP_AULES12345_L_hOsTkEy\) to switch SSID.

# read host key
read HOSTKEY

# connect to network
iwconfig wlan0 essid $CURSSID$HOSTKEY

# set link local
ifconfig wlan0 169.254.34.2

# display change
echo Switched to $CURSSID$HOSTKEY.

# ssid change loop end
done
View user's profileSend private message
Coldbird
Kai Beginner
Kai Beginner


Joined: 07 Dec 2009
Posts: 26

PostPosted: Sun Jun 13, 2010 6:04 pm Reply with quoteBack to top

Stickied within first 5 minutes? I feel honored. Smile

_________________
ImageImage
View user's profileSend private message
Display posts from previous:      
Post new topicReply to topic


 Jump to:   



View next topic
View previous topic
You can post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


Powered by phpBB © 2001, 2002 phpBB Group :: Theme by Daz :: All times are GMT