drivers.ApogeePyro.ApogeePyro

Apogee SP-421 pyranometer driver over an SDI-12-to-UART serial bridge.

This module provides ApogeePyro, a low-level driver that speaks the SDI-12 v1.3 protocol to an Apogee SP-421 pyranometer through a USB/UART adapter. The sensor reports shortwave solar irradiance in W/m^2. The driver exposes a lifecycle that mirrors the contract defined by SensorBase.SensorBase.GenericSensor (initialize -> getSensorReading -> putSensorValue) so it can be plugged into the Oizom Gateway sensor orchestrator without an extra wrapper layer.

Example

>>> import serial
>>> from drivers.ApogeePyro.ApogeePyro import ApogeePyro
>>> ser = serial.Serial("/dev/ttyACM0", 1200, bytesize=serial.SEVENBITS,
...                     parity=serial.PARITY_EVEN,
...                     stopbits=serial.STOPBITS_ONE, timeout=2)
>>> pyr = ApogeePyro()
>>> pyr.initialize(ser, {"debug": False,
...                      "parameters": [{"sc": "sr", "pm": 1}]})
True
>>> reading = pyr.getSensorReading()

Note

Hardware specifics:

  • Sensor: Apogee SP-421 pyranometer (shortwave radiation, 360-1120 nm).

  • Interface: SDI-12 v1.3 tunnelled over UART at 1200 baud, 7 data bits, even parity, 1 stop bit (7E1 framing) with CR+LF command termination.

  • Default SDI-12 address is "1". Commands used are a! (address query / acknowledge active), aM0! (start measurement) and aD0! (read data), where a is the sensor address.

  • The 1.5 s post-command delay in send_command() is required by SDI-12 timing – shortening it leads to truncated or garbled responses.

Attributes

Classes

ApogeePyro

Driver for the Apogee SP-421 pyranometer over SDI-12.

Module Contents

drivers.ApogeePyro.ApogeePyro.basic_logger
drivers.ApogeePyro.ApogeePyro.context_logger
drivers.ApogeePyro.ApogeePyro.pyr