wiki:802.11/wlan_exp/examples/blink_node_leds

Version 2 (modified by murphpo, 10 years ago) (diff)

--

802.11 Reference Design: Blink Node LEDs Example

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.

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.

To run this example:

  • Setup wlan_exp (see Getting Started for details
  • Configure your WARP v3 nodes with the 802.11 Reference Design bitstream (AP or STA)
  • Open a Python shell
  • CD to the Python_Reference/Examples directory from the expanded 802.11 Reference design archive
  • Run python blink_node_leds.py

"""
This script blinks the red LEDs of all nodes to ensure broadcast communication

Hardware Setup:
 - Requires one or more WARP v3 nodes configured with the 802.11 Reference
   Design v0.81 or later.
 - PC NIC and ETH B on WARP v3 nodes connected to common gigbit Ethernet switch

Required Script Changes:
  - Set HOST_INTERFACES to the IP address of your host PC NIC

Description:
  This script will cause all nodes on each of the host interfaces to 
blink their LEDs.
"""
import time
import wlan_exp.warpnet.util as wn_util

# NOTE: change these values to match your experiment setup
HOST_INTERFACES   = ['10.0.0.250']

# Issue identify all command
#   Wait 1 second before issuing the command to make sure all nodes are ready
time.sleep(1)
wn_util.wn_identify_all_nodes(HOST_INTERFACES)