Skip to content

ITHX iServer¤

OMEGA iTHX Series Temperature and Humidity Chart Recorder.

This class is compatible with the following model numbers:

  • iTHX-W3
  • iTHX-D3
  • iTHX-SD
  • iTHX-M
  • iTHX-W
  • iTHX-2

ITHX (Socket) ¤

ITHX(equipment: Equipment)

              flowchart LR
              msl.equipment_resources.omega.ithx.ITHX[ITHX]
              msl.equipment.interfaces.socket.Socket[Socket]
              msl.equipment.interfaces.message_based.MessageBased[MessageBased]
              msl.equipment.schema.Interface[Interface]

                              msl.equipment.interfaces.socket.Socket --> msl.equipment_resources.omega.ithx.ITHX
                                msl.equipment.interfaces.message_based.MessageBased --> msl.equipment.interfaces.socket.Socket
                                msl.equipment.schema.Interface --> msl.equipment.interfaces.message_based.MessageBased
                




              click msl.equipment_resources.omega.ithx.ITHX href "" "msl.equipment_resources.omega.ithx.ITHX"
              click msl.equipment.interfaces.socket.Socket href "" "msl.equipment.interfaces.socket.Socket"
              click msl.equipment.interfaces.message_based.MessageBased href "" "msl.equipment.interfaces.message_based.MessageBased"
              click msl.equipment.schema.Interface href "" "msl.equipment.schema.Interface"
            

OMEGA iTHX Series Temperature and Humidity Chart Recorder.

The default termination character for read and write operations is \r.

Regular-expression patterns that are used to select this Resource when connect() is called.

manufacturer=r"OMEGA"
model=r"iTHX-[2DMSW][3D]?"
flags=IGNORECASE

Parameters:

Name Type Description Default
equipment Equipment

An Equipment instance.

required
Source code in packages/resources/src/msl/equipment_resources/omega/ithx.py
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
def __init__(self, equipment: Equipment) -> None:
    r"""OMEGA iTHX Series Temperature and Humidity Chart Recorder.

    The default termination character for read and write operations is `\r`.

    Regular-expression patterns that are used to select this Resource when
    [connect()][msl.equipment.schema.Equipment.connect] is called.
    ```python
    manufacturer=r"OMEGA"
    model=r"iTHX-[2DMSW][3D]?"
    flags=IGNORECASE
    ```

    Args:
        equipment: An [Equipment][] instance.
    """
    super().__init__(equipment)
    self.read_termination: bytes = b"\r"
    self.write_termination: bytes = b"\r"

dewpoint ¤

dewpoint(probe: Literal[1, 2] = 1, *, celsius: bool = True) -> float

Read the dewpoint.

Parameters:

Name Type Description Default
probe Literal[1, 2]

