EI-OT dual RS232 ESP8266 Tasmota Modul Konfiguration
RS232 WLan WiFi,  RS485 Module,  UART seriell

RS232 Dual Modul Tasmota TCP Bridge Konfiguration

RS232 over TCP thru WiFi USB/TTL serial Bridge
RS232 COM Schnittstelle

Die RS232 Schnittstelle hat ihren Ursprung in den 1960er Jahren und wird mittlerweile häufig durch den Universal Serial Bus ersetzt. Dementsprechend verfügen viele PC’s und auch Notebooks über keine physische RS232 Schnittstelle mehr, eine serielle Datenübertragung erfolgt meist über USB (Universal Serial Bus). Bei MAC’s ist generell keine RS232 / COM Schnittstelle mehr verfügbar. Da RS232 aber häufig zur Anbindung von Endgeräten Anwendung findet, bedarf es meist entsprechender RS232 / USB Konverter.

Vorteil dieser kabelgebundenen RS232 Verbindung ist die Herstellung eines “physischen”, im Detail virtuellen COM Port. Der virtuelle COM Port wird dabei direkt in dem jeweiligen Betriebssystem bereitgestellt, bzw. kann direkt in einer Software angesprochen werden.

Neben der kabelgebundenen RS232 Anbindung kann gleichermassen ein virtueller COM Port über WLan realisiert werden.

Im nachfolgenden Tutorial wird mittels

  • einem ESP8266 USB WiFi Bridge Modul, serielle Datenpakete einer USB Schnittstelle auf WLan umgesetzt
  • einem EI-OT Dual  RS232 WiFi Bridge Modul, RS232 Signale auf WLan umgesetzt

Das USB WiFi Bridge Modul erfüllt dabei die Funktion eines virtuellen COM Port am Host und erfüllt sämtliche Rahmenbedingungen eines typischen RS232 Anschluss.

Die grundlegenden Parameter einer WLan gebundenen COM Schnittstelle unterscheiden sich nicht im Vergleich zu einer kabelgebundenen RS232 Schnittstelle

  • serielles Protokoll
  • Baudrate
  • Steuerzeichen

Die seriellen Daten werden lediglich auf WLan umgesetzt und über TCP transferiert.

Im Vorfeld muss zunächst die Basiskonfiguration des

durchgeführt werden. Ferner muß nun noch die TCP UART Bridge am

aktiviert (GPIO1 als TCP Tx und GPIO3 als TCP Rx konfiguriert) werden.

Der Host Rechner verfügt nun über einen empfangsbereiten virtuellen COM Port.

RS232 COM Interface

The RS232 COM Interface is a standard originally introduced in 1960 for serial communication transmission of data. Meanwhile most Computers are based on other serial Interface such as USB (Universal Serial Bus). Because of RS232 Standard often RS232 is used to connect Devices to Computers thru RS232 / USB Converter.

Advantage of a wired RS232 connection is a “physical”, in Detail virtual COM Port. The virtual COM Port is directly available thru Operating System and is available in Software Applications.

Besides the wired RS232 Connection, a virtual COM Port can be realized thru WiFi.

In our tutorial we describe a RS232 Connection thru WiFi and a virtual COM Port

  • the ESP8266 USB WiFi Bridge transfer serial Data from USB  to WiFi
  • the EI-OT Dual RS232 WiFi Bridge Module transfer serial Data thru WiFi

The USB WiFi Bridge Module enables full virtual COM Port functionality.

The basic of serial Data transfer is based on same parameters such as regular / wired RS232 / COM Port serial connection.

  • serial protocol
  • baudrate
  • Control Character

The serial Data are just transferred thru TCP over WiFi.

First step  Module Basic Configuration

After Basic Configuration of USB WiFi Bridge Module is finished TCP serial Bridge Mode of

must be enabled (set GPIO1 to TCP Tx and GPIO3 to TCP Rx).

The host computer now has a virtual COM port ready to receive.

Tasmota TCP COM Port Configuration
Tasmota Konfigurieren

Nun muss das EI-OT Dual RS232 Modul noch entsprechend mittels der Tasmota Weboberfläche konfiguriert werden, sodass RS232 Signale direkt auf TCP umgesetzt werden. In diesem Beispiel wird die zweite RS232 Schnittstelle des EI-OT dual RS232 Moduls, also GPIO4 und GPIO5 verwendet und entsprechend innerhalb der Tasmota Firmware wie folgt konfiguriert:

  1. klicke im Tasmota Webinterface auf Configuration
  2. klicke im Tasmota Modul Configuration Menü auf Configure Module
  3. setze GPIO4 auf TCP TX und GPIO5 auf TCP RX und klicke auf Save
  4. Tasmota führt einen Neustart des Moduls durch, alsbald das Tasmota Webinterface erscheint klicke auf Tools
  5. klicke im Tools Menü auf Console
  6. die Tasmota Console erscheint, schließe die TCP Konfiguration wie nach folgend beschrieben durch Konsolenbefehle ab.
