| 1 | {{{#!comment |
| 2 | [[Include(wiki:802.11/beta-note)]] |
| 3 | }}} |
| 4 | |
| 5 | [[TracNav(802.11/TOC)]] |
| 6 | |
| 7 | = 802.11 Reference Design: Blink Node LEDs Example = |
| 8 | |
| 9 | This example of the Experiments Framework is very simple. It uses a simple Python script to send a broadcast command to all WARP v3 nodes which causes them to blink the hex dispaly LEDs for 5 seconds. This script is a good way to test your Python installation, PC network configuration, nodes configuration and Ethernet connections. |
| 10 | |
| 11 | '''Source:''' the script is included in the '''Python_Reference''' folder of the 802.11 Reference Design archive. The latest version of the code is also displayed below. |
| 12 | |
| 13 | To run the script: |
| 14 | * Open a Python shell |
| 15 | * CD to the '''Python_Reference/Examples''' directory |
| 16 | * Run {{{python blink_node_leds.py}}} |
| 17 | |
| 18 | ---- |
| 19 | |
| 20 | {{{#!python |
| 21 | |
| 22 | """ |
| 23 | This script blinks the red LEDs of all nodes to ensure broadcast communication |
| 24 | |
| 25 | Hardware Setup: |
| 26 | - Requires one or more WARP v3 nodes configured with the 802.11 Reference |
| 27 | Design v0.81 or later. |
| 28 | - PC NIC and ETH B on WARP v3 nodes connected to common gigbit Ethernet switch |
| 29 | |
| 30 | Required Script Changes: |
| 31 | - Set HOST_INTERFACES to the IP address of your host PC NIC |
| 32 | |
| 33 | Description: |
| 34 | This script will cause all nodes on each of the host interfaces to |
| 35 | blink their LEDs. |
| 36 | """ |
| 37 | import time |
| 38 | import wlan_exp.warpnet.util as wn_util |
| 39 | |
| 40 | # NOTE: change these values to match your experiment setup |
| 41 | HOST_INTERFACES = ['10.0.0.250'] |
| 42 | |
| 43 | # Issue identify all command |
| 44 | # Wait 1 second before issuing the command to make sure all nodes are ready |
| 45 | time.sleep(1) |
| 46 | wn_util.wn_identify_all_nodes(HOST_INTERFACES) |
| 47 | |
| 48 | }}} |