GPIO control is a developer/maker feature. It requires a BLE client application to send commands—there’s no on-device interface for GPIO control.
Overview
The GPIO characteristic allows you to:- Set any of 4 pins to HIGH or LOW
- Read current capabilities
- Integrate external hardware with your OSSM
Use cases
- LED indicators — Signal device state to external lighting
- Relay control — Trigger external devices on/off
- Accessory sync — Coordinate with other hardware
- Custom integrations — Build your own control systems
BLE characteristic
| Property | Value |
|---|---|
| UUID | 522b443a-4f53-534d-4000-420badbabe69 |
| Properties | READ, WRITE |
| Namespace | 0x4 (GPIO) |
The GPIO characteristic is part of the main OSSM BLE service (
522b443a-4f53-534d-0001-420badbabe69). Connect to the service first, then access this characteristic.Pin mapping
The firmware exposes 4 logical pins that map to ESP32 GPIO numbers:| Logical Pin | ESP32 GPIO | Board Location |
|---|---|---|
| 1 | GPIO 2 | Available on header |
| 2 | GPIO 15 | Available on header |
| 3 | GPIO 22 | Available on header |
| 4 | GPIO 33 | Available on header |
Command format
Writing (setting pin state)
Send a string in the format:1, 2, 3, or 4
State values:
highor1— Set pin HIGH (3.3V)lowor0— Set pin LOW (0V)
| Command | Effect |
|---|---|
1:high | Set pin 1 (GPIO 2) HIGH |
2:low | Set pin 2 (GPIO 15) LOW |
3:1 | Set pin 3 (GPIO 22) HIGH |
4:0 | Set pin 4 (GPIO 33) LOW |
Write responses
| Response | Meaning |
|---|---|
ok:1:high | Pin 1 successfully set to HIGH |
ok:2:low | Pin 2 successfully set to LOW |
error:invalid_format | Command format not recognized |
error:pin_out_of_range | Pin number not 1-4 |
Reading (capabilities)
Reading the characteristic returns a capabilities hint:Example code
Hardware integration
Basic LED indicator
Connect an LED with current-limiting resistor:Relay control
For higher-current loads, use an optoisolated relay module:Logic level conversion
If you need 5V logic output:Limitations
- No PWM support — Pins are digital HIGH/LOW only
- No input reading — GPIO is output-only via this interface
- No persistence — Pin states reset to LOW on device restart
- No interrupts — Cannot trigger based on external signals
- Current limits — ESP32 GPIO maximum ~12mA per pin, 40mA total
Troubleshooting
Pin doesn't respond
Pin doesn't respond
- Verify the BLE connection is active
- Check the command format exactly matches
<pin>:<state> - Ensure pin number is 1-4
- Verify with a multimeter that voltage changes
error:invalid_format response
error:invalid_format response
The command format wasn’t recognized. Valid formats:
1:high,1:low,1:1,1:02:high,2:low,2:1,2:0- etc.
HIGH and high both work).error:pin_out_of_range response
error:pin_out_of_range response
Pin number must be 1, 2, 3, or 4. Check your command.
Connected device doesn't work
Connected device doesn't work
- Verify voltage with a multimeter (should be 0V or ~3.3V)
- Check current requirements—ESP32 GPIO limited to ~12mA
- Ensure common ground between OSSM and your device
- Consider using a transistor or relay for higher current loads

