Autor Thema: TX22 - RAWDATA vs. Schema aus der Header Datei?  (Gelesen 200 mal)

Offline njordan

  • New Member
  • *
  • Beiträge: 3
TX22 - RAWDATA vs. Schema aus der Header Datei?
« am: 19 August 2018, 14:45:13 »
Hallo,
kann mir bitte jemand helfen die RAW Data zu verstehen....speziell weil ich den Zusammenhang zum Kommentar aus der HeaderDatei (@TX22 Sketch) nicht erkennen kann.....

Folgendes wird im Terminal ausgespuckt, sieht aus wie in den anderen Threats die bisher zum TX22 besprochen wurden.....

Read line from port /dev/ttyUSB1: OK WS 42 1 4 238 58 0 0 10 140 0 0 0 0 1(kein Wind!)

Kann mir bitte jemand das Format erklären. Danke! Norbert

TX22-IT  8842 kbps  868.3 MHz
-----------------------------
Message Format:
SSSS.DDDD DDAE.LQQQ TTTT.VVVV VVVV.VVVV ... CCCC.CCCC
Data - organized in nibbles - are structured as follows (example with blanks added for clarity):
a 5a 5 0 628 1 033 2 000 3 e00 4 000 bd

data always starts with "a"
from next 1.5 nibbles (here 5a) the 6 msb are identifier of transmitter,
bit 1 indicates acquisition/synchronizing phase
bit 0 will be 1 in case of error
next bit is the low battery flag
next three bits (here 5) is count of quartets transmitted
up to 5 quartets of data follow
each quartet starts with a type indicator (here 0,1,2,3,4)
0: temperature: 3 nibbles bcd coded tenth of °C plus 400 (here 628-400 = 22.8°C)
1: humidity: 3 nibbles bcd coded (here 33 %rH)
2: rain: 3 nibbles, counter of contact closures
3: wind: first nibble direction of wind vane (multiply by 22.5 to obtain degrees, here 0xe*22.5 = 315 degrees)
   next two nibbles wind speed in m/s
4: gust: speed in m/s
next two bytes (here bd) are crc.
During acquisition/synchronizing phase (abt. 5 hours) all 5 quartets are sent, see example above. Thereafter
data strings contain only a few ( 1 up to 3) quartets, so data strings are not always of equal length.


                    |--- acquisition/synchronizing phase
                    ||-- Error
        "A"  -Addr.-|| Nbr.Q
        SSSS.DDDD DDAE.LQQQ  T          H          R          W          G           CRC
TX22IT [A    1    D    3                1  0 7 2   2  0 1 B   3  C F E               C4    ] CRC:OK S:A ID:7 NewBatt:0 Error:1 Temp:---   Hum:72  Rain:27.00 Wind:25.40m/s from:270.00 Gust:---      CRC:C4
TX22IT [A    1    D    2                           2  0 1 B   3  D F E               3A    ] CRC:OK S:A ID:7 NewBatt:0 Error:1 Temp:---   Hum:--- Rain:27.00 Wind:25.40m/s from:292.50 Gust:---      CRC:3A
TX22IT [A    1    D    2                           2  0 1 B   3  E F E               17    ] CRC:OK S:A ID:7 NewBatt:0 Error:1 Temp:---   Hum:--- Rain:27.00 Wind:25.40m/s from:315.00 Gust:---      CRC:17
TX22IT [A    1    C    3                1  0 7 3   2  0 1 B              4  0  0  0  8A    ] CRC:OK S:A ID:7 NewBatt:0 Error:0 Temp:---   Hum:73  Rain:27.00 Wind:---      from:---    Gust:0.00 m/s CRC:8A
TX22IT [A    1    C    1                           2  0 1 B                          E     ] CRC:OK S:A ID:7 NewBatt:0 Error:0 Temp:---   Hum:--- Rain:27.00 Wind:---      from:---    Gust:---      CRC:E
TX22IT [A    1    C    2     0  5 5 3              2  0 1 B                          19    ] CRC:OK S:A ID:7 NewBatt:0 Error:0 Temp:15.30 Hum:--- Rain:27.00 Wind:---      from:---    Gust:---      CRC:19

Offline HCS

  • Developer
  • Hero Member
  • ****
  • Beiträge: 2961
Antw:TX22 - RAWDATA vs. Schema aus der Header Datei?
« Antwort #1 am: 20 August 2018, 09:06:29 »
Das sind zwei verschiedene Dinge.

Das Zitat aus der TX22IT.cpp beschreibt das Protokoll, das vom TX22 gesendet wird.
Die vom Sensor empfangenen Daten verden vom LGW decodiert, geprüft und dann in einem einheitlichen sensorunabhängigen Format an FHEM weitergegeben.
So. z.B.: OK WS 42 1 4 238 58 0 0 10 140 0 0 0 0 1
Dieses Format ist in der WSBase.cpp beschrieben.