HowTo/Bluetooth/UsingNH: bt_grid.pl

File bt_grid.pl, 3.5 KB (added by harisk, 17 years ago)

BT setup for btwifi_grid.rb

Line 
1#!/usr/bin/perl
2#
3# Login to the nodes and setup Bluetooth
4#
5
6
7# slave nodes
8@slaves = ("node1-2");
9
10#foreach $currentnode (@slaves)
11#{
12# system("")
13#}
14
15system("ssh root\@node10-11 pand --listen --role GN --master --autozap");
16print "ssh root\@node10-11 pand --listen --role GN --master --autozap \n";
17sleep 10;
18system("ssh root\@node7-10 pand --connect 00:0A:3A:53:CE:B5 --role PANU --autozap");
19print "ssh root\@node7-10 pand --connect 00:0A:3A:53:CE:B5 --role PANU --autozap \n";
20sleep 10;
21
22system("ssh root\@node14-15 pand --listen --role GN --master --autozap");
23print "ssh root\@node14-15 pand --listen --role GN --master --autozap \n";
24sleep 10;
25system("ssh root\@node18-18 pand --connect 00:0A:3A:53:D0:F2 --role PANU --autozap");
26print "ssh root\@node18-18 pand --connect 00:0A:3A:53:D0:F2 --role PANU --autozap \n";
27sleep 10;
28
29system("ssh root\@node13-8 pand --listen --role GN --master --autozap");
30print "ssh root\@node13-8 pand --listen --role GN --master --autozap \n";
31sleep 10;
32system("ssh root\@node14-10 pand --connect 00:0A:3A:53:D0:F8 --role PANU --autozap");
33print "ssh root\@node14-10 pand --connect 00:0A:3A:53:D0:F8 --role PANU --autozap \n";
34sleep 10;
35
36system("ssh root\@node13-10 pand --listen --role GN --master --autozap");
37print "ssh root\@node13-10 pand --listen --role GN --master --autozap \n";
38sleep 10;
39system("ssh root\@node15-9 pand --connect 00:0A:3A:53:D4:82--role PANU --autozap");
40print "ssh root\@node15-9 pand --connect 00:0A:3A:53:D4:82 --role PANU --autozap \n";
41sleep 10;
42
43system("ssh root\@node1-10 pand --listen --role GN --master --autozap");
44print "ssh root\@node1-10pand --listen --role GN --master --autozap \n";
45sleep 10;
46system("ssh root\@node4-10 pand --connect 00:0A:3A:53:D5:D8 --role PANU --autozap");
47print "ssh root\@node4-10 pand --connect 00:0A:3A:53:D5:D8 --role PANU --autozap \n";
48sleep 10;
49
50system("ssh root\@node10-11 ifconfig bnep0 192.170.10.11 netmask 255.255.0.0; exit");
51print "ssh root\@node10-11 ifconfig bnep0 192.170.10.11 netmask 255.255.0.0; exit \n";
52system("ssh root\@node7-10 ifconfig bnep0 192.170.7.10 netmask 255.255.0.0; exit");
53print "ssh root\@node7-10 ifconfig bnep0 192.170.7.10 netmask 255.255.0.0; exit \n";
54
55system("ssh root\@node14-15 ifconfig bnep0 192.171.14.15 netmask 255.255.0.0; exit");
56print "ssh root\@node14-15 ifconfig bnep0 192.171.14.15 netmask 255.255.0.0; exit \n";
57system("ssh root\@node18-18 ifconfig bnep0 192.171.18.18 netmask 255.255.0.0; exit");
58print "ssh root\@node18-18 ifconfig bnep0 192.171.18.18 netmask 255.255.0.0; exit \n";
59
60system("ssh root\@node13-8 ifconfig bnep0 192.172.13.8 netmask 255.255.0.0; exit");
61print "ssh root\@node13-8 ifconfig bnep0 192.172.13.8 netmask 255.255.0.0; exit \n";
62system("ssh root\@node14-10 ifconfig bnep0 192.172.14.10 netmask 255.255.0.0; exit");
63print "ssh root\@node14-10 ifconfig bnep0 192.172.14.10 netmask 255.255.0.0; exit \n";
64
65system("ssh root\@node13-10 ifconfig bnep0 192.173.13.10 netmask 255.255.0.0; exit");
66print "ssh root\@node13-10 ifconfig bnep0 192.173.13.10 netmask 255.255.0.0; exit \n";
67system("ssh root\@node15-9 ifconfig bnep0 192.173.15.9 netmask 255.255.0.0; exit");
68print "ssh root\@node15-9 ifconfig bnep0 192.173.15.9 netmask 255.255.0.0; exit \n";
69
70system("ssh root\@node1-10 ifconfig bnep0 192.174.1.10 netmask 255.255.0.0; exit");
71print "ssh root\@node1-10 ifconfig bnep0 192.174.1.10 netmask 255.255.0.0; exit \n";
72system("ssh root\@node4-10 ifconfig bnep0 192.174.4.10 netmask 255.255.0.0; exit");
73print "ssh root\@node4-10 ifconfig bnep0 192.174.4.10 netmask 255.255.0.0; exit \n";