Tasmota Configuration

Now the EI-OT Dual RS232 module must be configured accordingly using the Tasmota web interface so that RS232 signals are converted directly to TCP. In this example, the second RS232 interface of the EI-OT dual RS232 module, i.e. GPIO4 and GPIO5, is used and configured accordingly within the Tasmota firmware as follows:

  1. click on Configuration in the Tasmota web interface
  2. click on Configure Module in the Tasmota Module Configuration menu
  3. set GPIO4 to TCP TX and GPIO5 to TCP RX and click Save
  4. Tasmota will restart the module, as soon as the Tasmota web interface appears click on Tools
  5. click Console in the Tools menu
  6. The Tasmota Console appears, complete the TCP configuration using console commands as described below.
RS232 Tasmota serial TCP COM Port Configuration
TCP COM Port Konfigurieren

Im Eigentlichen ist die Anbindung einer virtuellen COM Schnittstelle über WLan und Tasmota TCP Socket einer typischen COM Port Anbindung gleichzusetzen. Im Detail Bedarf es dabei der typischen Konfiguration der seriellen Schnittstelle die mittels Konsole und Kommandozeilen Eingabe wie folgt konfiguriert wird

  1. Baudrate beider Module, ist typischerweise die Baudrate des Endgerätes welches mittels RS232 Modul verbunden ist. In unserem Beispiel wird eine Baudrate von 115200 durch Eingabe von TCPBaudrate 115200
    in die Kommandozeile und Drücken der Taste ENTER gesetzt. Der Parameter Baudrate muss in beiden Modulen konfiguriert und identisch sein.
  2. serielles Protokoll, ist typischerweise entsprechend dem über das RS232 Modul angeschlossene Endgerät, in unserem Beispiel
    Daten Bits 8
    Parität None / keine
    Stop Bits 1
    und wird durch Eingabe von TCPConfig 8N1 in die Kommandozeile und drücken der Taste ENTER gesetzt. Auch hier muss das serielle Protokoll gleichlautend bei beiden Modulen sein
  3. die Aktivierung des TCP Socket erfolgt hier im Beispiel über den Port 8080 und wird durch Eingabe von TCPStart 8080 in die Kommandozeile beider Module und drücken der Taste ENTER konfiguriert
  4. abschliessend muss nun eine TCP Socket Verbindung zwischen beiden Modulen hergestellt werden, im gezeigten Beispiel erfolgt die Anbindung vom EI-OT dual RS232 Modul mit der IP 192.168.178.115 zum USB WiFi Bridge Modul mit der IP Adresse 192.168.178.71. Die TCP Socket Verbindung wird hergestellt durch Eingabe von TCPConnect 8080, 192.168.178.71
    in die Kommandozeile des RS232 Moduls und durch drücken der Taste ENTER.

Sobald die Verbindung erfolgreich hergestellt wurde, gibt die Konsole des USB WiFi Bridge Moduls Got connection from 192.168.178.71 aus.

TCP COM Port COnfiguration

Compared to a regular COM Port connection  there is no big difference to a Tasmota TCP Socket based COM Port connection. It requires also typical COM Port / Interface Parameter configuration such as

  1. Baudrate of both Modules, normally Baudrate its based on RS232 Module connected Device. In our example we use a Baudrate of 115200 and its set thru Command Line Input TCPBaudrate 115200
    followed by pressing ENTER Key. Baudrate must be configured on RS232 and USB WiFi Bridge Module, the Baudrate must be identical.
  2. serial Protocol, is also based on RS232 Module connected Device, in our Example
    Data Bits 8
    Parity None
    Stop Bits 1
    and is configured thru Command Line Input TCPConfig 8N1 and pressing ENTER Key. Serial Protocol must be identical and also set on both Modules
  3. the serial Data are send thru TCP Socket, in our Example we use  Port 8080. The TCP Socket is enabled thru  TCPStart 8080 Command Line Input and set thru pressing ENTER Key
  4. now a TCP Socket connection must be activated to connect  RS232 Module (IP 192.168.178.75) to USB WiFi Bridge Module (IP 192.168.178.115). The TCP Socket connection is established thru  TCPConnect 8080, 192.168.178.71
    Command Line input and pressing ENTER Key.

Soon as TCP Socket connection is active, in USB WiFi Bridge Console the message Got connection from 192.168.178.71 appears.

Schreibe einen Kommentar

Deine E-Mail-Adresse wird nicht veröffentlicht. Erforderliche Felder sind mit * markiert