At this point, your setup should include a Wi-SUN network formed by the XBee Hive Wi-SUN as Border Router and two XBee Wi-SUN modules.

This exercise demonstrates basic IPv6 communication over the Wi-SUN network using XBee Studio terminals and consoles. The goal is to verify that the XBee Hive Wi-SUN and the XBee Wi-SUN modules can exchange UDP packets over the mesh, both from the Border Router to the nodes and in the opposite direction.

Follow these steps to verify bidirectional communication between the Border Router and the XBee nodes:

1. Listen for data on an XBee Wi-SUN module

In the XBee Console of one of your XBee Wi-SUN modules, create and open a listener socket:

  1. Open the XBee Console in XBee Studio for one of your XBee Wi-SUN modules.

  2. Click Open the connection with the device (plug icon) in the console’s top toolbar.

  3. Create the socket:

    1. Click the Send data section to expand it.

    2. Click the Add a packet to the list (plus sign + icon) button in the Send data section. The Add a data packet popup appears.

    3. Enter the name of the frame to be added to the list, for example, Create socket.

    4. Click Create an API frame to expand the API frames generator control.

    5. Select the following values:

    6. Click Add packet. The popup is closed and the API frame is added to the list of packets.

    7. Select the Create socket packet from the list and click Send selected packet.

      The packet is sent and appears in the Console log in blue.

      A new frame 0xC0 - Socket Create Response is received and it is listed in red.

    8. Select the 0xC0 - Socket Create Response frame and get the Socket ID field. For the first socket opened its value is 0.

  4. Open the socket to listen for data at port 0x2616 (9750):

    1. Click the Send data section to expand it.

    2. Click the Add a packet to the list (plus sign + icon) button in the Send data section. The Add a data packet popup appears.

    3. Enter the name of the frame to be added to the list, for example, Listen.

    4. Click Create an API frame to expand the API frames generator control.

    5. Select the following values:

    6. Click Add packet. The popup is closed and the API frame is added to the list of packets.

    7. Select the Listen packet from the list and click Send selected packet.

      The packet is sent and appears in the Console log in blue.

      A new frame 0xC6 - Socket Listen Response is received and it is listed in red.

    8. Select the 0xC6 - Socket Listen Response frame to review it. It indicates the status of the action.

2. Send data from your XBee Hive Wi-SUN

Now that the destination XBee Wi-SUN module is listening for incoming data, send a message from the XBee Hive Wi-SUN using the Terminal in XBee Studio:

  1. Get the IPv6 address of the actively-listening XBee Wi-SUN:

    1. In XBee Studio, right-click on the tab of the listening XBee Wi-SUN module.

    2. Select Copy > Mesh IPv6 from the context menu.

  2. In XBee Studio, open the Terminal for your XBee Hive Wi-SUN.

  3. Detach the Border Router tab to have both listening and sending device’s terminals visible.

  4. In the XBee Hive Wi-SUN tab, click Open the connection with the device (plug icon) in the terminal’s top toolbar.

    A selection menu is displayed:

    Access selection menu:
    
    	a: Admin CLI
    	s: Shell
    	q: Quit
    
    Select access or quit [admin] :
  5. Type S to access the XBee Hive Wi-SUN shell.

  6. Execute the following command to send Hello from BR to the listening module.

    echo "Hello from BR" | socat -v - udp6-sendto:[<destination_ipv6>]:9750

    Where <destination_ipv6> is the IPv6 address copied in the previous step. For example:

    # echo "Hello from BR" | socat -v - udp6-sendto:[FD12:0:0:0:0:0:0:ABCD]:9750
    > 2025/06/27 14:21:26.364657  length=14 from=0 to=13
    Hello from BR
    # 
  7. At this point, a new 0xCB -Socket Receive From - IPv6 frame is received in the listener module’s XBee Console. Click on this frame and verify the received payload is Hello from BR.

  8. Close the listener socket. In the XBee Console of the listener module:

    1. Click the Send data section to expand it.

    2. Click the Add a packet to the list (plus sign + icon) button in the Send data section. The Add a data packet popup appears.

    3. Enter the name of the frame to be added to the list, for example, Close all sockets.

    4. Click Create an API frame to expand the API frames generator control.

    5. Select the following values:

    6. Click Add packet. The popup is closed and the API frame is added to the list of packets.

    7. Select the Close all sockets packet from the list and click Send selected packet.

      The packet is sent and appears in the Console log in blue.

      A new frame 0xC3 - Socket Close Response is received and it is listed in red.

    8. Select the 0xC3 - Socket Close Response frame to review it. It indicates the status of the action.

3. Listen for data on the XBee Hive Wi-SUN

Now reverse the roles: the Border Router will listen for incoming data, and a XBee Wi-SUN module will send a message to it.

In the Terminal of the XBee Hive Wi-SUN in XBee Studio, execute the following command to listen for incoming data at port 9750 (0x2616):

socat -u UDP6-RECVFROM:9750,fork SYSTEM:'echo "FROM: $SOCAT_PEERADDR:$SOCAT_PEERPORT"; head -c 1024'

This prints incoming packets with their sender’s address and payload.

4. Send data from an XBee Wi-SUN module

Once the Border Router is ready to receive, use one of the XBee Wi-SUN modules to send a test message back over the mesh:

  1. Get the IPv6 address of the XBee Hive Wi-SUN:

    1. In XBee Studio, right-click on the XBee Hive Wi-SUN tab.

    2. Select Copy > Mesh IPv6 from the context menu.

  2. Send data from a XBee Wi-SUN module. In the XBee Console of one of your modules:

    1. Click the Send data section to expand it.

    2. Click the Add a packet to the list (plus sign + icon) button in the Send data section. The Add a data packet popup appears.

    3. Enter the name of the frame to be added to the list, for example, Send data to BR.

    4. Click Create an API frame to expand the API frames generator control.

    5. Select the following values:

      • Frame type: 0x1A - IPv6 Tx Request

      • Frame ID: 01

      • IPv6 dest. address: The XBee Hive Wi-SUN address you have just copied.

      • Destination port: 2616

      • RF data: Hello from node

    6. Click Add packet. The popup is closed and the API frame is added to the list of packets.

    7. Select the Send data to BR packet from the list and click Send selected packet.

      The packet is sent and appears in the Console log in blue.

      A new frame 0x89 - TX (Transmit) Status is received and it is listed in red.

    8. Select the 0x89 - TX (Transmit) Status frame to review it. It indicates the status of the action.

  3. In the Terminal of the XBee Hive Wi-SUN, data is received:

    # socat -u UDP6-RECVFROM:9750,fork SYSTEM:'echo "FROM: $SOCAT_PEERADDR:$SOCAT_PEERPORT"; head -c 1024'
    FROM: [fd12:0000:0000:0000:0000:0000:0000:abcd]:37484
    Hello from node

5. Summary

This exercise confirms that IPv6 communication is working as expected across your Wi-SUN network. You have validated that the Border Router can send and receive UDP packets to and from the nodes.

This basic level of connectivity is the foundation for all higher-level functionality, including socket-based applications, MicroPython scripts, and cloud integration.

You can now experiment with different UDP ports, payload formats, or even test direct communication between Wi-SUN nodes to explore additional use cases.


< Step 6
Step 6.2 >