The probe number to read the dewpoint of (for iTHX's that contain multiple probes).

1
celsius bool

True to return the dewpoint in celsius, False for fahrenheit.

True

Returns:

Type Description
float

The dewpoint for the specified probe.

Source code in packages/resources/src/msl/equipment_resources/omega/ithx.py
51
52
53
54
55
56
57
58
59
60
61
def dewpoint(self, probe: Literal[1, 2] = 1, *, celsius: bool = True) -> float:
    """Read the dewpoint.

    Args:
        probe: The probe number to read the dewpoint of (for iTHX's that contain multiple probes).
        celsius: `True` to return the dewpoint in celsius, `False` for fahrenheit.

    Returns:
        The dewpoint for the specified probe.
    """
    return self._get("DC" if celsius else "DF", probe)

humidity ¤

humidity(probe: Literal[1, 2] = 1) -> float

Read the percent humidity.

Parameters:

Name Type Description Default
probe Literal[1, 2]

The probe number to read the humidity of (for iTHX's that contain multiple probes).

1

Returns:

Type Description
float

The percent humidity for the specified probe.

Source code in packages/resources/src/msl/equipment_resources/omega/ithx.py
63
64
65
66
67
68
69
70
71
72
def humidity(self, probe: Literal[1, 2] = 1) -> float:
    """Read the percent humidity.

    Args:
        probe: The probe number to read the humidity of (for iTHX's that contain multiple probes).

    Returns:
        The percent humidity for the specified probe.
    """
    return self._get("H", probe)

reset ¤

reset(
    *,
    wait: bool = True,
    password: str | None = None,
    port: int = 2002,
    timeout: float = 10
) -> None

Power reset the iServer.

Some iServers accept the reset command (*SRYRST) to be sent via the TCP/UDP protocol and some require the reset command to be sent via the Telnet protocol.

Info

The telnetlib module was removed from the standard library in Python 3.13. If you need Telnet support consider using a third-party library from PyPI. You can review the source code of this method to see how Telnet messages are sent to the device to perform the reset.

Parameters:

Name Type Description Default
wait bool

Whether to wait for the connection to the iServer to be re-established before returning to the calling program. Rebooting an iServer takes about 10 to 15 seconds.

True
password str | None

The administrator's password of the iServer. If not specified then uses the default manufacturer's password. Only used if the iServer needs to be reset via the Telnet protocol.

None
port int

The port to use for the Telnet connection.

2002
timeout float

The timeout value to use during the Telnet session.

10
Source code in packages/resources/src/msl/equipment_resources/omega/ithx.py
 74
 75
 76
 77
 78
 79
 80
 81
 82
 83
 84
 85
 86
 87
 88
 89
 90
 91
 92
 93
 94
 95
 96
 97
 98
 99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
def reset(self, *, wait: bool = True, password: str | None = None, port: int = 2002, timeout: float = 10) -> None:
    """Power reset the iServer.

    Some iServers accept the reset command (`*SRYRST`) to be sent via the TCP/UDP protocol and
    some require the reset command to be sent via the Telnet protocol.

    !!! info
        The `telnetlib` module was removed from the standard library in Python 3.13.
        If you need Telnet support consider using a third-party library from PyPI.
        You can review the source code of this method to see how Telnet messages
        are sent to the device to perform the reset.

    Args:
        wait: Whether to wait for the connection to the iServer to be re-established before
            returning to the calling program. Rebooting an iServer takes about 10 to 15 seconds.
        password: The administrator's password of the iServer. If not specified then uses the
            default manufacturer's password. Only used if the iServer needs to be reset via
            the Telnet protocol.
        port: The port to use for the Telnet connection.
        timeout: The timeout value to use during the Telnet session.
    """

    def use_telnet() -> None:
        try:
            # telnetlib was removed in Python 3.13
            from telnetlib import Telnet  # type: ignore[import-not-found]  # pyright: ignore[reportUnknownVariableType, reportMissingImports]  # noqa: I001, PLC0415
        except ImportError:
            msg = "iTHX reset requires telnet, which is no longer part of the Python standard library"
            raise MSLConnectionError(self, msg) from None

        pw = password or "00000000"
        with Telnet(self._info.host, port, timeout=timeout) as tn:  # pyright: ignore[reportUnknownVariableType]  # noqa: S312
            tn.read_until(b"Password:", timeout=timeout)  # pyright: ignore[reportUnknownMemberType]
            tn.write(pw.encode() + b"\n")  # pyright: ignore[reportUnknownMemberType]
            tn.read_until(b"Login Successful", timeout=timeout)  # pyright: ignore[reportUnknownMemberType]
            tn.write(b"reset\n")  # pyright: ignore[reportUnknownMemberType]
            tn.read_until(b"The unit will reset in 5 seconds.", timeout=timeout)  # pyright: ignore[reportUnknownMemberType]

        if wait:
            # 5 seconds from the Telnet message
            # 10 seconds for the time it takes to reboot
            time.sleep(15)
            self.reconnect(max_attempts=-1)

    # according to the manual, these models require Telnet
    if self.equipment.model in ["iTHX-W", "iTHX-2"]:
        return use_telnet()

    # The manual indicates that iTHX-W3, iTHX-D3, iTHX-SD and iTHX-M
    # all accept the *SRYRST command
    reply = self.query("*SRYRST").strip()
    if reply == "Reset":
        # this was the reply that was received with an iTHX-W3
        # which accepts the reset command via TCP/UDP
        if wait:
            time.sleep(10)
            self.reconnect(max_attempts=-1)
    elif reply == "Serial Time Out":
        # this was the reply that was received with an iTHX-W
        # which does not recognize the *SRYRST command
        use_telnet()
    else:
        msg = f"Received an unexpected reply, {reply!r}, for the *SRYRST command"
        raise MSLConnectionError(self, msg)

    return None

temperature ¤

temperature(probe: Literal[1, 2] = 1, *, celsius: bool = True) -> float

Read the temperature.

Parameters:

Name Type Description Default
probe Literal[1, 2]

The probe number to read the temperature of (for iTHX's that contain multiple probes).

1
celsius bool

True to return the temperature in celsius, False for fahrenheit.

True

Returns:

Type Description
float

The temperature for the specified probe.

Source code in packages/resources/src/msl/equipment_resources/omega/ithx.py
159
160
161
162
163
164
165
166
167
168
169
def temperature(self, probe: Literal[1, 2] = 1, *, celsius: bool = True) -> float:
    """Read the temperature.

    Args:
        probe: The probe number to read the temperature of (for iTHX's that contain multiple probes).
        celsius: `True` to return the temperature in celsius, `False` for fahrenheit.

    Returns:
        The temperature for the specified probe.
    """
    return self._get("TC" if celsius else "TF", probe)