Benutzer-Werkzeuge

Webseiten-Werkzeuge


esp8266_wifi_modules

Unterschiede

Hier werden die Unterschiede zwischen zwei Versionen angezeigt.

Link zu dieser Vergleichsansicht

Beide Seiten der vorigen Revision Vorhergehende Überarbeitung
Nächste Überarbeitung
Vorhergehende Überarbeitung
esp8266_wifi_modules [2014/12/18 23:44]
karl [TCP Server Example]
esp8266_wifi_modules [2017/04/04 06:42] (aktuell)
karl [Notes]
Zeile 103: Zeile 103:
  
 ready ready
-AT+CWJAP="MKZ","BE662F3BC9"+AT+CWJAP="ssid","key"
  
  
Zeile 191: Zeile 191:
 </code> </code>
  
-==== TCP Server Example ====+===== TCP Server Example ====
 +**Attention:** the linebreaks are modified for better readability\\ 
 <code> <code>
 AT+RST AT+RST
Zeile 248: Zeile 250:
 OK OK
 </code> </code>
 +
 +A server is opened on a specific port. To this port there can be up to 5 connections in parallel, TCP and UDP mixed. When responding, we have to set the 'mux' ID, which can be from 0 to 4. Each new incomming connection (For simplicity I name also UDP packets a "connection" here), the ID will be increased, and we can see the active connections with CIPSTATUS. 
 +
 +If we have multiple incomint TCP-connections from one client (multiple processes), we get multiple connections in the CIPSTATUS-list. Each with it's own reply port. \\
 +But if we get multiple UDP connections from one client (also different client-processes), only the most recent one is stored in the CIPSTATUS-list, even though they have different reply ports. 
 +
 +==== CIPSTATUS Example ====
 +<code>
 +AT+CIPSTATUS
 +STATUS:3
 ++CIPSTATUS:0,"TCP","192.168.1.105",50618,1
 ++CIPSTATUS:1,"TCP","192.168.1.105",50626,1
 ++CIPSTATUS:2,"UDP","192.168.1.105",37690,1
 +OK
 +</code>
 +
 +Here I opened 4 instances of the application "SocketTest v 3.0.0" on my notebook, and opened 2 TCP connections, and sent 2 UDP packets (broadcasts). But we can only see 3 active connections here. 
 +
 +===== Notes =====
 +When we close the server with
 +  AT+CIPSERVER=0
 +, then the module has to be resetted!
 +
 +As far as I know, we cannot find out, on which port the server was opened. 
 +
 +We can find the own IP address with 
 +  AT+CIFSR
 +. Note, that there is no questionmark!
 +
 +
 +{{tag>english software electronics wifi arduino product technical}}
 +
  
esp8266_wifi_modules.1418942643.txt.gz · Zuletzt geändert: 2014/12/18 23:44 von karl