1 | """ |
---|
2 | ------------------------------------------------------------------------------ |
---|
3 | Mango 802.11 Reference Design Experiments Framework - Interactive Node |
---|
4 | ------------------------------------------------------------------------------ |
---|
5 | License: Copyright 2014-2019, Mango Communications. All rights reserved. |
---|
6 | Distributed under the WARP license (http://warpproject.org/license) |
---|
7 | ------------------------------------------------------------------------------ |
---|
8 | This will initialize the nodes in NODE_SERIAL_LIST to allow interactive use of |
---|
9 | wlan_exp nodes. |
---|
10 | |
---|
11 | Hardware Setup: |
---|
12 | - Requires one or more WARP v3 nodes |
---|
13 | - PC NIC and ETH B on WARP v3 nodes connected to common Ethernet switch |
---|
14 | |
---|
15 | Required Script Changes: |
---|
16 | - Set NETWORK to the IP address of your host PC NIC network (eg X.Y.Z.0 for IP X.Y.Z.W) |
---|
17 | - Set NODE_SERIAL_LIST to the serial numbers of your WARP nodes |
---|
18 | |
---|
19 | Description: |
---|
20 | This will initialize all the nodes. Then, the script will create an |
---|
21 | interactive prompt to allow for manipulation of the nodes. |
---|
22 | ------------------------------------------------------------------------------ |
---|
23 | """ |
---|
24 | import wlan_exp.config as config |
---|
25 | import wlan_exp.util as util |
---|
26 | |
---|
27 | |
---|
28 | #------------------------------------------------------------------------- |
---|
29 | # Global experiment variables |
---|
30 | # |
---|
31 | |
---|
32 | # Change these values to match your experiment setup |
---|
33 | NETWORK = '10.0.0.0' |
---|
34 | USE_JUMBO_ETH_FRAMES = False |
---|
35 | NODE_SERIAL_LIST = ['W3-a-00001'] |
---|
36 | |
---|
37 | #------------------------------------------------------------------------- |
---|
38 | # Initialization |
---|
39 | # |
---|
40 | # Create an object that describes the network configuration of the host PC |
---|
41 | network_config = config.WlanExpNetworkConfiguration(network=NETWORK, |
---|
42 | jumbo_frame_support=USE_JUMBO_ETH_FRAMES) |
---|
43 | |
---|
44 | # Create an object that describes the WARP v3 nodes that will be used in this experiment |
---|
45 | nodes_config = config.WlanExpNodesConfiguration(network_config=network_config, |
---|
46 | serial_numbers=NODE_SERIAL_LIST) |
---|
47 | |
---|
48 | # Initialize the Nodes |
---|
49 | # This command will fail if any WARP v3 node does not respond |
---|
50 | nodes = util.init_nodes(nodes_config, network_config) |
---|
51 | |
---|
52 | print("\nInitialized nodes:") |
---|
53 | # Put each node in a known, good state |
---|
54 | for node in nodes: |
---|
55 | msg = " {0} ".format(repr(node)) |
---|
56 | |
---|
57 | print(msg) |
---|
58 | |
---|
59 | print("\n\n") |
---|
60 | print("*********************************************************************") |
---|
61 | print("Starting interactive console. The initialized wlan_exp node instances") |
---|
62 | print(" are stored in the list variable 'nodes', indexed in order of node ID") |
---|
63 | print("Example: blink LEDs at node ID 0: 'nodes[0].identify()'") |
---|
64 | print("*********************************************************************") |
---|
65 | print("\n\n") |
---|
66 | |
---|
67 | # Create Debug prompt |
---|
68 | util.debug_here() |
---|
69 | |
---|