RumPi 1.0
A self-assembling C++ sensor & actuator library for the Raspberry Pi 5
RumPi Namespace Reference

RumPi is the library's top-level facade. More...

Classes

class  AlertEvent
 A single alert event: a metric crossing (or recovering from) a threshold, with the reading that triggered it. More...
 
class  AlertManager
 A singleton that components hand readings to. More...
 
class  BaseComponent
 Abstract base class for every component (sensor, actuator, etc.) the library manages. More...
 
class  BMP180
 BMP180 barometric temperature and pressure sensor (I2C), also deriving altitude from the measured pressure. More...
 
class  BMP280
 BMP280 barometric temperature and pressure sensor (I2C), also deriving altitude from the measured pressure. More...
 
class  ComponentCreationContext
 Everything a component creator needs, bundled so every creator can share one signature and live in the factory's lookup map. More...
 
class  ComponentFactory
 Builds the sensor components described by a JSON manifest and adds them to a ComponentManager. More...
 
class  ComponentManager
 Owns and drives the set of sensor components. More...
 
class  DHT11
 The DHT11 temperature and humidity sensor. More...
 
class  DualLED
 A bi-color LED driven by two PWM pins (one per color). More...
 
class  GasData
 Gas data (its response curve and danger level) used by the MQ gas sensors. More...
 
class  GasSensor
 Base class for the MQ-series gas sensors (MQ2, MQ7, ...). More...
 
class  HCSR501
 An HC-SR501 PIR motion sensor. More...
 
