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.

  1. 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.

  2. 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.

Star Network schedule

Figure 11: Star Network Application’s Schedule.

Pairing

By default, devices are unpaired at boot. To use the application, start by pairing the devices.

Pairing:
  • Press the SW1 button on both devices to start the pairing procedure; RGB should blink blue twice when doing so.

  • If the pairing procedure is unsuccessful after 10 seconds, the pairing process stops and the RGB should blink red twice.

  • Once the pairing procedure is successfully completed, the RGB turns magenta and the devices can start exchanging application data.

Unpairing:
  • When paired, pressing the SW2 on the Coordinator, or SW1 again on the Node unpairs the device; the RGB should blink red twice to indicate the unpairing procedure is being done.

  • 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. The Coordinator can pair with up to two nodes, one at a time.

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 packet transmission and reception and fallback mode status.

Pairing:
  • Press the SW1 button on the Coordinator and one of the Nodes to start the pairing procedure; LED0 should blink twice when doing so.

  • If the pairing procedure is unsuccessful after 10 seconds, the pairing process stops and all the LEDs blink twice.

  • Once the pairing procedure is successfully completed, the LEDs will cascade and the devices can start exchanging application data.

  • Repeat the steps above on the Coordinator and the other Node. The Coordinator can pair with up to two nodes, one at a time.

Unpairing:
  • When paired, pressing the SW2 on the Coordinator, or SW1 again on the Node unpairs the device; All LEDs should blink twice to indicate the unpairing procedure is being done.

  • 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 5: Coordinator User Interface Description

Interface

Name

Description

SW1

Pair Device

Enter pairing mode.

SW2

Unpair Device

Enter unpairing mode.

SW3

Node 1 Button State

Send SW3 state to Node 1 and turn on its LED2.

SW4

Node 2 Button State

Send SW4 state to Node 2 and turn on its LED2.

LED1

Node 1 Button Press

Turn on LED when SW2 on Node 1 is pressed.

LED2

Node 2 Button Press

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, LED0 or LED1 would turn on if SW2 on Node 1 or Node 2 is pressed respectively.

Table 6: Coordinator User Interface Description

Interface

Name

Description

SW1

Pair Device

Enter pairing mode.

SW2

Unpair Device

Enter unpairing mode.

LED0

Node 1 Button Press

Turn on LED when SW2 on Node 1 is pressed.

LED1

Node 2 Button Press

Turn on LED when SW2 on Node 2 is pressed.

LED2

N/A

N/A

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 7: Node 1 User Interface Description

Interface

Name

Description

SW1

Pairing process

Pair or unpair the device depending on the current state.

SW2

Button state

Send SW2 state to Coordinator and turn on its LED1.

SW3

N/A

N/A

SW4

N/A

N/A

LED1

N/A

N/A

LED2

Button Press

Turn on LED when SW3 on Coordinator is pressed.

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 LED0 on the Coordinator.

Table 8: Node 1 User Interface Description

Interface

Name

Description

SW1

Pairing process

Pair or unpair the device depending on the current state.

SW2

Button state

Send SW2 state to Coordinator and turn on its LED0.

LED0

N/A

N/A

LED1

N/A

N/A

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 9: Node 2 User Interface Description

Interface

Name

Description

SW1

Pairing process

Pair or unpair the device depending on the current state.

SW2

Button state

Send SW2 state to Coordinator and turn on its LED2.

SW3

N/A

N/A

SW4

N/A

N/A

LED1

N/A

N/A

LED2

Button Press

Turn on LED when SW4 on Coordinator is pressed.

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 LED1 on the Coordinator.

Table 10: Node 2 User Interface Description

Interface

Name

Description

SW1

Pairing process

Pair or unpair the device depending on the current state.

SW2

Button state

Send SW2 state to Coordinator and turn on its LED1.

LED0

N/A

N/A

LED1

N/A

N/A

LED2

N/A

N/A

Terminal

The following figure shows the terminal output of this application.

See Viewing the Terminal for details on how to view the terminal output.

Star Network Serial Interface Output

Figure 12: Star Network Serial Interface Output (from left: Coordinator, Node 1 & Node 2).