Both Teensy lora_config.h and ESP lora_config_esp.h define:
RELAY_MSB_BIT=0x8000— bit 15 must be 1 for a command to be treated as valid.
If this bit is clear, relay updates from LoRa or I2C (depending on firmware path) should not change outputs.
In src/tsesp/main.cpp, setRelays() maps six relays to bits 14 through 9:
- Relay 1 ↔ bit 14
- Relay 2 ↔ bit 13
- …
- Relay 6 ↔ bit 9
Bit = 1 means valve open; the GPIO is driven LOW (active-low hardware).
Source references:
OPEN_ALL_VALVES=0xFE00— binary pattern with bits 15–9 set (documentation intsespmain).- GSC ESP repeat mode toggles between
8000andfe00for testing.
Always interpret together with RELAY_MSB_BIT: e.g. 0x8000 sets validity and may encode a specific solenoid pattern depending on bits 14–9.
The Teensy records solenoid_state in each SampleFrame (SampleFrame.h) from SolenoidReceive — a 2-byte value reflecting what the I2C slave last reported / commanded. Ground software should use the same bit semantics as the ESP relay firmware when decoding logs and live RF.