source: ReferenceDesigns/w3_802.11/python/examples/interactive_node.py

Last change on this file was 6320, checked in by chunter, 5 years ago

1.8.0 release wlan-exp

File size: 2.7 KB
Line 
1"""
2------------------------------------------------------------------------------
3Mango 802.11 Reference Design Experiments Framework - Interactive Node
4------------------------------------------------------------------------------
5License:   Copyright 2014-2019, Mango Communications. All rights reserved.
6           Distributed under the WARP license (http://warpproject.org/license)
7------------------------------------------------------------------------------
8This will initialize the nodes in NODE_SERIAL_LIST to allow interactive use of
9wlan_exp nodes.
10
11Hardware 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
15Required 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
19Description:
20  This will initialize all the nodes.  Then, the script will create an
21interactive prompt to allow for manipulation of the nodes.
22------------------------------------------------------------------------------
23"""
24import wlan_exp.config as config
25import wlan_exp.util as util
26
27
28#-------------------------------------------------------------------------
29#  Global experiment variables
30#
31
32# Change these values to match your experiment setup
33NETWORK              = '10.0.0.0'
34USE_JUMBO_ETH_FRAMES = False
35NODE_SERIAL_LIST     = ['W3-a-00001']
36
37#-------------------------------------------------------------------------
38#  Initialization
39#
40# Create an object that describes the network configuration of the host PC
41network_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
45nodes_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
50nodes = util.init_nodes(nodes_config, network_config)
51
52print("\nInitialized nodes:")
53# Put each node in a known, good state
54for node in nodes:
55    msg  = "    {0} ".format(repr(node))
56
57    print(msg)
58
59print("\n\n")
60print("*********************************************************************")
61print("Starting interactive console. The initialized wlan_exp node instances")
62print(" are stored in the list variable 'nodes', indexed in order of node ID")
63print("Example: blink LEDs at node ID 0: 'nodes[0].identify()'")
64print("*********************************************************************")
65print("\n\n")
66
67# Create Debug prompt
68util.debug_here()
69
Note: See TracBrowser for help on using the repository browser.