Star Network
Description
This Star Network application uses the SPARK Wireless Core to implement a star network topology. It consists of 3 SPARK devices, one Coordinator and two Nodes. Communication between the devices is halted at the beginning. Once a node is successfully paired with Coordinator, a bidirectional communication starts between them. The user can then repeat the same steps to pair another node device. This application provides a basic example of how to configure a point-to-multipoint connection.
Behavior
The Coordinator communicates bidirectionally with each Node. The Nodes do not communicate with each other. There are two types of information exchanges in this application.
Count Values: The Nodes send a “count value” to the Coordinator and the Coordinator sends a “count value” to both Nodes. Each device displays the count value it receives on a display linked to its serial interface.
Button State: The transmitted payload also contains one of the device’s button state. The receiving device uses a LED to represent the transmitting device’s button state.
Application Schedule
The following diagram illustrates the general structure of the schedule used in this application.
Figure 45: Star Network Application’s Schedule.
Pairing
On boot, devices attempt to pair automatically. If unsuccessful, manual pairing can be performed afterward to use the application. The Coordinator can pair with up to two nodes, one at a time.
- Auto Pairing:
On boot, devices automatically start the pairing process. RGB blinks blue twice to indicate that pairing is in progress.
If the first pairing attempt is unsuccessful, RGB blinks red twice after 10 seconds. Manual pairing is then required to pair the devices.
After a successful first pairing, RGB turns magenta. The Coordinator then attempts to pair with the second Node, and the Coordinator’s RGB blinks blue twice to indicate that the second pairing attempt is in progress.
If the second attempt fails, the Coordinator’s RGB blinks red twice after 10 seconds, then turns magenta, and the paired devices begin exchanging application data.
After a successful second pairing, the Coordinator’s RGB turns magenta and the paired devices begin exchanging application data.
- Manual Pairing:
Press the SW1 button on the Coordinator and one of the Nodes to start the pairing procedure; RGB blinks blue twice when doing so.
If the pairing procedure is unsuccessful, RGB blinks red twice after 10 seconds.
Once successfully paired, RGB turns magenta, and the paired devices begin exchanging application data.
Repeat the steps above on the Coordinator and the second Node.
- Unpairing:
When paired, pressing the SW2 button on the Coordinator, or the SW1 button again on the Node unpairs the device; RGB blinks red twice to indicate that unpairing has been completed.
Unpairing causes the devices to forget their learned addresses. The devices are no longer able to exchange application data.
To start a new pairing procedure, a node device must be unpaired first.
Note
LED behavior changes in pairing mode versus normal execution mode. During pairing mode, LEDs indicate pairing status as described below. Once paired, LEDs indicate fallback mode status.
- Auto Pairing:
On boot, devices automatically start the pairing process. LED0 blinks twice to indicate that pairing is in progress.
If the first pairing attempt is unsuccessful, all LEDs blink twice after 10 seconds. Manual pairing is then required to pair the devices.
After a successful first pairing, LEDs turn on sequentially, then turn off. The Coordinator then attempts to pair with the second Node, and the Coordinator’s LED0 blinks twice to indicate that the second pairing attempt is in progress.
If the second attempt fails, the Coordinator’s LEDs blink twice after 10 seconds, then turn on and off sequentially, and the paired devices begin exchanging application data.
After a successful second pairing, the Coordinator’s LEDs turn on sequentially, then turn off, and the paired devices begin exchanging application data.
- Manual Pairing:
Press and hold the SW1 button for 3 seconds on the Coordinator and one of the Nodes to start the pairing procedure; LED0 blinks twice when doing so.
If the pairing procedure is unsuccessful, all LEDs blink twice after 10 seconds.
Once successfully paired, LEDs turn on sequentially, then turn off, and the devices begin exchanging application data.
Repeat the steps above on the Coordinator and the second Node.
- Unpairing:
When paired, press and hold the SW2 on the Coordinator, or SW1 on the Node to unpair the device; All LEDs blink twice to indicate that unpairing has been completed.
Unpairing causes the devices to forget their learned addresses. The devices are no longer able to exchange application data.
To start a new pairing procedure, a node device must be unpaired first.
Coordinator User Interface
On the Coordinator, LED1 or LED2 would turn on if SW2 on Node 1 or Node 2 is pressed respectively. Pressing SW3 or SW4 on the Coordinator will turn on LED1 on Node 1 or Node 2 respectively.
Table 52: Coordinator User Interface Description Interface
Name
Description
SW1
Pair Device
Enter pairing mode.
SW2
Unpair Device
Unpair or abort the pairing process depending on the current state.
SW3
Node 1 Button State
Send SW3 state to Node 1 and turn on its LED1.
SW4
Node 2 Button State
Send SW4 state to Node 2 and turn on its LED1.
LED1
Node 1 Button activity
Turn on LED when SW2 on Node 1 is pressed.
LED2
Node 2 Button activity
Turn on LED when SW2 on Node 2 is pressed.
LED3
N/A
N/A
LED4
N/A
N/A
RGB
Pairing Event
Indicate pairing event as described in the pairing section.
On the Coordinator, LED1 or LED2 would turn on if SW2 on Node 1 or Node 2 is pressed respectively. Pressing briefly SW1 or SW2 on the Coordinator will turn on LED1 on Node 1 or Node 2 respectively.
Table 53: Coordinator User Interface Description Interface
Name
Description
SW1
Pair Device
Press and hold for 3 seconds: Enter pairing mode.
Node 1 Button activity
Send SW1 state to Node 1 and turn on its LED1.
SW2
Unpair Device
Press and hold for 3 seconds: Unpair or abort the pairing process depending on the current state.
Node 2 Button activity
Send SW2 state to Node 2 and turn on its LED1.
LED0
N/A
N/A
LED1
Node 1 Button activity
Turn on LED when SW2 on Node 1 is pressed.
LED2
Node 2 Button activity
Turn on LED when SW2 on Node 2 is pressed.
Node 1 User Interface
Pressing SW2 on Node 1 turns on LED1 on the Coordinator. LED2 turns on if SW3 is pressed on the Coordinator.
Table 54: Node 1 User Interface Description Interface
Name
Description
SW1
Pairing process
Pair, unpair, or abort the pairing process depending on the current state.
SW2
Button activity
Send SW2 state to Coordinator and turn on its LED1.
SW3
N/A
N/A
SW4
N/A
N/A
LED1
Button activity
Turn on LED when SW3 on Coordinator is pressed.
LED2
N/A
N/A
LED3
N/A
N/A
LED4
N/A
N/A
RGB
Pairing Event
Indicate pairing event as described in the pairing section.
Pressing SW2 on Node 1 turns on LED1 on the Coordinator.
Table 55: Node 1 User Interface Description Interface
Name
Description
SW1
Pairing process
Press and hold for 3 seconds: Pair, unpair, or abort the pairing process depending on the current state.
SW2
Button activity
Send SW2 state to Coordinator and turn on its LED1.
LED0
N/A
N/A
LED1
Button activity
Turn on LED when SW1 on Coordinator is pressed briefly.
LED2
N/A
N/A
Node 2 User Interface
Pressing SW2 on Node 2 turns on LED2 on the Coordinator. LED2 turns on if SW4 is pressed on the Coordinator.
Table 56: Node 2 User Interface Description Interface
Name
Description
SW1
Pairing process
Pair, unpair, or abort the pairing process depending on the current state.
SW2
Button activity
Send SW2 state to Coordinator and turn on its LED2.
SW3
N/A
N/A
SW4
N/A
N/A
LED1
Button activity
Turn on LED when SW4 on Coordinator is pressed.
LED2
N/A
N/A
LED3
N/A
N/A
LED4
N/A
N/A
RGB
Pairing Event
Indicate pairing event as described in the pairing section.
Pressing SW2 on Node 2 turns on LED2 on the Coordinator.
Table 57: Node 2 User Interface Description Interface
Name
Description
SW1
Pairing process
Press and hold for 3 seconds: Pair, unpair, or abort the pairing process depending on the current state.
SW2
Button activity
Send SW2 state to Coordinator and turn on its LED2.
LED0
N/A
N/A
LED1
Button activity
Turn on LED when SW2 on Coordinator is pressed briefly.
LED2
N/A
N/A
Certification
This application has the ability to run in Certification Mode.
When certification mode is active, a dedicated LED is activated to indicate that the mode is enabled. All activity status LEDs (transmission, reception, fallback, and payload) are suppressed so that only the certification indicator is visible.
Board |
Indicator |
|---|---|
Quasar |
RGB LED steady yellow. |
EVK1.4 |
Steady LED2. |
Only one level of certification is needed for this application since the datarate is constant. The activation process must be performed independently on the Coordinator and on each Node.
Table 59: Certification Mode Activation Certification Mode
Activation Process
Start Network Certification
Hold SW2 at startup until the LED 1 blinks once, then release.
Terminal
The following figure shows the terminal output of this application.
See Viewing the Terminal for details on how to view the terminal output.
Figure 46: Star Network Serial Interface Output (from left: Coordinator, Node 1 & Node 2).