]> begriffs open source - cmsis-driver-validation/blob - docs/html/group__wifi__sock__setup.html
use https url
[cmsis-driver-validation] / docs / html / group__wifi__sock__setup.html
1 <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
2 <html xmlns="http://www.w3.org/1999/xhtml">
3 <head>
4 <meta http-equiv="Content-Type" content="text/xhtml;charset=UTF-8"/>
5 <meta http-equiv="X-UA-Compatible" content="IE=9"/>
6 <title>SockServer</title>
7 <title>CMSIS-Driver Validation: SockServer</title>
8 <link href="tabs.css" rel="stylesheet" type="text/css"/>
9 <link href="drv.css" rel="stylesheet" type="text/css" />
10 <script type="text/javascript" src="jquery.js"></script>
11 <script type="text/javascript" src="dynsections.js"></script>
12 <script type="text/javascript" src="printComponentTabs.js"></script>
13 <link href="navtree.css" rel="stylesheet" type="text/css"/>
14 <script type="text/javascript" src="resize.js"></script>
15 <script type="text/javascript" src="navtree.js"></script>
16 <script type="text/javascript">
17   $(document).ready(initResizable);
18   $(window).load(resizeHeight);
19 </script>
20 <link href="search/search.css" rel="stylesheet" type="text/css"/>
21 <script type="text/javascript" src="search/search.js"></script>
22 <script type="text/javascript">
23   $(document).ready(function() { searchBox.OnSelectItem(0); });
24 </script>
25 <link href="stylsheetf" rel="stylesheet" type="text/css" />
26 </head>
27 <body>
28 <div id="top"><!-- do not remove this div, it is closed by doxygen! -->
29 <div id="titlearea">
30 <table cellspacing="0" cellpadding="0">
31  <tbody>
32  <tr style="height: 46px;">
33   <td id="projectlogo"><img alt="Logo" src="keilarm.png"/></td>
34   <td style="padding-left: 0.5em;">
35    <div id="projectname">CMSIS-Driver Validation
36    &#160;<span id="projectnumber">Version 3.0.0</span>
37    </div>
38    <div id="projectbrief">Driver Validation</div>
39   </td>
40  </tr>
41  </tbody>
42 </table>
43 </div>
44 <!-- end header part -->
45 <div id="DRVnav" class="tabs1">
46     <ul class="tablist">
47       <script type="text/javascript">
48                 <!--
49                 writeComponentTabs.call(this);
50                 //-->
51       </script>
52           </ul>
53 </div>
54 <!-- Generated by Doxygen 1.8.6 -->
55 <script type="text/javascript">
56 var searchBox = new SearchBox("searchBox", "search",false,'Search');
57 </script>
58   <div id="navrow1" class="tabs">
59     <ul class="tablist">
60       <li><a href="index.html"><span>Main&#160;Page</span></a></li>
61       <li><a href="pages.html"><span>Usage&#160;and&#160;Description</span></a></li>
62       <li><a href="modules.html"><span>Reference</span></a></li>
63       <li>
64         <div id="MSearchBox" class="MSearchBoxInactive">
65         <span class="left">
66           <img id="MSearchSelect" src="search/mag_sel.png"
67                onmouseover="return searchBox.OnSearchSelectShow()"
68                onmouseout="return searchBox.OnSearchSelectHide()"
69                alt=""/>
70           <input type="text" id="MSearchField" value="Search" accesskey="S"
71                onfocus="searchBox.OnSearchFieldFocus(true)" 
72                onblur="searchBox.OnSearchFieldFocus(false)" 
73                onkeyup="searchBox.OnSearchFieldChange(event)"/>
74           </span><span class="right">
75             <a id="MSearchClose" href="javascript:searchBox.CloseResultsWindow()"><img id="MSearchCloseImg" border="0" src="search/close.png" alt=""/></a>
76           </span>
77         </div>
78       </li>
79     </ul>
80   </div>
81 </div><!-- top -->
82 <div id="side-nav" class="ui-resizable side-nav-resizable">
83   <div id="nav-tree">
84     <div id="nav-tree-contents">
85       <div id="nav-sync" class="sync"></div>
86     </div>
87   </div>
88   <div id="splitbar" style="-moz-user-select:none;" 
89        class="ui-resizable-handle">
90   </div>
91 </div>
92 <script type="text/javascript">
93 $(document).ready(function(){initNavTree('group__wifi__sock__setup.html','');});
94 </script>
95 <div id="doc-content">
96 <!-- window showing the filter options -->
97 <div id="MSearchSelectWindow"
98      onmouseover="return searchBox.OnSearchSelectShow()"
99      onmouseout="return searchBox.OnSearchSelectHide()"
100      onkeydown="return searchBox.OnSearchSelectKey(event)">
101 <a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(0)"><span class="SelectionMark">&#160;</span>All</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(1)"><span class="SelectionMark">&#160;</span>Files</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(2)"><span class="SelectionMark">&#160;</span>Functions</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(3)"><span class="SelectionMark">&#160;</span>Variables</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(4)"><span class="SelectionMark">&#160;</span>Macros</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(5)"><span class="SelectionMark">&#160;</span>Groups</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(6)"><span class="SelectionMark">&#160;</span>Pages</a></div>
102
103 <!-- iframe showing the search results (closed by default) -->
104 <div id="MSearchResultsWindow">
105 <iframe src="javascript:void(0)" frameborder="0" 
106         name="MSearchResults" id="MSearchResults">
107 </iframe>
108 </div>
109
110 <div class="header">
111   <div class="headertitle">
112 <div class="title">SockServer<div class="ingroups"><a class="el" href="group__dv__wifi.html">WiFi Validation</a></div></div>  </div>
113 </div><!--header-->
114 <div class="contents">
115 <p>The <b>SockServer</b> 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 <b>.\Tools\SockServer</b> subdirectory of the pack root directory. The SockServer is available for different target systems. It runs several standard network services.</p>
116 <p>The SockServer is available for following target systems:</p>
117 <ul>
118 <li><b>Personal Computer</b> running Microsoft Windows (executable located in <b>.\Tools\SockServer\PC\Win</b>)</li>
119 <li><b>Keil MCB4300</b> evaluation board (µVision project located in <b>.\Tools\SockServer\Embedded\MDK\Board\MCB4300</b>)</li>
120 <li><b>Keil MCBSTM32F400</b> evaluation board (µVision project located in <b>.\Tools\SockServer\Embedded\MDK\Board\MCBSTM32F400</b>)</li>
121 </ul>
122 <dl class="section note"><dt>Note</dt><dd>To run SockServer in an embedded system, you need a license for MDK-Professional (for the MDK-Middleware Network component).</dd></dl>
123 <p>The following services are available by SockServer:</p>
124 <ul>
125 <li><b>Echo</b> service on port <span class="XML-Token">7</span>, TCP and UDP <br/>
126  (two instances of TCP service, one instance of UDP service)</li>
127 <li><b>Discard</b> service on port <span class="XML-Token">9</span>, TCP and UDP <br/>
128  (one instance of TCP service, one instance of UDP service)</li>
129 <li><b>Chargen</b> service on port <span class="XML-Token">19</span>, TCP and UDP <br/>
130  (two instances of TCP service, one instance of UDP service)</li>
131 <li><b>Assistant</b> service on port <span class="XML-Token">5000</span> <br/>
132  (helper service used to test WiFi sockets in server mode (socket accept functionality))</li>
133 <li><b>Telnet</b> service on port <span class="XML-Token">23</span> <br/>
134  (SockServer status monitoring service)</li>
135 </ul>
136 <dl class="section note"><dt>Note</dt><dd>SockServer provides the Telnet service only in embedded systems.</dd></dl>
137 <h1><a class="anchor" id="sockserver_pc"></a>
138 SockServer for PC running Microsoft Windows</h1>
139 <p><b>Requirements:</b> </p>
140 <ul>
141 <li>Personal Computer running Microsoft Windows</li>
142 <li>PC connection to local network</li>
143 </ul>
144 <p>SockServer is already built and can be executed by running the SockServer.exe file in <b>.\Tools\SockServer\PC\Win</b></p>
145 <p>If you need to change the functionality of SockServer, source files and a batch script for building the executable are available in <b>.\Tools\SockServer\PC\Win</b>.</p>
146 <dl class="section note"><dt>Note</dt><dd><ul>
147 <li>SockServer build process requires Minimalist GNU for Windows (MinGW).</li>
148 <li>To build the SockServer executable for Windows, follow these steps:<ul>
149 <li>Download and install MinGW from <a href="https://osdn.net/projects/mingw/releases/">https://osdn.net/projects/mingw/releases/</a></li>
150 <li>Set environment path in Microsoft Windows as explained under Environment Settings heading on <a href="http://www.mingw.org/wiki/Getting_Started">http://www.mingw.org/wiki/Getting_Started</a></li>
151 <li>Run <b>Build.bat</b> located in <b>.\Tools\SockServer\PC\Win</b> which will result in an executable that is located in <b>.\Tools\SockServer\PC\Win</b></li>
152 </ul>
153 </li>
154 </ul>
155 </dd></dl>
156 <h2><a class="anchor" id="sockserver_pc_win_troubleshooting"></a>
157 Troubleshooting</h2>
158 <p>Problems and solutions:</p>
159 <ol type="1">
160 <li>SockServer not responding to requests<ul>
161 <li>Open Windows firewall -&gt; Advanced settings<ul>
162 <li>select inbound rules</li>
163 </ul>
164 </li>
165 <li>create a new custom rule (New Rule...)<ul>
166 <li>Rule type: Program</li>
167 <li>Program: This program path (select path to SockServer.exe)</li>
168 <li>Action: Allow the connection</li>
169 <li>Profile: Domain, Private (Public not advised)</li>
170 <li>Name: SockServer</li>
171 </ul>
172 </li>
173 </ul>
174 </li>
175 <li>Test computer not responding to ping<ul>
176 <li>Open Windows firewall -&gt; Advanced settings<ul>
177 <li>select inbound rules, enable rule File and Printer sharing (Echo request - ICMPv4-In)</li>
178 </ul>
179 </li>
180 <li>If rule does not exist, create a new custom rule (New Rule...)<ul>
181 <li>Rule type: Custom</li>
182 <li>Program: All programs</li>
183 <li>Protocol type: ICMPv4</li>
184 <li>ICMP Settings: Customize - Specific ICMP types: Echo Request</li>
185 <li>Scope: Any IP address</li>
186 <li>Action: Allow the connection</li>
187 <li>Profile: Domain, Private (Public not advised)</li>
188 <li>Name: Ping Echo</li>
189 </ul>
190 </li>
191 </ul>
192 </li>
193 </ol>
194 <h1><a class="anchor" id="sockserver_embedded"></a>
195 SockServer for embedded systems</h1>
196 <p><b>Requirements:</b> </p>
197 <ul>
198 <li>Keil MCB4300 or Keil MCBSTM32F400 evaluation board</li>
199 <li>Wired Ethernet connection to local network</li>
200 </ul>
201 <h2><a class="anchor" id="sockserver_embedded_telnet"></a>
202 Using the Telnet service</h2>
203 <p>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 <b>SocketSend</b> or <b>SocketRecv</b> functions may have failed or both.</p>
204 <p>For the Telnet connection from the PC, open a CMD window. At the prompt, type the following command or use another Telnet client application: </p>
205 <div class="fragment"><div class="line">c:\&gt;telnet sockserver</div>
206 </div><!-- fragment --><p>The initial page opens: </p>
207 <div class="image">
208 <img src="SockServer.png" alt="SockServer.png"/>
209 <div class="caption">
210 Initial telnet connection</div></div>
211 <p> You can view the remote IP address, port number, receiving and transmitting counters with the <b>stat</b> command: </p>
212 <div class="image">
213 <img src="SockMonitor.png" alt="SockMonitor.png"/>
214 <div class="caption">
215 Status monitoring</div></div>
216 <p> Status monitor constantly updates the SockServer status on the screen. To stop the screen update, press any telnet client key.</p>
217 <dl class="section note"><dt>Note</dt><dd>You might need to enable the Telnet service in Windows 10 first. Here's a <a href="https://www.technipages.com/windows-10-enable-telnet" target="_blank">tutorial</a> on how to do this.</dd></dl>
218 <h2><a class="anchor" id="sockserver_embedded_porting"></a>
219 Porting SockServer to other targets</h2>
220 <p>Currently, the <b>SockServer</b> application is available for the <b>MCB4300</b> and <b>MCBSTM32F400</b> evaluation boards. To create SockServer application for a different target device, follow the steps below:</p>
221 <ol type="1">
222 <li>Create new network project in µVision</li>
223 <li>Select and configure the following software components:<ul>
224 <li><b>Network:Core</b> and configure the host name and pool size in <b>Net_Config.c</b> <div class="fragment"><div class="line"><span class="preprocessor">#define NET_HOST_NAME               &quot;SockServer&quot;</span></div>
225 <div class="line"><span class="preprocessor">#define NET_MEM_POOL_SIZE           16384</span></div>
226 </div><!-- fragment --></li>
227 <li><b>Network:Interface:Ethernet</b> and configure the MAC address in <b>Net_Config_ETH0.h</b> to avoid collisions <div class="fragment"><div class="line"><span class="preprocessor">#define ETH0_MAC_ADDR               &quot;1E-30-6C-A2-45-5A&quot;</span></div>
228 </div><!-- fragment --></li>
229 <li><b>Network:Socket:BSD</b> and configure number of sockets in <b>Net_Config_BSD.h</b> <div class="fragment"><div class="line"><span class="preprocessor">#define BSD_NUM_SOCKS               8</span></div>
230 <div class="line"><span class="preprocessor">#define BSD_SERVER_SOCKS            4</span></div>
231 </div><!-- fragment --></li>
232 <li><b>Network:Socket:TCP</b> and configure number of sockets in <b>Net_Config_TCP.h</b> <div class="fragment"><div class="line"><span class="preprocessor">#define TCP_NUM_SOCKS               9</span></div>
233 </div><!-- fragment --></li>
234 <li><b>Network:Socket:UDP</b> and configure number of sockets in <b>Net_Config_UDP.h</b> <div class="fragment"><div class="line"><span class="preprocessor">#define UDP_NUM_SOCKS               10</span></div>
235 </div><!-- fragment --></li>
236 <li><b>Network:Service:Telnet</b> server and disable authentication in <b>Net_Config_Telnet_Server.h</b> <div class="fragment"><div class="line"><span class="preprocessor">#define TELNET_SERVER_AUTH_ENABLE   0</span></div>
237 </div><!-- fragment --></li>
238 <li><b>CMSIS</b> <b>Driver:Ethernet/MAC/PHY</b>(API) depending on your hardware</li>
239 </ul>
240 </li>
241 <li>Configure device specific hardware:<ul>
242 <li>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.</li>
243 </ul>
244 </li>
245 <li>Copy and add <b>SockServer.c</b> and <b>SockServer.h</b> files to the project</li>
246 <li>Copy and add <b>Telnet_Server_UIF.c</b> to the project</li>
247 <li>Add the code to start the services in <b>main.c</b> <div class="fragment"><div class="line"><span class="comment">// Application main thread</span></div>
248 <div class="line"><span class="keyword">static</span> <span class="keywordtype">void</span> app_main (<span class="keywordtype">void</span> *argument) {</div>
249 <div class="line"> </div>
250 <div class="line">  netInitialize ();</div>
251 <div class="line">  osDelay (500);</div>
252 <div class="line"> </div>
253 <div class="line">  osThreadNew(DgramServer,   NULL, NULL);</div>
254 <div class="line">  osThreadNew(StreamServer,  NULL, NULL);</div>
255 <div class="line">  osThreadNew(TestAssistant, NULL, NULL);</div>
256 <div class="line">}</div>
257 </div><!-- fragment --></li>
258 <li>Increase the default RTX stack size to 400 bytes in <b>RTX_Config.h</b> <div class="fragment"><div class="line"><span class="preprocessor">#define OS_STACK_SIZE           400</span></div>
259 </div><!-- fragment --></li>
260 <li>Set the default global stack to 1024 bytes and heap to 6144 bytes in your device's <b>startup</b> <b>file</b> <div class="fragment"><div class="line">Stack_Size      EQU     0x00000400</div>
261 <div class="line">Heap_Size       EQU     0x00001800</div>
262 </div><!-- fragment --></li>
263 </ol>
264 <h2><a class="anchor" id="sockserver_embedded_troubleshooting"></a>
265 Troubleshooting</h2>
266 <p>Problems and solutions:</p>
267 <ol type="1">
268 <li>SockServer on multiple embedded systems on the same local network<ul>
269 <li>Set unique ETH0_MAC_ADDR in Net_Config_ETH0.h for each embedded system in embedded system project </li>
270 </ul>
271 </li>
272 </ol>
273 </div><!-- contents -->
274 </div><!-- doc-content -->
275 <!-- start footer part -->
276 <div id="nav-path" class="navpath"><!-- id is needed for treeview function! -->
277   <ul>
278     <li class="footer">Generated on Fri Jul 15 2022 08:42:09 for CMSIS-Driver Validation by ARM Ltd. All rights reserved.
279         <!--
280     <a href="http://www.doxygen.org/index.html">
281     <img class="footer" src="doxygen.png" alt="doxygen"/></a> 1.8.6 
282         -->
283         </li>
284   </ul>
285 </div>
286 </body>
287 </html>