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

Tasmota EI-OT dual RS232 Modul Sniffer Modus

RS232 dual Module Sniffer Bridge Mode
RS232 Sniffer Modus

Sniffer zu Deutsch Schnüffler Modus beschreibt im Eigentlichen bereits den Sniffer Modus.

Seit mittlerweile über 20 Jahren hat der USB (Universal Serial Bus) die typische serielle Anbindung mittels RS232 am typischen Computer weitestgehend abgelöst. Dementsprechend kann die Anbindung eines Gerätes mit RS232 Schnittstelle eine gewisse Herausforderung darstellen. Oftmals wird zu günstigen USB TTL Konvertern gegriffen um ein RS232 Signal auf eine USB Schnittstelle umzusetzen. Insofern das Endgerät seine RS232 Schnittstelle mit 5V Level betreibt (sehr unwahrscheinlich / dann wäre es keine RS232 Schnittstelle) kann das sogar funktionieren.

Da das EI-OT dual RS232 Modul jedwede Signale auf WLan umsetzt ist die Anbindung an jedweden Computer, oder sonstiges Endgerät mit WLan Schnittstelle möglich.

Was aber wenn die RS232 Schnittstelle von 2 Endgeräten genutzt wird, mit einfachen Worten wenn 2 Geräte über eine RS232 Schnittstelle kommunizieren.

Hier kommt typischerweise ein Sniffer zum Einsatz, dabei werden sämtliche Daten an beide RS232 Teilnehmer / Geräte durchgereicht und sämtliche Daten protokolliert, im Detail auf ein weiteres Protokoll übersetzt.

RS232 COM Interface

For over 20 years now, the USB (Universal Serial Bus) has largely replaced the typical serial connection using RS232 on the typical computer. Accordingly, connecting a device with an RS232 interface can be a certain challenge. Cheap USB TTL converters are often used to convert an RS232 signal to a USB interface. To the extent that the end device operates its RS232 interface with a 5V level (very unlikely / then it would not be an RS232 interface) it can even work.

Since the EI-OT dual RS232 module converts any signals to WiFi, it can be connected to any computer or other device with a WiFi interface.

But what if the RS232 interface is used by 2 end devices, in simple words if 2 devices communicate via one RS232 interface.

A sniffer is typically used here, all data is passed on to both RS232 participants/devices and all data is logged and translated in detail into another protocol.

RS232 serial TCP COM Port Configuration
RS232 Sniffer Konfigurieren

Zwar verfügt das EI-OT dual RS232 Modul über 2 RS232 Schnittstellen, jedoch funktionieren beide Schnittstellen unabhängig voneinander. Die Grundlage für einen RS232 Sniffer wird im eigentlich schon durch den typischen RS232 Anschluss transparent:

  • RX auf TX
  • TX auf RX

Allerdings erfolgt diese Brücke nicht mittels Hardware sondern Software, basierend auf einer einfachen Regel

Empfängt die eine RS232 Schnittstelle etwas reiche die Daten an die andere Schnittstelle durch.

Basierend auf der Tasmota Firmware, im Detail Tasmota Rules lautet die Rule wie folgt:

Rule1 ON SerialReceived#Data DO SSerialSend1 %value% ENDON ON SSerialReceived#Data DO SerialSend1 %value% ENDON

Nachfolgend die einfache Konfiguration des RS232 Sniffer Modus

  1. füge die Tasmota Rule1 ON SerialReceived#Data DO SSerialSend1 %value% ENDON ON SSerialReceived#Data DO SerialSend1 %value% ENDON
    in die Befehlszeile der Tasmota Konsole ein und drücke die Taste ENTER
  2. aktiviere die Rule durch Eingabe von
    Rule1 1
    in die Kommandozeile und drücke erneut die ENTER Taste und schon ist der Sniffer Modus aktiv
  3. sendet man nun Daten, hier im Beispiel einen String an die zweite RS232 Schnittstelle – im Detail Hardware Serial Bridge GPIO4 und GPIO5 – werden die Daten im Tasmota RS232 Modul empfangen und gleichermassen an die erste RS232 Schnittstelle – UART Schnittstelle GPIO1 und GPIO3 – gesendet
  4. gleichermassen – sendet man ein Signal an die erste RS232 Schnittstelle werden die Daten  empfangen, und gleichermassen auf die Hardware Serial Bridge (GPIO4 und GPIO5) durchgereicht, im Detail über die zweite RS232 Schnittstelle ausgegeben.

Es gilt zu beachten für dieses Beispiel wurden 2 Stück CP2102 RS232 (nicht USB TTL Konverter) verwendet.

Fügt man nun eine weitere Tasmota Rule hinzu, können sämtliche Daten beispielsweise über MQTT bereitgestellt werden.

RS232 Sniffer Configuration

Although the EI-OT dual RS232 module has 2 RS232 interfaces. Both interfaces normally work independently of each other. The basis for an RS232 sniffer is actually made clear by the typical RS232 connection:

  • RX to TX
  • TX to RX

However, this bridge is not done using hardware but rather software, based on a simple rule

If one RS232 interface receives something, the data is passed on to the other interface.

Based on the Tasmota firmware, in detail Tasmota Rules the rule is as follows:

Rule1 ON SerialReceived#Data DO SSerialSend1 %value% ENDON ON SSerialReceived#Data DO SerialSend1 %value% ENDON

Below is the simple configuration of the RS232 sniffer mode

  1. add the Tasmota Rule1 ON SerialReceived#Data DO SSerialSend1 %value% ENDON ON SSerialReceived#Data DO SerialSend1 %value% ENDON
    into the command line of the Tasmota console and press the ENTER key
  2. activate the rule by entering
    Rule1 1
    in the command line and press the ENTER key again and the sniffer mode is active
  3. If you now send data, here in the example a string, to the second RS232 interface – in detail Hardware Serial Bridge GPIO4 and GPIO5 – the data is received in the Tasmota RS232 module and equally sent to the first RS232 interface – UART interface GPIO1 and GPIO3 –
  4. if you send a signal to the first RS232 interface, the data is received and passed on to the hardware serial bridge (GPIO4 and GPIO5), and output in detail via the second RS232 interface.

Please note that for this example, 2 CP2102 RS232 (not USB TTL converters) were used.

If you now add another Tasmota rule, all data can be provided via MQTT, for example.

Schreibe einen Kommentar

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