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:
-
Open the XBee Console in XBee Studio for one of your XBee Wi-SUN modules.
-
Click Open the connection with the device (plug icon) in the console’s top toolbar.
-
Create the socket:
-
Click the Send data section to expand it.
-
Click the Add a packet to the list (plus sign
+icon) button in the Send data section. The Add a data packet popup appears. -
Enter the name of the frame to be added to the list, for example, Create socket.
-
Click Create an API frame to expand the API frames generator control.
-
Select the following values:
-
Frame type:
0x40 - Socket Create
-
-
Click Add packet. The popup is closed and the API frame is added to the list of packets.
-
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 Responseis received and it is listed in red. -
Select the
0xC0 - Socket Create Responseframe and get the Socket ID field. For the first socket opened its value is0.
-
-
Open the socket to listen for data at port
0x2616(9750):-
Click the Send data section to expand it.
-
Click the Add a packet to the list (plus sign
+icon) button in the Send data section. The Add a data packet popup appears. -
Enter the name of the frame to be added to the list, for example, Listen.
-
Click Create an API frame to expand the API frames generator control.
-
Select the following values:
-
Frame type:
0x46 - Socket Bind/Listen -
Frame ID:
01 -
Socket ID: The Socket ID field value of the received
0xC6 - Socket Listen Response. For the first time00. -
Source port:
2616
-
-
Click Add packet. The popup is closed and the API frame is added to the list of packets.
-
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 Responseis received and it is listed in red. -
Select the
0xC6 - Socket Listen Responseframe 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:
-
Get the IPv6 address of the actively-listening XBee Wi-SUN:
-
In XBee Studio, right-click on the tab of the listening XBee Wi-SUN module.
-
Select Copy > Mesh IPv6 from the context menu.
-
-
In XBee Studio, open the Terminal for your XBee Hive Wi-SUN.
-
Detach the Border Router tab to have both listening and sending device’s terminals visible.
-
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] : -
Type S to access the XBee Hive Wi-SUN shell.
-
Execute the following command to send
Hello from BRto the listening module.echo "Hello from BR" | socat -v - udp6-sendto:[<destination_ipv6>]:9750Where
<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 # -
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. -
Close the listener socket. In the XBee Console of the listener module:
-
Click the Send data section to expand it.
-
Click the Add a packet to the list (plus sign
+icon) button in the Send data section. The Add a data packet popup appears. -
Enter the name of the frame to be added to the list, for example, Close all sockets.
-
Click Create an API frame to expand the API frames generator control.
-
Select the following values:
-
Frame type:
0x43 - Socket Close -
Frame ID:
01 -
Socket ID:
FFto close all opened sockets.
-
-
Click Add packet. The popup is closed and the API frame is added to the list of packets.
-
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 Responseis received and it is listed in red. -
Select the
0xC3 - Socket Close Responseframe 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:
-
Get the IPv6 address of the XBee Hive Wi-SUN:
-
In XBee Studio, right-click on the XBee Hive Wi-SUN tab.
-
Select Copy > Mesh IPv6 from the context menu.
-
-
Send data from a XBee Wi-SUN module. In the XBee Console of one of your modules:
-
Click the Send data section to expand it.
-
Click the Add a packet to the list (plus sign
+icon) button in the Send data section. The Add a data packet popup appears. -
Enter the name of the frame to be added to the list, for example, Send data to BR.
-
Click Create an API frame to expand the API frames generator control.
-
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
-
-
Click Add packet. The popup is closed and the API frame is added to the list of packets.
-
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) Statusis received and it is listed in red. -
Select the
0x89 - TX (Transmit) Statusframe to review it. It indicates the status of the action.
-
-
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.