The SockServer is an application providing a set of services used by the WiFi CMSIS-Driver Validation suite to test the Socket interface of the WiFi driver. It is located in the .\Tools\SockServer subdirectory of the pack root directory. The SockServer is available for different target systems. It runs several standard network services.
The SockServer is available for following target systems:
- Personal Computer running Microsoft Windows (executable located in .\Tools\SockServer\PC\Win)
- Keil MCB4300 evaluation board (µVision project located in .\Tools\SockServer\Embedded\MDK\Board\MCB4300)
- Keil MCBSTM32F400 evaluation board (µVision project located in .\Tools\SockServer\Embedded\MDK\Board\MCBSTM32F400)
- Note
- To run SockServer in an embedded system, you need a license for MDK-Professional (for the MDK-Middleware Network component).
The following services are available by SockServer:
- Echo service on port 7, TCP and UDP
(two instances of TCP service, one instance of UDP service)
- Discard service on port 9, TCP and UDP
(one instance of TCP service, one instance of UDP service)
- Chargen service on port 19, TCP and UDP
(two instances of TCP service, one instance of UDP service)
- Assistant service on port 5000
(helper service used to test WiFi sockets in server mode (socket accept functionality))
- Telnet service on port 23
(SockServer status monitoring service)
- Note
- SockServer provides the Telnet service only in embedded systems.
SockServer for PC running Microsoft Windows
Requirements:
- Personal Computer running Microsoft Windows
- PC connection to local network
SockServer is already built and can be executed by running the SockServer.exe file in .\Tools\SockServer\PC\Win
If you need to change the functionality of SockServer, source files and a batch script for building the executable are available in .\Tools\SockServer\PC\Win.
- Note
- SockServer build process requires Minimalist GNU for Windows (MinGW).
- To build the SockServer executable for Windows, follow these steps:
Troubleshooting
Problems and solutions:
- SockServer not responding to requests
- Open Windows firewall -> Advanced settings
- create a new custom rule (New Rule...)
- Rule type: Program
- Program: This program path (select path to SockServer.exe)
- Action: Allow the connection
- Profile: Domain, Private (Public not advised)
- Name: SockServer
- Test computer not responding to ping
- Open Windows firewall -> Advanced settings
- select inbound rules, enable rule File and Printer sharing (Echo request - ICMPv4-In)
- If rule does not exist, create a new custom rule (New Rule...)
- Rule type: Custom
- Program: All programs
- Protocol type: ICMPv4
- ICMP Settings: Customize - Specific ICMP types: Echo Request
- Scope: Any IP address
- Action: Allow the connection
- Profile: Domain, Private (Public not advised)
- Name: Ping Echo
SockServer for embedded systems
Requirements:
- Keil MCB4300 or Keil MCBSTM32F400 evaluation board
- Wired Ethernet connection to local network
Using the Telnet service
The Telnet service provides information about received and sent data. This can help to resolve driver problems when WiFi socket sending and receiving does not work. For example, when the transfer test fails, either SocketSend or SocketRecv functions may have failed or both.
For the Telnet connection from the PC, open a CMD window. At the prompt, type the following command or use another Telnet client application:
The initial page opens:
Initial telnet connection
You can view the remote IP address, port number, receiving and transmitting counters with the stat command:
Status monitoring
Status monitor constantly updates the SockServer status on the screen. To stop the screen update, press any telnet client key.
- Note
- You might need to enable the Telnet service in Windows 10 first. Here's a tutorial on how to do this.
Porting SockServer to other targets
Currently, the SockServer application is available for the MCB4300 and MCBSTM32F400 evaluation boards. To create SockServer application for a different target device, follow the steps below:
- Create new network project in µVision
- Select and configure the following software components:
- Network:Core and configure the host name and pool size in Net_Config.c
#define NET_HOST_NAME "SockServer"
#define NET_MEM_POOL_SIZE 16384
- Network:Interface:Ethernet and configure the MAC address in Net_Config_ETH0.h to avoid collisions
#define ETH0_MAC_ADDR "1E-30-6C-A2-45-5A"
- Network:Socket:BSD and configure number of sockets in Net_Config_BSD.h
#define BSD_NUM_SOCKS 8
#define BSD_SERVER_SOCKS 4
- Network:Socket:TCP and configure number of sockets in Net_Config_TCP.h
- Network:Socket:UDP and configure number of sockets in Net_Config_UDP.h
- Network:Service:Telnet server and disable authentication in Net_Config_Telnet_Server.h
#define TELNET_SERVER_AUTH_ENABLE 0
- CMSIS Driver:Ethernet/MAC/PHY(API) depending on your hardware
- Configure device specific hardware:
- Configure the CMSIS-Driver for Ethernet and other device specific components (clock system, I/O, ...) as required. Please consult your device's/board's documentation for more information.
- Copy and add SockServer.c and SockServer.h files to the project
- Copy and add Telnet_Server_UIF.c to the project
- Add the code to start the services in main.c
static void app_main (void *argument) {
netInitialize ();
osDelay (500);
osThreadNew(DgramServer, NULL, NULL);
osThreadNew(StreamServer, NULL, NULL);
osThreadNew(TestAssistant, NULL, NULL);
}
- Increase the default RTX stack size to 400 bytes in RTX_Config.h
#define OS_STACK_SIZE 400
- Set the default global stack to 1024 bytes and heap to 6144 bytes in your device's startup file
Stack_Size EQU 0x00000400
Heap_Size EQU 0x00001800
Troubleshooting
Problems and solutions:
- SockServer on multiple embedded systems on the same local network
- Set unique ETH0_MAC_ADDR in Net_Config_ETH0.h for each embedded system in embedded system project