class  IAnalogDigitalConverterComponent
 Interface for analog-to-digital converter components (e.g. More...
 
class  LCD1602
 Standard 16x2 character LCD screen (LCD1602) driven over I2C. More...
 
class  LED
 A very simple standard LED, driven by a single GPIO pin. More...
 
class  Logger
 A singleton that subscribes to the AlertManager and writes alert events to a per-session log file (and the console) from a background worker thread. More...
 
class  MCP3008
 MCP3008 analog-to-digital converter chip (SPI), providing 8 channels to read analog sensors on the Raspberry Pi. More...
 
class  Motor
 A DC motor driven through an H-bridge, with an optional enable pin and a wheel alignment used when steering. More...
 
class  MQ135
 MQ-135 gas sensor, typically used for detecting Carbon Dioxide (CO2) PPM. More...
 
class  MQ2
 MQ-2 gas sensor, typically used for detecting smoke. More...
 
class  MQ3
 MQ-3 gas sensor, typically used for detecting alcohol vapor (breathalyzer). More...
 
class  MQ4
 MQ-4 gas sensor, typically used for detecting methane. More...
 
class  MQ5
 MQ-5 gas sensor, typically used for detecting LPG and natural gas (propane). More...
 
class  MQ6
 MQ-6 gas sensor, typically used for detecting LPG and propane. More...
 
class  MQ7
 MQ-7 gas sensor, typically used for detecting carbon monoxide. More...
 
class  MQ8
 MQ-8 gas sensor, typically used for detecting hydrogen. More...
 
class  MQ9
 MQ-9 gas sensor, typically used for detecting LPG, carbon monoxide, and methane. More...
 
class  PCF8591
 PCF8591 analog-to-digital converter chip (I2C), used to read analog sensors on the Raspberry Pi. More...
 
class  Photoresistor
 Photoresistor (LDR) - reads ambient light as an analog value through an ADC channel. More...
 
class  PiCamera
 Raspberry Pi camera, recording video (raw .h264 converted to .mp4 on a background thread) and taking pictures. More...
 
class  PMS5003
 PMS5003 particulate-matter (dust) sensor read over serial, reporting PM1.0/PM2.5/PM10 concentrations, particle counts by diameter, rolling averages, and an air-quality evaluation. More...
 
class  PTQS1005
 PTQS1005 air-quality sensor read over serial, reporting PM2.5, TVOC, HCHO, CO2, internal temperature, and humidity, each with a rolling average. More...
 
class  QSFS01
 QS-FS01 anemometer wind-speed sensor, read as an analog voltage through an ADC channel. More...
 
class  RainSensor
 Rain sensor - reads surface wetness as an analog value through an ADC channel. More...
 
class  Receiver
 Implements TCP client/server socket communication, running its accept, send, and receive loops on their own threads and invoking a callback for each message received. More...
 
class  Relay
 A relay driven by a single GPIO pin (output-only, like an LED). More...
 
class  RemoteCommand
 A command a remote client can send, paired with the handler that carries it out. More...
 
class  RGBLED
 An RGB LED driven by three PWM pins (red, green, blue). More...
 
class  RollingAverage
 Maintains a rolling (moving) average over a fixed-length window of recent readings using a circular buffer. More...
 
class  RotaryEncoder
 A standard rotary encoder. More...
 
class  RumPiConfig
 Holds the library's runtime configuration, loaded from a JSON file. More...
 
class  SelectedSensorReadings
 A point-in-time copy of the SELECTED sensor readings the Home dashboard surfaces - a deliberately curated subset, not a generic per-sensor reading. More...
 
class  SoundSensor
 FC-04 sound sensor - reads sound level as an analog value through a PCF8591 ADC channel. More...
 
class  SystemHealthComponent
 Reads Raspberry Pi system health (temperature, voltage, throttling, memory, storage, WiFi, and IP) by running vcgencmd and other OS commands, and reports threshold crossings to the AlertManager. More...
 
class  SystemMemoryInformation
 Data class that contains information about the system's memory and swap space, in Kilobytes. More...
 
class  TSL2591
 TSL2591 high-dynamic-range digital light sensor (I2C), reading full-spectrum and IR channels to compute lux. More...
 
class  Vehicle
 A vehicle composed of several Motors, providing drive and steering by coordinating the motors it owns. More...
 

Enumerations

enum  EAlertLevel { OK , Warning , Alert }
 Severity of a metric relative to its thresholds. More...
 
enum class  EComponentType {
  E_Unknown , E_BMP180 , E_BMP280 , E_DHT11 ,
  E_DualLED , E_HCSR501 , E_LCD1602 , E_LED ,
  E_MCP3008 , E_Motor , E_MQ2 , E_MQ3 ,
  E_MQ4 , E_MQ5 , E_MQ6 , E_MQ7 ,
  E_MQ8 , E_MQ9 , E_MQ135 , E_PCF8591 ,
  E_Photoresistor , E_PiCamera , E_PMS5003 , E_PTQS1005 ,
  E_QSFS01 , E_RainSensor , E_Receiver , E_Relay ,
  E_RGBLED , E_RotaryEncoder , E_SoundSensor , E_SystemHealthComponent ,
  E_TSL2591 , E_Vehicle
}
 Identifies each kind of component the library supports. More...
 
enum  MotorAlignment { Left , Right , Center , None }
 Helps determine direction to rotate a motor if/when turning a Vehicle. More...
 
enum class  E_TSL2591_IntegrationTime {
  ATIME_100MS = 0x00 , ATIME_200MS = 0x01 , ATIME_300MS = 0x02 , ATIME_400MS = 0x03 ,
  ATIME_500MS = 0x04 , ATIME_600MS = 0x05
}
 This represents how long the sensor looks at the light in a reading. More...
 
enum class  E_TSL2591_AmplificationGain { GAIN_LOW = 0x00 , GAIN_MED = 0x10 , GAIN_HIGH = 0x20 , GAIN_MAX = 0x30 }
 This represents the amplification level, helpful for low/high light situations. More...
 
enum  EGasType {
  E_Acetone , E_Alcohol , E_Ammonium , E_Benzene ,
  E_Benzine , E_Butane , E_CarbonDioxide , E_CarbonMonoxide ,
  E_CNG , E_Hexane , E_Hydrogen , E_LPG ,
  E_Methane , E_NaturalGas , E_Propane , E_Smoke ,
  E_Toluene
}
 The types of gas the MQ sensor family can detect. More...
 
enum class  E_LightLevel {
  LIGHT_DARK = 0 , LIGHT_VERY_DIM = 1 , LIGHT_DIM = 2 , LIGHT_NORMAL = 3 ,
  LIGHT_BRIGHT = 4 , LIGHT_VERY_BRIGHT = 5
}
 How much light the sensor is seeing, darkest to brightest. More...
 
enum class  E_AirQualityLevel {
  AIR_QUALITY_GOOD = 0 , AIR_QUALITY_SATISFACTORY = 1 , AIR_QUALITY_MODERATELY_POLLUTED = 2 , AIR_QUALITY_POOR = 3 ,
  AIR_QUALITY_VERY_POOR = 4 , AIR_QUALITY_SEVERE = 5
}
 How bad the air is, best to worst, taking whichever of PM2.5 / PM10 is worse. More...
 

Functions

void Initialize ()
 Brings the library up: initializes the logger, loads and validates the configuration, hooks Ctrl+C, sets up WiringPi, creates the component manager, self-assembles the sensors from the manifest, and (if enabled) starts the remote receiver. More...
 
void Start (bool runAndUpdateOnSeparateThread)
 Turns on every managed component. More...
 
void Stop ()
 Cleanly shuts down after a pull-based Start(false): wakes anything waiting, then tears down (turns components off, frees the component manager, drains and closes the logger). More...
 
void AddComponent (BaseComponent *theComponent)
 Adds the provided component to the manager so it is polled and reported alongside the rest. More...
 
int GetNumberOfComponents ()
 Gets how many components the manager currently holds. More...
 
void UpdateComponents ()
 Polls every managed component once, refreshing the values that GetRawJsonDataFromComponentManager() reports. More...
 
void UpdateComponentsOfType (const EComponentType typeOfComponentToUpdate)
 Polls just the components of one type, letting a pull-based consumer sample a fast sensor (e.g. More...
 
std::string GetRawJsonDataFromComponentManager ()
 Gets every managed component's current readings as a JSON string, keyed by each component's unique name. More...
 
bool GetComponentTypes (std::vector< EComponentType > &outComponentTypes)
 Fills the provided vector with the distinct component types the manager currently holds. More...
 
std::string GetLogFilePath ()
 Gets the path of the library's log file, so a client can reveal or open it without hardcoding the path. More...
 
SelectedSensorReadings GetSelectedSensorReadings ()
 Gets the curated set of current sensor readings for the Home dashboard, assembled by the ComponentManager. More...
 
static int ParseI2CAddress (const nlohmann::json &entry)
 Parses an I2C address from a manifest entry, accepting either a hex string ("0x48") or a plain number (72). More...
 
static BaseComponentCreatePCF8591Component (ComponentCreationContext &context)
 Builds a PCF8591 ADC from its manifest entry ("i2cAddress", "basePin", optional "adcVoltage") and registers it in the context so later analog components can read through it. More...
 
static BaseComponentCreatePMS5003Component (ComponentCreationContext &context)
 Builds a PMS5003 particulate sensor from its manifest entry ("devicePath"). More...
 
static BaseComponentCreatePTQS1005Component (ComponentCreationContext &context)
 Builds a PTQS1005 air-quality sensor (humidity, TVOC, formaldehyde, CO2) from its manifest entry ("devicePath"). More...
 
static BaseComponentCreateHCSR501Component (ComponentCreationContext &context)
 Builds an HCSR501 motion sensor from its manifest entry ("pin"). More...
 
static BaseComponentCreateDHT11Component (ComponentCreationContext &context)
 Builds a DHT11 temperature/humidity sensor from its manifest entry ("pin", optional "isUsingPi5OrAbove" and "maxTimings"). More...
 
static BaseComponentCreateQSFS01Component (ComponentCreationContext &context)
 Builds a QSFS01 wind sensor from its manifest entry. More...
 
static BaseComponentCreateTSL2591Component (ComponentCreationContext &context)
 Builds a TSL2591 light sensor. More...
 
static BaseComponentCreateSystemHealthComponent (ComponentCreationContext &context)
 Builds a SystemHealthComponent (CPU, memory, etc.). More...
 
template<typename TGasSensor >
static BaseComponentCreateGasSensorComponent (ComponentCreationContext &context)
 Builds any MQ-family gas sensor (they share constructors, so one template covers them all). More...
 
template<typename TSinglePinComponent >
static BaseComponentCreateSinglePinComponent (ComponentCreationContext &context)
 Builds any component driven by a single GPIO pin (e.g. More...
 
static BaseComponentCreateDualLEDComponent (ComponentCreationContext &context)
 Builds a DualLED from its manifest entry ("firstColorPin", "secondColorPin"). More...
 
static BaseComponentCreateRGBLEDComponent (ComponentCreationContext &context)
 Builds an RGBLED from its manifest entry ("redPin", "greenPin", "bluePin"). More...
 
template<typename TAnalogComponent >
static BaseComponentCreateAdcAnalogComponent (ComponentCreationContext &context)
 Builds any analog sensor that reads through an ADC created earlier in the manifest ("adc" + "adcChannel"), like the photoresistor or rain sensor. More...
 
static BaseComponentCreateBMP280Component (ComponentCreationContext &context)
 Builds a BMP280 pressure/temperature sensor from its manifest entry ("i2cAddress"). More...
 
static BaseComponentCreateBMP180Component (ComponentCreationContext &context)
 Builds a BMP180 pressure/temperature sensor from its manifest entry ("i2cAddress", optional "i2cDevicePath"). More...
 
static BaseComponentCreateSoundSensorComponent (ComponentCreationContext &context)
 Builds a SoundSensor from its manifest entry ("i2cAddress", "pcfBasePin"). More...
 
static BaseComponentCreateMCP3008Component (ComponentCreationContext &context)
 Builds an MCP3008 ADC from its manifest entry ("basePin", "spiChannel", optional "adcVoltage") and registers it in the context so later analog components can read through it. More...
 
static BaseComponentCreateRotaryEncoderComponent (ComponentCreationContext &context)
 Builds a RotaryEncoder from its manifest entry ("clkPin", "dtPin", "swPin"). More...
 
static BaseComponentCreateLCD1602Component (ComponentCreationContext &context)
 Builds an LCD1602 display from its manifest entry ("i2cAddress"). More...
 
static BaseComponentCreateMotorComponent (ComponentCreationContext &context)
 Builds a Motor from its manifest entry ("driveOnePin", "driveTwoPin"). More...
 
static BaseComponentCreateVehicleComponent (ComponentCreationContext &context)
 Builds a Vehicle from its manifest entry ("numberOfMotors"). More...
 
static BaseComponentCreatePiCameraComponent (ComponentCreationContext &context)
 Builds a PiCamera. More...
 
static BaseComponentCreateComponent (const std::string &type, const nlohmann::json &entry, std::map< std::string, IAnalogDigitalConverterComponent * > &adcsByType, const RumPiConfig &config)
 Builds a single component from one manifest entry by matching its "type" to the right CreateX function. More...
 
static std::vector< RemoteCommandBuildRemoteCommands ()
 Builds the list of commands a remote client can send. More...
 
static void ThreadWait (unsigned int milliseconds)
 Sleeps for the requested time, but wakes immediately if the library has been asked to shut down. More...
 
static void WriteToConsole (const char *str)
 Writes a line to the console under a lock, so messages from different threads do not interleave. More...
 
static void Shutdown (int signalNum)
 SIGINT handler: flips the run flag and wakes the poll loop so it exits promptly. More...
 
static void Teardown ()
 Turns components off, frees the component manager (which owns the receiver), and drains and closes the logger. More...
 
static bool IsReceiverReady ()
 Reports whether the remote receiver exists and currently has a client connected. More...
 
static void StartComponentManagerUpdateLoop ()
 The Start(true) worker loop: repeatedly polls all components, pushes the fresh data to the receiver when a client is connected, then waits the configured delay - until Shutdown()/Stop() flips the run flag. More...
 
static void OnMessageReceived (const char *receivedMessage)
 Receiver callback: routes an incoming client message to the first command that matches, then runs that command's handler. More...
 
static nlohmann::json LoadConfigJson (const char *path)
 Reads and parses the config file once. More...
 
static void HandleMoveForward (const char *receivedMessage)
 Command handler for the "MoveForward" message from a remote client (placeholder - drives the robot forward). More...
 

Variables

constexpr unsigned int PIN_GPIO_5 = 5
 BCM GPIO pin 5. More...
 
constexpr unsigned int PIN_GPIO_6 = 6
 BCM GPIO pin 6. More...
 
constexpr unsigned int PIN_GPIO_12 = 12
 BCM GPIO pin 12. More...
 
constexpr unsigned int PIN_GPIO_13 = 13
 BCM GPIO pin 13. More...
 
constexpr unsigned int PIN_GPIO_14 = 14
 BCM GPIO pin 14. More...
 
constexpr unsigned int PIN_GPIO_15 = 15
 BCM GPIO pin 15. More...
 
constexpr unsigned int PIN_GPIO_16 = 16
 BCM GPIO pin 16. More...
 
constexpr unsigned int PIN_GPIO_17 = 17
 BCM GPIO pin 17. More...
 
constexpr unsigned int PIN_GPIO_18 = 18
 BCM GPIO pin 18. More...
 
constexpr unsigned int PIN_GPIO_19 = 19
 BCM GPIO pin 19. More...
 
constexpr unsigned int PIN_GPIO_20 = 20
 BCM GPIO pin 20. More...
 
constexpr unsigned int PIN_GPIO_21 = 21
 BCM GPIO pin 21. More...
 
constexpr unsigned int PIN_GPIO_22 = 22
 BCM GPIO pin 22. More...
 
constexpr unsigned int PIN_GPIO_23 = 23
 BCM GPIO pin 23. More...
 
constexpr unsigned int PIN_GPIO_24 = 24
 BCM GPIO pin 24. More...
 
constexpr unsigned int PIN_GPIO_25 = 25
 BCM GPIO pin 25. More...
 
constexpr unsigned int PIN_GPIO_26 = 26
 BCM GPIO pin 26. More...
 
constexpr unsigned int PIN_GPIO_27 = 27
 BCM GPIO pin 27. More...
 
constexpr unsigned int RUMPI_SINGLE_COMPONENT_BUFFER_SIZE = 2 << 9
 Buffer size for a single component's serial reads. More...
 
constexpr unsigned int RUMPI_MAX_BUFFER_SIZE = 2 << 15
 Maximum overall buffer size. More...
 
constexpr unsigned int RUMPI_MAX_PCF8591_PINS = 4
 Number of ADC channels on a PCF8591. More...
 
constexpr unsigned int RUMPI_MAX_READ_ATTEMPTS = 2 << 15
 Maximum serial-read retry attempts before giving up. More...
 
constexpr unsigned int RUMPI_MAX_NUM_SAMPLES = 5
 Default rolling-average window length. More...
 
constexpr size_t RUMPI_MAX_LOG_FILES_TO_KEEP = 20
 
constexpr float THRESHOLD_SYSTEMTEMPERATURE_WARNING_CELSIUS = 70.0f
 System temperature warning threshold, in Celsius. More...
 
constexpr float THRESHOLD_SYSTEMTEMPERATURE_ALERT_CELSIUS = 80.0f
 System temperature alert threshold, in Celsius (Pi soft-throttles here). More...
 
constexpr bool THRESHOLD_SYSTEMTEMPERATURE_HIGHER_IS_WORSE = true
 High system temperature is worse. More...
 
constexpr float THRESHOLD_EXTERNALFIVEVOLT_WARNING_LOW_VOLTS = 4.9f
 5V rail low-side warning threshold, in volts. More...
 
constexpr float THRESHOLD_EXTERNALFIVEVOLT_ALERT_LOW_VOLTS = 4.8f
 5V rail low-side alert threshold, in volts. More...
 
constexpr float THRESHOLD_EXTERNALFIVEVOLT_WARNING_HIGH_VOLTS = 5.27f
 5V rail high-side warning threshold, in volts. More...
 
constexpr float THRESHOLD_EXTERNALFIVEVOLT_ALERT_HIGH_VOLTS = 5.31f
 5V rail high-side alert threshold, in volts. More...
 
constexpr float THRESHOLD_DISKUSAGE_WARNING_PERCENT = 80.0f
 Disk usage warning threshold, as a percent. More...
 
constexpr float THRESHOLD_DISKUSAGE_ALERT_PERCENT = 90.0f
 Disk usage alert threshold, as a percent. More...
 
constexpr bool THRESHOLD_DISKUSAGE_HIGHER_IS_WORSE = true
 High disk usage is worse. More...
 
constexpr float THRESHOLD_MEMORY_WARNING_AVAILABLE_PERCENT = 15.0f
 Available-memory warning threshold, as a percent. More...
 
constexpr float THRESHOLD_MEMORY_ALERT_AVAILABLE_PERCENT = 8.0f
 Available-memory alert threshold, as a percent (low available is bad). More...
 
constexpr float THRESHOLD_MEMORY_WARNING_SWAP_PERCENT = 20.0f
 Swap-usage warning threshold, as a percent. More...
 
constexpr float THRESHOLD_MEMORY_ALERT_SWAP_PERCENT = 50.0f
 Swap-usage alert threshold, as a percent (high swap is bad). More...
 
constexpr float THRESHOLD_WIFISIGNAL_WARNING_DBM = -70.0f
 WiFi signal warning threshold, in dBm. More...
 
constexpr float THRESHOLD_WIFISIGNAL_ALERT_DBM = -75.0f
 WiFi signal alert threshold, in dBm. More...
 
constexpr bool THRESHOLD_WIFISIGNAL_HIGHER_IS_WORSE = false
 Low WiFi signal is worse (closer to 0 is stronger). More...
 
constexpr int BMP180_PRE_OSS0 = 0
 
constexpr int BMP180_PRE_OSS1 = 1
 
constexpr int BMP180_PRE_OSS2 = 2
 
constexpr int BMP180_PRE_OSS3 = 3
 
constexpr int BMP180_PRE_OSS0_CMD = 0x34
 
constexpr int BMP180_PRE_OSS1_CMD = 0x74
 
constexpr int BMP180_PRE_OSS2_CMD = 0xB4
 
constexpr int BMP180_PRE_OSS3_CMD = 0xF4
 
constexpr int BMP180_PRE_OSS0_WAIT_US = 5000
 
constexpr int BMP180_PRE_OSS1_WAIT_US = 8000
 
constexpr int BMP180_PRE_OSS2_WAIT_US = 14000
 
constexpr int BMP180_PRE_OSS3_WAIT_US = 26000
 
constexpr int BMP180_REG_AC1_H = 0xAA
 
constexpr int BMP180_REG_AC2_H = 0xAC
 
constexpr int BMP180_REG_AC3_H = 0xAE
 
constexpr int BMP180_REG_AC4_H = 0xB0
 
constexpr int BMP180_REG_AC5_H = 0xB2
 
constexpr int BMP180_REG_AC6_H = 0xB4
 
constexpr int BMP180_REG_B1_H = 0xB6
 
constexpr int BMP180_REG_B2_H = 0xB8
 
constexpr int BMP180_REG_MB_H = 0xBA
 
constexpr int BMP180_REG_MC_H = 0xBC
 
constexpr int BMP180_REG_MD_H = 0xBE
 
constexpr int BMP180_CTRL = 0xF4
 
constexpr int BMP180_REG_TMP = 0xF6
 
constexpr int BMP180_REG_PRE = 0xF6
 
constexpr int BMP180_TMP_READ_CMD = 0x2E
 
constexpr int BMP180_TMP_READ_WAIT_US = 5000
 
constexpr double BMP180_SEA_LEVEL = 1013.25
 
static const int32_t BMP180RegisterTable [11][2]
 
constexpr double BMP280_SEA_LEVEL = 1013.25
 
constexpr int POWER_MODE = 3
 
constexpr int OSRS_T = 5
 
constexpr int OSRS_P = 5
 
constexpr int FILTER = 4
 
constexpr int T_SB = 4
 
constexpr int BMP280_REGISTER_DIG_T1 = 0x88
 
constexpr int BMP280_REGISTER_DIG_T2 = 0x8A
 
constexpr int BMP280_REGISTER_DIG_T3 = 0x8C
 
constexpr int BMP280_REGISTER_DIG_P1 = 0x8E
 
constexpr int BMP280_REGISTER_DIG_P2 = 0x90
 
constexpr int BMP280_REGISTER_DIG_P3 = 0x92
 
constexpr int BMP280_REGISTER_DIG_P4 = 0x94
 
constexpr int BMP280_REGISTER_DIG_P5 = 0x96
 
constexpr int BMP280_REGISTER_DIG_P6 = 0x98
 
constexpr int BMP280_REGISTER_DIG_P7 = 0x9A
 
constexpr int BMP280_REGISTER_DIG_P8 = 0x9C
 
constexpr int BMP280_REGISTER_DIG_P9 = 0x9E
 
constexpr int BMP280_REGISTER_CHIPID = 0xD0
 
constexpr int BMP280_REGISTER_VERSION = 0xD1
 
constexpr int BMP280_REGISTER_SOFTRESET = 0xE0
 
constexpr int BMP280_REGISTER_CONTROL = 0xF4
 
constexpr int BMP280_REGISTER_CONFIG = 0xF5
 
constexpr int BMP280_REGISTER_STATUS = 0xF3
 
constexpr int BMP280_REGISTER_TEMPDATA_MSB = 0xFA
 
constexpr int BMP280_REGISTER_TEMPDATA_LSB = 0xFB
 
constexpr int BMP280_REGISTER_TEMPDATA_XLSB = 0xFC
 
constexpr int BMP280_REGISTER_PRESSDATA_MSB = 0xF7
 
constexpr int BMP280_REGISTER_PRESSDATA_LSB = 0xF8
 
constexpr int BMP280_REGISTER_PRESSDATA_XLSB = 0xF9
 
constexpr int TSL2591_ADDR = 0x29
 
constexpr int TSL2591_COMMAND_BIT = 0xA0
 
constexpr int TSL2591_ENABLE_REG = 0x00
 
constexpr int TSL2591_CONTROL_REG = 0x01
 
constexpr int TSL2591_C0DATA_L = 0x14
 
constexpr int TSL2591_C1DATA_L = 0x16
 
constexpr double TSL2591_LUX_DF = 408.0
 
constexpr double TSL2591_LUX_COEFB = 1.64
 
static const char * DEFAULT_COMPONENT_MANIFEST
 
static std::atomic< bool > myIsRunning { false }
 
static std::atomic< bool > myHasTornDown { false }
 
static ComponentManagermyComponentManager = nullptr
 
static std::thread myComponentManagerThread
 
static std::mutex myDelayLock
 
static std::mutex myOutputLock
 
static std::condition_variable myDelayCond
 
static ReceivermyReceiver = nullptr
 
static std::size_t myLoggerSubscriptionId = 0
 
static const std::vector< RemoteCommandmyRemoteCommands = BuildRemoteCommands()
 
static const char * DEFAULT_LIBRARY_CONFIG_FILE = "RumPiConfig.json"
 
static RumPiConfig myLibraryConfig
 

Detailed Description

RumPi is the library's top-level facade.

It used to be an all-static class; it is now a namespace, which is the natural fit for a stateless entry point and keeps every call site (RumPi::Start(), RumPi::Initialize(), ...) reading exactly the same. The former private state and helpers now live as file-local statics in RumPi.cpp.

Author
Eddie O'Hagan
Date
8/13/2026

Enumeration Type Documentation

◆ E_AirQualityLevel

enum class RumPi::E_AirQualityLevel
strong

How bad the air is, best to worst, taking whichever of PM2.5 / PM10 is worse.

Ordered so callers can compare against a level (e.g. colour the pill red at or above AIR_QUALITY_POOR).

Author
Eddie O'Hagan
Date
8/13/2026
Enumerator
AIR_QUALITY_GOOD 

Good.

AIR_QUALITY_SATISFACTORY 

Satisfactory.

AIR_QUALITY_MODERATELY_POLLUTED 

Moderately polluted.

AIR_QUALITY_POOR 

Poor.

AIR_QUALITY_VERY_POOR 

Very poor.

AIR_QUALITY_SEVERE 

Severe and hazardous.

◆ E_LightLevel

enum class RumPi::E_LightLevel
strong

How much light the sensor is seeing, darkest to brightest.

Ordered so callers can compare against a level (e.g. streetlights come on at or below LIGHT_VERY_DIM).

Author
Eddie O'Hagan
Date
8/13/2026
Enumerator
LIGHT_DARK 

Pitch dark.

LIGHT_VERY_DIM 

Very dim (e.g. dusk / streetlight threshold).

LIGHT_DIM 

Dim.

LIGHT_NORMAL 

Normal indoor lighting.

LIGHT_BRIGHT 

Bright.

LIGHT_VERY_BRIGHT 

Very bright (e.g. direct sunlight).

◆ E_TSL2591_AmplificationGain

This represents the amplification level, helpful for low/high light situations.

Author
Eddie O'Hagan
Date
8/13/2026
Enumerator
GAIN_LOW 
GAIN_MED 
GAIN_HIGH 
GAIN_MAX 

◆ E_TSL2591_IntegrationTime

This represents how long the sensor looks at the light in a reading.

Author
Eddie O'Hagan
Date
8/13/2026
Enumerator
ATIME_100MS 
ATIME_200MS 
ATIME_300MS 
ATIME_400MS 
ATIME_500MS 
ATIME_600MS 

◆ EAlertLevel

Severity of a metric relative to its thresholds.

Author
Eddie O'Hagan
Date
8/13/2026
Enumerator
OK 

The metric is within acceptable limits.

Warning 

The metric has crossed its warning threshold.

Alert 

The metric has crossed its alert threshold.

◆ EComponentType

enum class RumPi::EComponentType
strong

Identifies each kind of component the library supports.

Used as the key in the ComponentManager and on the wire; ComponentTypeToString / StringToComponentType convert between this and its string name.

Author
Eddie O'Hagan
Date
8/13/2026
Enumerator
E_Unknown 
E_BMP180 
E_BMP280 
E_DHT11 
E_DualLED 
E_HCSR501 
E_LCD1602 
E_LED 
E_MCP3008 
E_Motor 
E_MQ2 
E_MQ3 
E_MQ4 
E_MQ5 
E_MQ6 
E_MQ7 
E_MQ8 
E_MQ9 
E_MQ135 
E_PCF8591 
E_Photoresistor 
E_PiCamera 
E_PMS5003 
E_PTQS1005 
E_QSFS01 
E_RainSensor 
E_Receiver 
E_Relay 
E_RGBLED 
E_RotaryEncoder 
E_SoundSensor 
E_SystemHealthComponent 
E_TSL2591 
E_Vehicle 

◆ EGasType

The types of gas the MQ sensor family can detect.

Author
Eddie O'Hagan
Date
8/13/2026
Enumerator
E_Acetone 
E_Alcohol 
E_Ammonium 
E_Benzene 
E_Benzine 
E_Butane 
E_CarbonDioxide 
E_CarbonMonoxide 
E_CNG 
E_Hexane 
E_Hydrogen 
E_LPG 
E_Methane 
E_NaturalGas 
E_Propane 
E_Smoke 
E_Toluene 

◆ MotorAlignment

Helps determine direction to rotate a motor if/when turning a Vehicle.

Author
Eddie O'Hagan
Date
8/13/2026
Enumerator
Left 
Right 
Center 
None 

Function Documentation

◆ AddComponent()

void RumPi::AddComponent ( BaseComponent theComponent)

Adds the provided component to the manager so it is polled and reported alongside the rest.

Ignored if the component or the manager is null.

Author
Eddie O'Hagan
Date
8/13/2026
A very simple standard LED, driven by a single GPIO pin.
Definition: LED.h:15
void AddComponent(BaseComponent *theComponent)
Adds the provided component to the manager so it is polled and reported alongside the rest.
Definition: RumPi.cpp:226
constexpr unsigned int PIN_GPIO_12
BCM GPIO pin 12.
Definition: Common.h:38
void Initialize()
Brings the library up: initializes the logger, loads and validates the configuration,...
Definition: RumPi.cpp:66
Parameters
[in]theComponentThe component to hand over to the manager (the manager takes ownership).

◆ BuildRemoteCommands()

static std::vector< RemoteCommand > RumPi::BuildRemoteCommands ( )
static

Builds the list of commands a remote client can send.

To wire up a new command, add a handler above and a line here; OnMessageReceived then routes to it, so the dispatch never grows into an if/else chain.

Author
Eddie O'Hagan
Date
8/13/2026
static const std::vector<RemoteCommand> myRemoteCommands = BuildRemoteCommands();
static std::vector< RemoteCommand > BuildRemoteCommands()
Builds the list of commands a remote client can send.
Definition: RumPi.cpp:632
static const std::vector< RemoteCommand > myRemoteCommands
Definition: RumPi.cpp:34
Returns
The list of recognized remote commands.

◆ CreateAdcAnalogComponent()

template<typename TAnalogComponent >
static BaseComponent * RumPi::CreateAdcAnalogComponent ( ComponentCreationContext context)
static

Builds any analog sensor that reads through an ADC created earlier in the manifest ("adc" + "adcChannel"), like the photoresistor or rain sensor.

One template covers any component with a (ADC*, channelIndex) constructor.

Author
Eddie O'Hagan
Date
8/13/2026
//Manifest: { "type": "Photoresistor", "adc": "PCF8591", "adcChannel": 0 }
Template Parameters
TAnalogComponentThe concrete analog class to build (e.g. Photoresistor, RainSensor).
Parameters
[in,out]contextThe creation context (manifest entry, ADC registry, and config).
Returns
The new analog component, or nullptr if its ADC has not been created yet.

◆ CreateBMP180Component()

static BaseComponent * RumPi::CreateBMP180Component ( ComponentCreationContext context)
static

Builds a BMP180 pressure/temperature sensor from its manifest entry ("i2cAddress", optional "i2cDevicePath").

BMP180 copies the device path into its own buffer, so a local string is all this needs.

Author
Eddie O'Hagan
Date
8/13/2026
//Manifest: { "type": "BMP180", "i2cAddress": "0x77", "i2cDevicePath": "/dev/i2c-1" }
Parameters
[in,out]contextThe creation context (manifest entry, ADC registry, and config).
Returns
The new BMP180, or nullptr if the entry has no valid 'i2cAddress'.

◆ CreateBMP280Component()

static BaseComponent * RumPi::CreateBMP280Component ( ComponentCreationContext context)
static

Builds a BMP280 pressure/temperature sensor from its manifest entry ("i2cAddress").

Author
Eddie O'Hagan
Date
8/13/2026
//Manifest: { "type": "BMP280", "i2cAddress": "0x76" }
Parameters
[in,out]contextThe creation context (manifest entry, ADC registry, and config).
Returns
The new BMP280, or nullptr if the entry has no valid 'i2cAddress'.

◆ CreateComponent()

static BaseComponent * RumPi::CreateComponent ( const std::string &  type,
const nlohmann::json &  entry,
std::map< std::string, IAnalogDigitalConverterComponent * > &  adcsByType,
const RumPiConfig config 
)
static

Builds a single component from one manifest entry by matching its "type" to the right CreateX function.

ADC providers created earlier this pass live in 'adcsByType', so a consumer such as the wind sensor gets the ADC it needs. To add a new component: write its CreateX above and add one branch here.

Author
Eddie O'Hagan
Date
8/13/2026
std::map<std::string, IAnalogDigitalConverterComponent*> adcsByType;
BaseComponent* component = CreateComponent("DHT11", entry, adcsByType, config);
Abstract base class for every component (sensor, actuator, etc.) the library manages.
Definition: BaseComponent.h:60
static BaseComponent * CreateComponent(const std::string &type, const nlohmann::json &entry, std::map< std::string, IAnalogDigitalConverterComponent * > &adcsByType, const RumPiConfig &config)
Builds a single component from one manifest entry by matching its "type" to the right CreateX functio...
Definition: ComponentFactory.cpp:761
Parameters
[in]typeThe component's "type" string from the manifest entry.
[in]entryThe full manifest entry (its parameters).
[in,out]adcsByTypeADC providers created so far this pass, keyed by type name.
[in]configThe loaded library configuration.
Returns
The new component, or nullptr if the type is unknown or the entry is invalid.

◆ CreateDHT11Component()

static BaseComponent * RumPi::CreateDHT11Component ( ComponentCreationContext context)
static

Builds a DHT11 temperature/humidity sensor from its manifest entry ("pin", optional "isUsingPi5OrAbove" and "maxTimings").

Author
Eddie O'Hagan
Date
8/13/2026
//Manifest: { "type": "DHT11", "pin": 13, "isUsingPi5OrAbove": true, "maxTimings": 85 }
Parameters
[in,out]contextThe creation context (manifest entry, ADC registry, and config).
Returns
The new DHT11 sensor.

◆ CreateDualLEDComponent()

static BaseComponent * RumPi::CreateDualLEDComponent ( ComponentCreationContext context)
static

Builds a DualLED from its manifest entry ("firstColorPin", "secondColorPin").

Author
Eddie O'Hagan
Date
8/13/2026
//Manifest: { "type": "DualLED", "firstColorPin": 5, "secondColorPin": 6 }
Parameters
[in,out]contextThe creation context (manifest entry, ADC registry, and config).
Returns
The new DualLED.

◆ CreateGasSensorComponent()

template<typename TGasSensor >
static BaseComponent * RumPi::CreateGasSensorComponent ( ComponentCreationContext context)
static

Builds any MQ-family gas sensor (they share constructors, so one template covers them all).

They are analog: they read through an ADC created earlier in the manifest ("adc" + optional "adcChannel"), and may also expose a digital threshold-output pin. A "digitalPin" with no "adc" selects the digital-only constructor.

Author
Eddie O'Hagan
Date
8/13/2026
//Manifest: { "type": "MQ2", "adc": "PCF8591", "adcChannel": 0, "digitalPin": 27 }
Template Parameters
TGasSensorThe concrete gas-sensor class to build (e.g. MQ2, MQ135).
Parameters
[in,out]contextThe creation context (manifest entry, ADC registry, and config).
Returns
The new gas sensor, or nullptr if its ADC is missing and no 'digitalPin' was given.

◆ CreateHCSR501Component()

static BaseComponent * RumPi::CreateHCSR501Component ( ComponentCreationContext context)
static

Builds an HCSR501 motion sensor from its manifest entry ("pin").

Author
Eddie O'Hagan
Date
8/13/2026
//Manifest: { "type": "HCSR501", "pin": 18 }
Parameters
[in,out]contextThe creation context (manifest entry, ADC registry, and config).
Returns
The new HCSR501 motion sensor.

◆ CreateLCD1602Component()

static BaseComponent * RumPi::CreateLCD1602Component ( ComponentCreationContext context)
static

Builds an LCD1602 display from its manifest entry ("i2cAddress").

Author
Eddie O'Hagan
Date
8/13/2026
//Manifest: { "type": "LCD1602", "i2cAddress": "0x27" }
Parameters
[in,out]contextThe creation context (manifest entry, ADC registry, and config).
Returns
The new LCD1602, or nullptr if the entry has no valid 'i2cAddress'.

◆ CreateMCP3008Component()

static BaseComponent * RumPi::CreateMCP3008Component ( ComponentCreationContext context)
static

Builds an MCP3008 ADC from its manifest entry ("basePin", "spiChannel", optional "adcVoltage") and registers it in the context so later analog components can read through it.

Author
Eddie O'Hagan
Date
8/13/2026
//Manifest: { "type": "MCP3008", "basePin": 100, "spiChannel": 0, "adcVoltage": 3.3 }
Parameters
[in,out]contextThe creation context (manifest entry, ADC registry, and config).
Returns
The new MCP3008 ADC.

◆ CreateMotorComponent()

static BaseComponent * RumPi::CreateMotorComponent ( ComponentCreationContext context)
static

Builds a Motor from its manifest entry ("driveOnePin", "driveTwoPin").

An optional "enablePin" selects the constructor that also drives an enable/PWM pin.

Author
Eddie O'Hagan
Date
8/13/2026
//Manifest: { "type": "Motor", "driveOnePin": 23, "driveTwoPin": 24, "enablePin": 25 }
Parameters
[in,out]contextThe creation context (manifest entry, ADC registry, and config).
Returns
The new Motor.

◆ CreatePCF8591Component()

static BaseComponent * RumPi::CreatePCF8591Component ( ComponentCreationContext context)
static

Builds a PCF8591 ADC from its manifest entry ("i2cAddress", "basePin", optional "adcVoltage") and registers it in the context so later analog components can read through it.

The four ADC channels map to basePin+0..basePin+3, so only the single base pin is needed.

Author
Eddie O'Hagan
Date
8/13/2026
//Manifest: { "type": "PCF8591", "i2cAddress": "0x48", "basePin": 120, "adcVoltage": 5.0 }
Parameters
[in,out]contextThe creation context (manifest entry, ADC registry, and config).
Returns
The new PCF8591, or nullptr if the entry lacks a valid 'i2cAddress' or a 'basePin'.

◆ CreatePiCameraComponent()

static BaseComponent * RumPi::CreatePiCameraComponent ( ComponentCreationContext context)
static

Builds a PiCamera.

It takes no manifest parameters.

Author
Eddie O'Hagan
Date
8/13/2026
//Manifest: { "type": "PiCamera" }
Parameters
[in]contextThe creation context (unused - this component has no parameters).
Returns
The new PiCamera.

◆ CreatePMS5003Component()

static BaseComponent * RumPi::CreatePMS5003Component ( ComponentCreationContext context)
static

Builds a PMS5003 particulate sensor from its manifest entry ("devicePath").

Author
Eddie O'Hagan
Date
8/13/2026
//Manifest: { "type": "PMS5003", "devicePath": "/dev/ttyAMA0" }
Parameters
[in,out]contextThe creation context (manifest entry, ADC registry, and config).
Returns
The new PMS5003, or nullptr if the entry has no 'devicePath'.

◆ CreatePTQS1005Component()

static BaseComponent * RumPi::CreatePTQS1005Component ( ComponentCreationContext context)
static

Builds a PTQS1005 air-quality sensor (humidity, TVOC, formaldehyde, CO2) from its manifest entry ("devicePath").

Author
Eddie O'Hagan
Date
8/13/2026
//Manifest: { "type": "PTQS1005", "devicePath": "/dev/ttyUSB0" }
Parameters
[in,out]contextThe creation context (manifest entry, ADC registry, and config).
Returns
The new PTQS1005, or nullptr if the entry has no 'devicePath'.

◆ CreateQSFS01Component()

static BaseComponent * RumPi::CreateQSFS01Component ( ComponentCreationContext context)
static

Builds a QSFS01 wind sensor from its manifest entry.

It is analog, so it reads through an ADC created earlier in the manifest ("adc", optional "adcChannel"); the referenced ADC must be listed before it.

Author
Eddie O'Hagan
Date
8/13/2026
//Manifest: { "type": "QSFS01", "adc": "PCF8591", "adcChannel": 2 }
Parameters
[in,out]contextThe creation context (manifest entry, ADC registry, and config).
Returns
The new QSFS01, or nullptr if its ADC has not been created yet.

◆ CreateRGBLEDComponent()

static BaseComponent * RumPi::CreateRGBLEDComponent ( ComponentCreationContext context)
static

Builds an RGBLED from its manifest entry ("redPin", "greenPin", "bluePin").

Author
Eddie O'Hagan
Date
8/13/2026
//Manifest: { "type": "RGBLED", "redPin": 5, "greenPin": 6, "bluePin": 13 }
Parameters
[in,out]contextThe creation context (manifest entry, ADC registry, and config).
Returns
The new RGBLED.

◆ CreateRotaryEncoderComponent()

static BaseComponent * RumPi::CreateRotaryEncoderComponent ( ComponentCreationContext context)
static

Builds a RotaryEncoder from its manifest entry ("clkPin", "dtPin", "swPin").

Author
Eddie O'Hagan
Date
8/13/2026
//Manifest: { "type": "RotaryEncoder", "clkPin": 17, "dtPin": 18, "swPin": 27 }
Parameters
[in,out]contextThe creation context (manifest entry, ADC registry, and config).
Returns
The new RotaryEncoder.

◆ CreateSinglePinComponent()

template<typename TSinglePinComponent >
static BaseComponent * RumPi::CreateSinglePinComponent ( ComponentCreationContext context)
static

Builds any component driven by a single GPIO pin (e.g.

an LED or a relay), read from the manifest entry's "pin". One template covers them all.

Author
Eddie O'Hagan
Date
8/13/2026
//Manifest: { "type": "LED", "pin": 12 }
Template Parameters
TSinglePinComponentThe concrete single-pin class to build (e.g. LED, Relay).
Parameters
[in,out]contextThe creation context (manifest entry, ADC registry, and config).
Returns
The new single-pin component.

◆ CreateSoundSensorComponent()

static BaseComponent * RumPi::CreateSoundSensorComponent ( ComponentCreationContext context)
static

Builds a SoundSensor from its manifest entry ("i2cAddress", "pcfBasePin").

Author
Eddie O'Hagan
Date
8/13/2026
//Manifest: { "type": "SoundSensor", "i2cAddress": "0x48", "pcfBasePin": 120 }
Parameters
[in,out]contextThe creation context (manifest entry, ADC registry, and config).
Returns
The new SoundSensor, or nullptr if the entry has no valid 'i2cAddress'.

◆ CreateSystemHealthComponent()

static BaseComponent * RumPi::CreateSystemHealthComponent ( ComponentCreationContext context)
static

Builds a SystemHealthComponent (CPU, memory, etc.).

It takes no manifest parameters.

Author
Eddie O'Hagan
Date
8/13/2026
//Manifest: { "type": "SystemHealthComponent" }
Parameters
[in]contextThe creation context (unused - this component has no parameters).
Returns
The new SystemHealthComponent.

◆ CreateTSL2591Component()

static BaseComponent * RumPi::CreateTSL2591Component ( ComponentCreationContext context)
static

Builds a TSL2591 light sensor.

Integration time and gain use their defaults; the light-level bucket cutoffs come from the library configuration rather than the manifest entry.

Author
Eddie O'Hagan
Date
8/13/2026
//Manifest: { "type": "TSL2591" } (cutoffs come from RumPiConfig's lightLevelCutoffs)
Parameters
[in,out]contextThe creation context (manifest entry, ADC registry, and config).
Returns
The new TSL2591 light sensor.

◆ CreateVehicleComponent()

static BaseComponent * RumPi::CreateVehicleComponent ( ComponentCreationContext context)
static

Builds a Vehicle from its manifest entry ("numberOfMotors").

Minimal support for now - the per-motor pin and alignment arrays are not yet wired through the manifest (they need a richer schema), so only the motor count is read.

Author
Eddie O'Hagan
Date
8/13/2026
//Manifest: { "type": "Vehicle", "numberOfMotors": 4 }
Parameters
[in,out]contextThe creation context (manifest entry, ADC registry, and config).
Returns
The new Vehicle.

◆ GetComponentTypes()

bool RumPi::GetComponentTypes ( std::vector< EComponentType > &  outComponentTypes)

Fills the provided vector with the distinct component types the manager currently holds.

Author
Eddie O'Hagan
Date
8/13/2026
std::vector<RumPi::EComponentType> types;
if (RumPi::GetComponentTypes(types) == true)
{
//types now lists each distinct component type present.
}
bool GetComponentTypes(std::vector< EComponentType > &outComponentTypes)
Fills the provided vector with the distinct component types the manager currently holds.
Definition: RumPi.cpp:341
Parameters
[out]outComponentTypesFilled with the distinct types present.
Returns
true if at least one type was found; false otherwise (or if not initialized).

◆ GetLogFilePath()

std::string RumPi::GetLogFilePath ( )

Gets the path of the library's log file, so a client can reveal or open it without hardcoding the path.

Author
Eddie O'Hagan
Date
8/13/2026
std::string logPath = RumPi::GetLogFilePath();
std::string GetLogFilePath()
Gets the path of the library's log file, so a client can reveal or open it without hardcoding the pat...
Definition: RumPi.cpp:363
Returns
The full path to the log file.

◆ GetNumberOfComponents()

int RumPi::GetNumberOfComponents ( )

Gets how many components the manager currently holds.

Author
Eddie O'Hagan
Date
8/13/2026
printf("Managing %d components\n", count);
int GetNumberOfComponents()
Gets how many components the manager currently holds.
Definition: RumPi.cpp:247
Returns
The number of managed components (0 if the library is not initialized).

◆ GetRawJsonDataFromComponentManager()

std::string RumPi::GetRawJsonDataFromComponentManager ( )

Gets every managed component's current readings as a JSON string, keyed by each component's unique name.

Call it on the same thread that runs the update pass. Returns "{}" if the library is not initialized.

Author
Eddie O'Hagan
Date
8/13/2026
std::string GetRawJsonDataFromComponentManager()
Gets every managed component's current readings as a JSON string, keyed by each component's unique na...
Definition: RumPi.cpp:313
void UpdateComponents()
Polls every managed component once, refreshing the values that GetRawJsonDataFromComponentManager() r...
Definition: RumPi.cpp:270
Returns
A JSON string of all component readings, or "{}" if not initialized.

◆ GetSelectedSensorReadings()

SelectedSensorReadings RumPi::GetSelectedSensorReadings ( )

Gets the curated set of current sensor readings for the Home dashboard, assembled by the ComponentManager.

Call it on the same thread that runs the update pass.

Author
Eddie O'Hagan
Date
8/13/2026
A point-in-time copy of the SELECTED sensor readings the Home dashboard surfaces - a deliberately cur...
Definition: SelectedSensorReadings.h:18
SelectedSensorReadings GetSelectedSensorReadings()
Gets the curated set of current sensor readings for the Home dashboard, assembled by the ComponentMan...
Definition: RumPi.cpp:382
Returns
The curated dashboard readings (default-constructed if not initialized).

◆ HandleMoveForward()

static void RumPi::HandleMoveForward ( const char *  receivedMessage)
static

Command handler for the "MoveForward" message from a remote client (placeholder - drives the robot forward).

Author
Eddie O'Hagan
Date
8/13/2026
//Wired up in BuildRemoteCommands():
remoteCommands.push_back(RemoteCommand("MoveForward", HandleMoveForward));
A command a remote client can send, paired with the handler that carries it out.
Definition: RemoteCommand.h:15
static void HandleMoveForward(const char *receivedMessage)
Command handler for the "MoveForward" message from a remote client (placeholder - drives the robot fo...
Definition: RumPi.cpp:613
Parameters
[in]receivedMessageThe full message received from the client (unused for now).

◆ Initialize()

void RumPi::Initialize ( )

Brings the library up: initializes the logger, loads and validates the configuration, hooks Ctrl+C, sets up WiringPi, creates the component manager, self-assembles the sensors from the manifest, and (if enabled) starts the remote receiver.

A second call while already up is ignored - call Stop() first to re-initialize.

Author
Eddie O'Hagan
Date
8/13/2026
void Start(bool runAndUpdateOnSeparateThread)
Turns on every managed component.
Definition: RumPi.cpp:141

◆ IsReceiverReady()

static bool RumPi::IsReceiverReady ( )
static

Reports whether the remote receiver exists and currently has a client connected.

Author
Eddie O'Hagan
Date
8/13/2026
if (IsReceiverReady() == true)
{
}
virtual std::string ToString() const override
Serializes every managed component to a JSON string, keyed by each component's unique name.
Definition: ComponentManager.cpp:111
void SendMessage(std::string message)
Queues a message to send (rejecting it if one is already pending) and wakes the send thread.
Definition: Receiver.cpp:242
static Receiver * myReceiver
Definition: RumPi.cpp:32
static ComponentManager * myComponentManager
Definition: RumPi.cpp:27
static bool IsReceiverReady()
Reports whether the remote receiver exists and currently has a client connected.
Definition: RumPi.cpp:559
Returns
true if the receiver is present and connected; false otherwise.

◆ LoadConfigJson()

static nlohmann::json RumPi::LoadConfigJson ( const char *  path)
static

Reads and parses the config file once.

Anything that goes wrong (missing file, bad JSON) is logged and returned as an empty object, so the config keeps its defaults and the factory falls back to its embedded manifest.

Author
Eddie O'Hagan
Date
8/13/2026
nlohmann::json configJson = LoadConfigJson("RumPiConfig.json");
bool LoadFromJson(const nlohmann::json &configJson)
Loads settings from an already-parsed config JSON over the current values, so any key missing from th...
Definition: RumPiConfig.cpp:71
static nlohmann::json LoadConfigJson(const char *path)
Reads and parses the config file once.
Definition: RumPi.cpp:409
static RumPiConfig myLibraryConfig
Definition: RumPi.cpp:40
Parameters
[in]pathThe path of the config file to read.
Returns
The parsed JSON object, or an empty object if the file was missing or unparseable.

◆ OnMessageReceived()

static void RumPi::OnMessageReceived ( const char *  receivedMessage)
static

Receiver callback: routes an incoming client message to the first command that matches, then runs that command's handler.

A null or unrecognized message matches nothing and is ignored.

Author
Eddie O'Hagan
Date
8/13/2026
//Registered with the receiver in Initialize():
Implements TCP client/server socket communication, running its accept, send, and receive loops on the...
Definition: Receiver.h:27
unsigned int GetReceiverPort() const
Gets the TCP port the receiver listens on.
Definition: RumPiConfig.cpp:195
static void OnMessageReceived(const char *receivedMessage)
Receiver callback: routes an incoming client message to the first command that matches,...
Definition: RumPi.cpp:653
Parameters
[in]receivedMessageThe full message received from the client.

◆ ParseI2CAddress()

static int RumPi::ParseI2CAddress ( const nlohmann::json &  entry)
static

Parses an I2C address from a manifest entry, accepting either a hex string ("0x48") or a plain number (72).

Author
Eddie O'Hagan
Date
8/13/2026
//Manifest: { "type": "BMP280", "i2cAddress": "0x76" }
int address = ParseI2CAddress(context.GetEntry());
static int ParseI2CAddress(const nlohmann::json &entry)
Parses an I2C address from a manifest entry, accepting either a hex string ("0x48") or a plain number...
Definition: ComponentFactory.cpp:80
Parameters
[in]entryThe manifest entry to read the "i2cAddress" field from.
Returns
The parsed I2C address, or -1 if the field is absent or malformed.

◆ Shutdown()

static void RumPi::Shutdown ( int  signalNum)
static

SIGINT handler: flips the run flag and wakes the poll loop so it exits promptly.

Kept minimal because it runs in async-signal context - the actual teardown is deferred to Start() (a normal thread) after the worker joins.

Author
Eddie O'Hagan
Date
8/13/2026
//Registered during Initialize() so Ctrl+C stops the library cleanly:
signal(SIGINT, Shutdown);
static void Shutdown(int signalNum=-1)
SIGINT handler: flips the run flag and wakes the poll loop so it exits promptly.
Definition: RumPi.cpp:491
Parameters
[in]signalNumThe signal number delivered (unused; present to match the signal-handler signature).

◆ Start()

void RumPi::Start ( bool  runAndUpdateOnSeparateThread)

Turns on every managed component.

When runAndUpdateOnSeparateThread is true, also spins up the internal poll loop on its own thread and blocks here until Shutdown()/Stop() is requested, then tears down. When false, the caller drives UpdateComponents() itself and later calls Stop() to shut down.

Author
Eddie O'Hagan
Date
8/13/2026
RumPi::Start(true); //blocks and self-manages; use Start(false) to drive the loop yourself.
Parameters
[in]runAndUpdateOnSeparateThreadtrue to run the poll loop on its own thread (blocking); false to let the caller drive the updates.

◆ StartComponentManagerUpdateLoop()

static void RumPi::StartComponentManagerUpdateLoop ( )
static

The Start(true) worker loop: repeatedly polls all components, pushes the fresh data to the receiver when a client is connected, then waits the configured delay - until Shutdown()/Stop() flips the run flag.

Author
Eddie O'Hagan
Date
8/13/2026
//Launched on its own thread by Start(true):
static void StartComponentManagerUpdateLoop()
The Start(true) worker loop: repeatedly polls all components, pushes the fresh data to the receiver w...
Definition: RumPi.cpp:581
static std::thread myComponentManagerThread
Definition: RumPi.cpp:28

◆ Stop()

void RumPi::Stop ( )

Cleanly shuts down after a pull-based Start(false): wakes anything waiting, then tears down (turns components off, frees the component manager, drains and closes the logger).

Under Start(true) the worker thread owns teardown, so this only tears down when there is no worker thread to do it. Safe to call more than once.

Author
Eddie O'Hagan
Date
8/13/2026
RumPi::Start(false);
//...drive UpdateComponents() in your own loop...
void Stop()
Cleanly shuts down after a pull-based Start(false): wakes anything waiting, then tears down (turns co...
Definition: RumPi.cpp:190

◆ Teardown()

static void RumPi::Teardown ( )
static

Turns components off, frees the component manager (which owns the receiver), and drains and closes the logger.

Single-shot: whichever of the Start(true) worker or a Stop() call runs first does the work; any later caller returns immediately.

Author
Eddie O'Hagan
Date
8/13/2026
//Called for you once the worker thread joins, or from Stop() on the pull-based path.
static void Teardown()
Turns components off, frees the component manager (which owns the receiver), and drains and closes th...
Definition: RumPi.cpp:515

◆ ThreadWait()

static void RumPi::ThreadWait ( unsigned int  milliseconds)
static

Sleeps for the requested time, but wakes immediately if the library has been asked to shut down.

Author
Eddie O'Hagan
Date
8/13/2026
//Called by the update loop between polls:
unsigned int GetUpdateDelayMilliseconds() const
Gets the update-loop delay between sensor polls, in milliseconds.
Definition: RumPiConfig.cpp:156
static void ThreadWait(unsigned int milliseconds)
Sleeps for the requested time, but wakes immediately if the library has been asked to shut down.
Definition: RumPi.cpp:448
Parameters
[in]millisecondsHow long to wait, in milliseconds.

◆ UpdateComponents()

void RumPi::UpdateComponents ( )

Polls every managed component once, refreshing the values that GetRawJsonDataFromComponentManager() reports.

Start(true) calls this on its own thread; a pull-based Start(false) consumer must call it itself before reading data, otherwise the components are only turned on and never actually read.

Author
Eddie O'Hagan
Date
8/13/2026

◆ UpdateComponentsOfType()

void RumPi::UpdateComponentsOfType ( const EComponentType  typeOfComponentToUpdate)

Polls just the components of one type, letting a pull-based consumer sample a fast sensor (e.g.

wind) on a tighter cadence than the full UpdateComponents() pass so brief events land between snapshots.

Author
Eddie O'Hagan
Date
8/13/2026
void UpdateComponentsOfType(const EComponentType typeOfComponentToUpdate)
Polls just the components of one type, letting a pull-based consumer sample a fast sensor (e....
Definition: RumPi.cpp:291
Parameters
[in]typeOfComponentToUpdateThe component type to poll.

◆ WriteToConsole()

static void RumPi::WriteToConsole ( const char *  str)
static

Writes a line to the console under a lock, so messages from different threads do not interleave.

Author
Eddie O'Hagan
Date
8/13/2026
WriteToConsole("Shutting Down...");
static void WriteToConsole(const char *str)
Writes a line to the console under a lock, so messages from different threads do not interleave.
Definition: RumPi.cpp:471
Parameters
[in]strThe null-terminated string to print.

Variable Documentation

◆ BMP180_CTRL

constexpr int RumPi::BMP180_CTRL = 0xF4
constexpr

◆ BMP180_PRE_OSS0

constexpr int RumPi::BMP180_PRE_OSS0 = 0
constexpr

◆ BMP180_PRE_OSS0_CMD

constexpr int RumPi::BMP180_PRE_OSS0_CMD = 0x34
constexpr

◆ BMP180_PRE_OSS0_WAIT_US

constexpr int RumPi::BMP180_PRE_OSS0_WAIT_US = 5000
constexpr

◆ BMP180_PRE_OSS1

constexpr int RumPi::BMP180_PRE_OSS1 = 1
constexpr

◆ BMP180_PRE_OSS1_CMD

constexpr int RumPi::BMP180_PRE_OSS1_CMD = 0x74
constexpr

◆ BMP180_PRE_OSS1_WAIT_US

constexpr int RumPi::BMP180_PRE_OSS1_WAIT_US = 8000
constexpr

◆ BMP180_PRE_OSS2

constexpr int RumPi::BMP180_PRE_OSS2 = 2
constexpr

◆ BMP180_PRE_OSS2_CMD

constexpr int RumPi::BMP180_PRE_OSS2_CMD = 0xB4
constexpr

◆ BMP180_PRE_OSS2_WAIT_US

constexpr int RumPi::BMP180_PRE_OSS2_WAIT_US = 14000
constexpr

◆ BMP180_PRE_OSS3

constexpr int RumPi::BMP180_PRE_OSS3 = 3
constexpr

◆ BMP180_PRE_OSS3_CMD

constexpr int RumPi::BMP180_PRE_OSS3_CMD = 0xF4
constexpr

◆ BMP180_PRE_OSS3_WAIT_US

constexpr int RumPi::BMP180_PRE_OSS3_WAIT_US = 26000
constexpr

◆ BMP180_REG_AC1_H

constexpr int RumPi::BMP180_REG_AC1_H = 0xAA
constexpr

◆ BMP180_REG_AC2_H

constexpr int RumPi::BMP180_REG_AC2_H = 0xAC
constexpr

◆ BMP180_REG_AC3_H

constexpr int RumPi::BMP180_REG_AC3_H = 0xAE
constexpr

◆ BMP180_REG_AC4_H

constexpr int RumPi::BMP180_REG_AC4_H = 0xB0
constexpr

◆ BMP180_REG_AC5_H

constexpr int RumPi::BMP180_REG_AC5_H = 0xB2
constexpr

◆ BMP180_REG_AC6_H

constexpr int RumPi::BMP180_REG_AC6_H = 0xB4
constexpr

◆ BMP180_REG_B1_H

constexpr int RumPi::BMP180_REG_B1_H = 0xB6
constexpr

◆ BMP180_REG_B2_H

constexpr int RumPi::BMP180_REG_B2_H = 0xB8
constexpr

◆ BMP180_REG_MB_H

constexpr int RumPi::BMP180_REG_MB_H = 0xBA
constexpr

◆ BMP180_REG_MC_H

constexpr int RumPi::BMP180_REG_MC_H = 0xBC
constexpr

◆ BMP180_REG_MD_H

constexpr int RumPi::BMP180_REG_MD_H = 0xBE
constexpr

◆ BMP180_REG_PRE

constexpr int RumPi::BMP180_REG_PRE = 0xF6
constexpr

◆ BMP180_REG_TMP

constexpr int RumPi::BMP180_REG_TMP = 0xF6
constexpr

◆ BMP180_SEA_LEVEL

constexpr double RumPi::BMP180_SEA_LEVEL = 1013.25
constexpr

◆ BMP180_TMP_READ_CMD

constexpr int RumPi::BMP180_TMP_READ_CMD = 0x2E
constexpr

◆ BMP180_TMP_READ_WAIT_US

constexpr int RumPi::BMP180_TMP_READ_WAIT_US = 5000
constexpr

◆ BMP180RegisterTable

const int32_t RumPi::BMP180RegisterTable[11][2]
static
Initial value:
=
{
}
constexpr int BMP180_REG_MC_H
Definition: BMP180.h:60
constexpr int BMP180_REG_AC6_H
Definition: BMP180.h:48
constexpr int BMP180_REG_MD_H
Definition: BMP180.h:63
constexpr int BMP180_REG_AC2_H
Definition: BMP180.h:44
constexpr int BMP180_REG_AC5_H
Definition: BMP180.h:47
constexpr int BMP180_REG_MB_H
Definition: BMP180.h:57
constexpr int BMP180_REG_B1_H
Definition: BMP180.h:51
constexpr int BMP180_REG_AC3_H
Definition: BMP180.h:45
constexpr int BMP180_REG_B2_H
Definition: BMP180.h:54
constexpr int BMP180_REG_AC4_H
Definition: BMP180.h:46
constexpr int BMP180_REG_AC1_H
Definition: BMP180.h:43

◆ BMP280_REGISTER_CHIPID

constexpr int RumPi::BMP280_REGISTER_CHIPID = 0xD0
constexpr

◆ BMP280_REGISTER_CONFIG

constexpr int RumPi::BMP280_REGISTER_CONFIG = 0xF5
constexpr

◆ BMP280_REGISTER_CONTROL

constexpr int RumPi::BMP280_REGISTER_CONTROL = 0xF4
constexpr

◆ BMP280_REGISTER_DIG_P1

constexpr int RumPi::BMP280_REGISTER_DIG_P1 = 0x8E
constexpr

◆ BMP280_REGISTER_DIG_P2

constexpr int RumPi::BMP280_REGISTER_DIG_P2 = 0x90
constexpr

◆ BMP280_REGISTER_DIG_P3

constexpr int RumPi::BMP280_REGISTER_DIG_P3 = 0x92
constexpr

◆ BMP280_REGISTER_DIG_P4

constexpr int RumPi::BMP280_REGISTER_DIG_P4 = 0x94
constexpr

◆ BMP280_REGISTER_DIG_P5

constexpr int RumPi::BMP280_REGISTER_DIG_P5 = 0x96
constexpr

◆ BMP280_REGISTER_DIG_P6

constexpr int RumPi::BMP280_REGISTER_DIG_P6 = 0x98
constexpr

◆ BMP280_REGISTER_DIG_P7

constexpr int RumPi::BMP280_REGISTER_DIG_P7 = 0x9A
constexpr

◆ BMP280_REGISTER_DIG_P8

constexpr int RumPi::BMP280_REGISTER_DIG_P8 = 0x9C
constexpr

◆ BMP280_REGISTER_DIG_P9

constexpr int RumPi::BMP280_REGISTER_DIG_P9 = 0x9E
constexpr

◆ BMP280_REGISTER_DIG_T1

constexpr int RumPi::BMP280_REGISTER_DIG_T1 = 0x88
constexpr

◆ BMP280_REGISTER_DIG_T2

constexpr int RumPi::BMP280_REGISTER_DIG_T2 = 0x8A
constexpr

◆ BMP280_REGISTER_DIG_T3

constexpr int RumPi::BMP280_REGISTER_DIG_T3 = 0x8C
constexpr

◆ BMP280_REGISTER_PRESSDATA_LSB

constexpr int RumPi::BMP280_REGISTER_PRESSDATA_LSB = 0xF8
constexpr

◆ BMP280_REGISTER_PRESSDATA_MSB

constexpr int RumPi::BMP280_REGISTER_PRESSDATA_MSB = 0xF7
constexpr

◆ BMP280_REGISTER_PRESSDATA_XLSB

constexpr int RumPi::BMP280_REGISTER_PRESSDATA_XLSB = 0xF9
constexpr

◆ BMP280_REGISTER_SOFTRESET

constexpr int RumPi::BMP280_REGISTER_SOFTRESET = 0xE0
constexpr

◆ BMP280_REGISTER_STATUS

constexpr int RumPi::BMP280_REGISTER_STATUS = 0xF3
constexpr

◆ BMP280_REGISTER_TEMPDATA_LSB

constexpr int RumPi::BMP280_REGISTER_TEMPDATA_LSB = 0xFB
constexpr

◆ BMP280_REGISTER_TEMPDATA_MSB

constexpr int RumPi::BMP280_REGISTER_TEMPDATA_MSB = 0xFA
constexpr

◆ BMP280_REGISTER_TEMPDATA_XLSB

constexpr int RumPi::BMP280_REGISTER_TEMPDATA_XLSB = 0xFC
constexpr

◆ BMP280_REGISTER_VERSION

constexpr int RumPi::BMP280_REGISTER_VERSION = 0xD1
constexpr

◆ BMP280_SEA_LEVEL

constexpr double RumPi::BMP280_SEA_LEVEL = 1013.25
constexpr

◆ DEFAULT_COMPONENT_MANIFEST

const char* RumPi::DEFAULT_COMPONENT_MANIFEST
static
Initial value:
= R"JSON(
{
"components":
[
{ "type": "PCF8591", "i2cAddress": "0x48", "basePin": 120, "adcVoltage": 5.0 },
{ "type": "PMS5003", "devicePath": "/dev/ttyAMA0" },
{ "type": "PTQS1005", "devicePath": "/dev/ttyUSB0" },
{ "type": "HCSR501", "pin": 18 },
{ "type": "DHT11", "pin": 13, "isUsingPi5OrAbove": true, "maxTimings": 85 },
{ "type": "QSFS01", "adc": "PCF8591", "adcChannel": 2 },
{ "type": "TSL2591" },
{ "type": "SystemHealthComponent" }
]
}
)JSON"

◆ DEFAULT_LIBRARY_CONFIG_FILE

const char* RumPi::DEFAULT_LIBRARY_CONFIG_FILE = "RumPiConfig.json"
static

◆ FILTER

constexpr int RumPi::FILTER = 4
constexpr

◆ myComponentManager

ComponentManager* RumPi::myComponentManager = nullptr
static

◆ myComponentManagerThread

std::thread RumPi::myComponentManagerThread
static

◆ myDelayCond

std::condition_variable RumPi::myDelayCond
static

◆ myDelayLock

std::mutex RumPi::myDelayLock
static

◆ myHasTornDown

std::atomic<bool> RumPi::myHasTornDown { false }
static

◆ myIsRunning

std::atomic<bool> RumPi::myIsRunning { false }
static

◆ myLibraryConfig

RumPiConfig RumPi::myLibraryConfig
static

◆ myLoggerSubscriptionId

std::size_t RumPi::myLoggerSubscriptionId = 0
static

◆ myOutputLock

std::mutex RumPi::myOutputLock
static

◆ myReceiver

Receiver* RumPi::myReceiver = nullptr
static

◆ myRemoteCommands

const std::vector<RemoteCommand> RumPi::myRemoteCommands = BuildRemoteCommands()
static

◆ OSRS_P

constexpr int RumPi::OSRS_P = 5
constexpr

◆ OSRS_T

constexpr int RumPi::OSRS_T = 5
constexpr

◆ PIN_GPIO_12

constexpr unsigned int RumPi::PIN_GPIO_12 = 12
constexpr

BCM GPIO pin 12.

◆ PIN_GPIO_13

constexpr unsigned int RumPi::PIN_GPIO_13 = 13
constexpr

BCM GPIO pin 13.

◆ PIN_GPIO_14

constexpr unsigned int RumPi::PIN_GPIO_14 = 14
constexpr

BCM GPIO pin 14.

◆ PIN_GPIO_15

constexpr unsigned int RumPi::PIN_GPIO_15 = 15
constexpr

BCM GPIO pin 15.

◆ PIN_GPIO_16

constexpr unsigned int RumPi::PIN_GPIO_16 = 16
constexpr

BCM GPIO pin 16.

◆ PIN_GPIO_17

constexpr unsigned int RumPi::PIN_GPIO_17 = 17
constexpr

BCM GPIO pin 17.

◆ PIN_GPIO_18

constexpr unsigned int RumPi::PIN_GPIO_18 = 18
constexpr

BCM GPIO pin 18.

◆ PIN_GPIO_19

constexpr unsigned int RumPi::PIN_GPIO_19 = 19
constexpr

BCM GPIO pin 19.

◆ PIN_GPIO_20

constexpr unsigned int RumPi::PIN_GPIO_20 = 20
constexpr

BCM GPIO pin 20.

◆ PIN_GPIO_21

constexpr unsigned int RumPi::PIN_GPIO_21 = 21
constexpr

BCM GPIO pin 21.

◆ PIN_GPIO_22

constexpr unsigned int RumPi::PIN_GPIO_22 = 22
constexpr

BCM GPIO pin 22.

◆ PIN_GPIO_23

constexpr unsigned int RumPi::PIN_GPIO_23 = 23
constexpr

BCM GPIO pin 23.

◆ PIN_GPIO_24

constexpr unsigned int RumPi::PIN_GPIO_24 = 24
constexpr

BCM GPIO pin 24.

◆ PIN_GPIO_25

constexpr unsigned int RumPi::PIN_GPIO_25 = 25
constexpr

BCM GPIO pin 25.

◆ PIN_GPIO_26

constexpr unsigned int RumPi::PIN_GPIO_26 = 26
constexpr

BCM GPIO pin 26.

◆ PIN_GPIO_27

constexpr unsigned int RumPi::PIN_GPIO_27 = 27
constexpr

BCM GPIO pin 27.

◆ PIN_GPIO_5

constexpr unsigned int RumPi::PIN_GPIO_5 = 5
constexpr

BCM GPIO pin 5.

◆ PIN_GPIO_6

constexpr unsigned int RumPi::PIN_GPIO_6 = 6
constexpr

BCM GPIO pin 6.

◆ POWER_MODE

constexpr int RumPi::POWER_MODE = 3
constexpr

◆ RUMPI_MAX_BUFFER_SIZE

constexpr unsigned int RumPi::RUMPI_MAX_BUFFER_SIZE = 2 << 15
constexpr

Maximum overall buffer size.

◆ RUMPI_MAX_LOG_FILES_TO_KEEP

constexpr size_t RumPi::RUMPI_MAX_LOG_FILES_TO_KEEP = 20
constexpr

◆ RUMPI_MAX_NUM_SAMPLES

constexpr unsigned int RumPi::RUMPI_MAX_NUM_SAMPLES = 5
constexpr

Default rolling-average window length.

◆ RUMPI_MAX_PCF8591_PINS

constexpr unsigned int RumPi::RUMPI_MAX_PCF8591_PINS = 4
constexpr

Number of ADC channels on a PCF8591.

◆ RUMPI_MAX_READ_ATTEMPTS

constexpr unsigned int RumPi::RUMPI_MAX_READ_ATTEMPTS = 2 << 15
constexpr

Maximum serial-read retry attempts before giving up.

◆ RUMPI_SINGLE_COMPONENT_BUFFER_SIZE

constexpr unsigned int RumPi::RUMPI_SINGLE_COMPONENT_BUFFER_SIZE = 2 << 9
constexpr

Buffer size for a single component's serial reads.

◆ T_SB

constexpr int RumPi::T_SB = 4
constexpr

◆ THRESHOLD_DISKUSAGE_ALERT_PERCENT

constexpr float RumPi::THRESHOLD_DISKUSAGE_ALERT_PERCENT = 90.0f
constexpr

Disk usage alert threshold, as a percent.

◆ THRESHOLD_DISKUSAGE_HIGHER_IS_WORSE

constexpr bool RumPi::THRESHOLD_DISKUSAGE_HIGHER_IS_WORSE = true
constexpr

High disk usage is worse.

◆ THRESHOLD_DISKUSAGE_WARNING_PERCENT

constexpr float RumPi::THRESHOLD_DISKUSAGE_WARNING_PERCENT = 80.0f
constexpr

Disk usage warning threshold, as a percent.

◆ THRESHOLD_EXTERNALFIVEVOLT_ALERT_HIGH_VOLTS

constexpr float RumPi::THRESHOLD_EXTERNALFIVEVOLT_ALERT_HIGH_VOLTS = 5.31f
constexpr

5V rail high-side alert threshold, in volts.

◆ THRESHOLD_EXTERNALFIVEVOLT_ALERT_LOW_VOLTS

constexpr float RumPi::THRESHOLD_EXTERNALFIVEVOLT_ALERT_LOW_VOLTS = 4.8f
constexpr

5V rail low-side alert threshold, in volts.

◆ THRESHOLD_EXTERNALFIVEVOLT_WARNING_HIGH_VOLTS

constexpr float RumPi::THRESHOLD_EXTERNALFIVEVOLT_WARNING_HIGH_VOLTS = 5.27f
constexpr

5V rail high-side warning threshold, in volts.

◆ THRESHOLD_EXTERNALFIVEVOLT_WARNING_LOW_VOLTS

constexpr float RumPi::THRESHOLD_EXTERNALFIVEVOLT_WARNING_LOW_VOLTS = 4.9f
constexpr

5V rail low-side warning threshold, in volts.

◆ THRESHOLD_MEMORY_ALERT_AVAILABLE_PERCENT

constexpr float RumPi::THRESHOLD_MEMORY_ALERT_AVAILABLE_PERCENT = 8.0f
constexpr

Available-memory alert threshold, as a percent (low available is bad).

◆ THRESHOLD_MEMORY_ALERT_SWAP_PERCENT

constexpr float RumPi::THRESHOLD_MEMORY_ALERT_SWAP_PERCENT = 50.0f
constexpr

Swap-usage alert threshold, as a percent (high swap is bad).

◆ THRESHOLD_MEMORY_WARNING_AVAILABLE_PERCENT

constexpr float RumPi::THRESHOLD_MEMORY_WARNING_AVAILABLE_PERCENT = 15.0f
constexpr

Available-memory warning threshold, as a percent.

◆ THRESHOLD_MEMORY_WARNING_SWAP_PERCENT

constexpr float RumPi::THRESHOLD_MEMORY_WARNING_SWAP_PERCENT = 20.0f
constexpr

Swap-usage warning threshold, as a percent.

◆ THRESHOLD_SYSTEMTEMPERATURE_ALERT_CELSIUS

constexpr float RumPi::THRESHOLD_SYSTEMTEMPERATURE_ALERT_CELSIUS = 80.0f
constexpr

System temperature alert threshold, in Celsius (Pi soft-throttles here).

◆ THRESHOLD_SYSTEMTEMPERATURE_HIGHER_IS_WORSE

constexpr bool RumPi::THRESHOLD_SYSTEMTEMPERATURE_HIGHER_IS_WORSE = true
constexpr

High system temperature is worse.

◆ THRESHOLD_SYSTEMTEMPERATURE_WARNING_CELSIUS

constexpr float RumPi::THRESHOLD_SYSTEMTEMPERATURE_WARNING_CELSIUS = 70.0f
constexpr

System temperature warning threshold, in Celsius.

◆ THRESHOLD_WIFISIGNAL_ALERT_DBM

constexpr float RumPi::THRESHOLD_WIFISIGNAL_ALERT_DBM = -75.0f
constexpr

WiFi signal alert threshold, in dBm.

◆ THRESHOLD_WIFISIGNAL_HIGHER_IS_WORSE

constexpr bool RumPi::THRESHOLD_WIFISIGNAL_HIGHER_IS_WORSE = false
constexpr

Low WiFi signal is worse (closer to 0 is stronger).

◆ THRESHOLD_WIFISIGNAL_WARNING_DBM

constexpr float RumPi::THRESHOLD_WIFISIGNAL_WARNING_DBM = -70.0f
constexpr

WiFi signal warning threshold, in dBm.

◆ TSL2591_ADDR

constexpr int RumPi::TSL2591_ADDR = 0x29
constexpr

◆ TSL2591_C0DATA_L

constexpr int RumPi::TSL2591_C0DATA_L = 0x14
constexpr

◆ TSL2591_C1DATA_L

constexpr int RumPi::TSL2591_C1DATA_L = 0x16
constexpr

◆ TSL2591_COMMAND_BIT

constexpr int RumPi::TSL2591_COMMAND_BIT = 0xA0
constexpr

◆ TSL2591_CONTROL_REG

constexpr int RumPi::TSL2591_CONTROL_REG = 0x01
constexpr

◆ TSL2591_ENABLE_REG

constexpr int RumPi::TSL2591_ENABLE_REG = 0x00
constexpr

◆ TSL2591_LUX_COEFB

constexpr double RumPi::TSL2591_LUX_COEFB = 1.64
constexpr

◆ TSL2591_LUX_DF

constexpr double RumPi::TSL2591_LUX_DF = 408.0
constexpr