# Wiviz

(Difference between revisions)
 Revision as of 00:29, 6 August 2006 (edit)Togo (Talk | contribs) (Buglists)← Previous diff Revision as of 00:43, 6 August 2006 (edit) (undo)Togo (Talk | contribs) (Buglists)Next diff → Line 80: Line 80: * sometimes network icons drift out of the screen and everything shifts out of sight: * sometimes network icons drift out of the screen and everything shifts out of sight: -> Solution: Replace the declump function in wiviz.js Java Script with this: -> Solution: Replace the declump function in wiviz.js Java Script with this: - function declump() { + function declump() { - var c = 0; + var c = 0; - var top = 150,bottom = -350,left = 550,right = -550; + var top = 150,bottom = -350,left = 550,right = -550; - for (i = 0; i < hosts.length; i++) { + for (i = 0; i < hosts.length; i++) { - for (j = 0; j < hosts.length; j++) { + for (j = 0; j < hosts.length; j++) { - if (i == j) continue; + if (i == j) continue; - e1 = document.getElementById(hosts[i].mnem); + e1 = document.getElementById(hosts[i].mnem); - e2 = document.getElementById(hosts[j].mnem); + e2 = document.getElementById(hosts[j].mnem); - if (!e1 || !e2) continue; + if (!e1 || !e2) continue; - x1 = parseInt(e1.style.left); + x1 = parseInt(e1.style.left); - x2 = parseInt(e2.style.left); + x2 = parseInt(e2.style.left); - y1 = parseInt(e1.style.top); + y1 = parseInt(e1.style.top); - y2 = parseInt(e2.style.top); + y2 = parseInt(e2.style.top); - ox = x2; + ox = x2; - oy = y2; + oy = y2; - if (x2 > left) x2 = left; + if (x2 > left) x2 = left; - if (x2 < right) x2 = right; + if (x2 < right) x2 = right; - if (y2 > top) y2 = top; + if (y2 > top) y2 = top; - if (y2 < bottom) y2 = bottom; + if (y2 < bottom) y2 = bottom; - dist = Math.sqrt(Math.pow((x1-x2), 2) + Math.pow((y1-y2), 2)); + dist = Math.sqrt(Math.pow((x1-x2), 2) + Math.pow((y1-y2), 2)); - if (dist == 0) { + if (dist == 0) { - x2 += Math.random() * 5; + x2 += Math.random() * 5; - y2 += Math.random() * 5; + y2 += Math.random() * 5; - dist = 10; + dist = 10; - } + } - if (dist < 100) { + if (dist < 100) { - cx = (x1-x2) * 5 / (dist / 3); + cx = (x1-x2) * 5 / (dist / 3); - cy = (y1-y2) * 5 / (dist / 3); + cy = (y1-y2) * 5 / (dist / 3); - x2 -= cx; + x2 -= cx; - y2 -= cy; + y2 -= cy; - } + } - if (hosts[j].apmnem == hosts[i].mnem + if (hosts[j].apmnem == hosts[i].mnem - || hosts[i].apmnem == hosts[j].mnem) { + || hosts[i].apmnem == hosts[j].mnem) { - if (dist > 150) { + if (dist > 150) { - cx = (x1-x2) * 5 / (dist / 3); + cx = (x1-x2) * 5 / (dist / 3); - cy = (y1-y2) * 5 / (dist / 3); + cy = (y1-y2) * 5 / (dist / 3); - x2 += cx; + x2 += cx; - y2 += cy; + y2 += cy; - } + } - } + } - if (Math.abs(ox-x2) > 2 || Math.abs(oy-y2) > 2) { + if (Math.abs(ox-x2) > 2 || Math.abs(oy-y2) > 2) { - e2.style.left = parseInt(x2); + e2.style.left = parseInt(x2); - e2.style.top = parseInt(y2); + e2.style.top = parseInt(y2); - c++; + c++; - } + } - } + } - } + } [[Category:advanced HOWTO]] [[Category:advanced HOWTO]] [[Category:English documentation]] [[Category:English documentation]]

## What is Wiviz?

For those interested in using a WRT54G to access public networks, imagine a dynamic Javascript-based interface, to scan for networks and see signal strength and effects of antenna adjustment in real time! Wiviz is the Open Source project under GNU GPL that does just this. Visit http://devices.natetrue.com/wiviz/ for the projects home page!

What would be nice to eventually see is a point and click option to configure the link up to a selected network.

## Wiviz on DD-WRT

Thanks to User Lament who has ported Wiviz to DD-WRT! See Forum Post.

## Installation

First enable jffs2, and clean jffs2, found under the administration tab/management tab of the web DD-WRT Control Interface, if you have not done so already.

Use telnet or SSH (if enabled) to log in as root on the router. If using Windows XP, you can type 'telnet' from a run command, and use the command 'open 192.168.1.1' (assuming your router ip is 192.168.1.1), to gain access to the router. Type 'root' as username, and your router password, as the password.

Next type the following commands (in bold).

cd /jffs/ This puts us in the jffs directory from root directory

wget http://lament.rutka.net/wiviz-jffs.tar.gz This downloads the permanent (ie, stored in jffs file structure) program

tar -xvzf wiviz-jffs.tar.gz This extracts files

ln -s /jffs/www /tmp/ This makes the symlink. Please note that there are 3 spaces in this line

That should allow your browser to see the wiviz page at

http://192.168.1.1/user/wiviz/wiviz.html or http://routerip/user/wiviz/wiviz.html

Finally clean up by typing

USING A SAMBA SHARE INSTEAD OF JFFS If you lack the space necessary to install on JFFS (Using a large installation on a WRT54G is the usual reason) you can simulate JFFS using a network share. See jffs on WRT54G. Then just follow the above instructions.

IMPORTANT: The link is only for the current session, and must be recreated for each session. Perform the following instructions to create the link automatically on startup.

You will need to create a subdirectory /jffs/etc/ if it doesn't already exist.

ls /jffs/ List the jffs/ directory to see if etc/ exists.

If not, then mkdir /jffs/etc Makes the new subdirectory etc/

mkdir /jffs/etc/config Creates a new subdirectory to /jffs/etc/ of config/

echo "rm -r /tmp/www" > /jffs/etc/config/wi-viz.startup Creates startup file with first line

echo "ln -s /jffs/www /tmp/" >> /jffs/etc/config/wi-viz.startup Appends second line

chmod 700 /jffs/etc/config/wi-viz.startup Sets file permissions

Note: The wiviz page only displays output - the input settings do not function with DD-WRT.

In order to get around not being able to change to channel hopping, you can manually create a wiviz config file.

echo "channelsel=hop&hopseq=1,6,11" > /tmp/wiviz-cfg

channelsel = Either the word "hop" or the channel number to monitor. The default is to monitor the channel already in use by the card.

hopseq = A comma seperated list of channels to hop through in the order of your choice.

Remember: Channel hopping does NOT work when in AP mode.

## Wishlist

• Graphical signal strength and noise plot function
• List stations mode with their signal strength graph on the side (to allow to identifiy directions when scanning using directional antennae)
• Automate antenna comparison by using the firmware antenna selector function
• Can IPs be extracted from the packets?

## Buglists

• sometimes network icons drift out of the screen and everything shifts out of sight:

-> Solution: Replace the declump function in wiviz.js Java Script with this:

```function declump() {
var c = 0;
var top = 150,bottom = -350,left = 550,right = -550;
for (i = 0; i < hosts.length; i++) {
for (j = 0; j < hosts.length; j++) {
if (i == j) continue;
e1 = document.getElementById(hosts[i].mnem);
e2 = document.getElementById(hosts[j].mnem);
if (!e1 || !e2) continue;
x1 = parseInt(e1.style.left);
x2 = parseInt(e2.style.left);
y1 = parseInt(e1.style.top);
y2 = parseInt(e2.style.top);
ox = x2;
oy = y2;
if (x2 > left) x2 = left;
if (x2 < right) x2 = right;
if (y2 > top) y2 = top;
if (y2 < bottom) y2 = bottom;
dist = Math.sqrt(Math.pow((x1-x2), 2) + Math.pow((y1-y2), 2));
if (dist == 0) {
x2 += Math.random() * 5;
y2 += Math.random() * 5;
dist = 10;
}
if (dist < 100) {
cx = (x1-x2) * 5 / (dist / 3);
cy = (y1-y2) * 5 / (dist / 3);
x2 -= cx;
y2 -= cy;
}
if (hosts[j].apmnem == hosts[i].mnem
|| hosts[i].apmnem == hosts[j].mnem) {
if (dist > 150) {
cx = (x1-x2) * 5 / (dist / 3);
cy = (y1-y2) * 5 / (dist / 3);
x2 += cx;
y2 += cy;
}
}
if (Math.abs(ox-x2) > 2 || Math.abs(oy-y2) > 2) {
e2.style.left = parseInt(x2);
e2.style.top = parseInt(y2);
c++;
}
}
}
```