BQ Station G3 preset does not control active-low LNA on GPIO23 #177

Open
opened 2026-10-27 09:36:14 +01:00 by adam · 0 comments
Owner

Summary

When openHop Repeater uses the BQ Voyage Station G3 hardware preset with a Raspberry Pi connected directly through the primary SPI slot, it does not configure or control the Station G3’s external LNA control pin.

The Station G3 uses BCM GPIO23 for LNA control:

  • LOW: LNA enabled for reception
  • HIGH: LNA bypassed for transmission

The current Station G3 preset sets both enable pins to -1, so GPIO23 remains unmanaged:

"bq-station-g3": {
  "name": "BQ Voyage Station G3",
  "bus_id": 0,
  "cs_id": 0,
  "cs_pin": -1,
  "reset_pin": 16,
  "busy_pin": 24,
  "irq_pin": 22,
  "txen_pin": -1,
  "rxen_pin": -1,
  "tx_power": 19,
  "use_dio2_rf": true,
  "use_dio3_tcxo": true,
  "dio3_tcxo_voltage": 1.8
}

Hardware configuration

  • BQ Voyage Station G3
  • Raspberry Pi Zero 2 W installed in the primary Raspberry Pi slot
  • Radio connected directly through SPI
  • bq-station-g3 hardware preset selected
  • LNA P jumper removed to permit GPIO control
  • PA jumpers PL1 and PL2 removed

This concerns the Station G3’s external front-end LNA, not the SX1262 internal boosted-gain setting.

Observed behavior

With openHop Repeater running:

pinctrl get 23

returns:

23: ip    -- | lo // GPIO23 = input

GPIO23 remains an input instead of being driven by openHop. Therefore, openHop cannot guarantee that the external LNA is enabled during reception and bypassed before transmission.

Expected behavior

For the Station G3:

  • During idle/RX: configure GPIO23 as an output and drive it LOW
  • Before and during TX: drive GPIO23 HIGH to bypass the external LNA
  • After TX or a failed TX attempt: return GPIO23 LOW for reception
  • During shutdown: leave the front end in a safe bypass state, if appropriate

Likely cause

The current Station G3 preset explicitly disables rxen_pin:

https://github.com/openhop-dev/openhop_repeater/blob/13eb8b2ea8b1cdb4a07ed6e282dc99e3aa8a5a8b/radio-settings.json#L425-L441

Simply changing rxen_pin to 23 is not sufficient because the current SX1262Radio._control_tx_rx_pins() implementation assumes RXEN is active-high:

# TX
set_pin_low(rxen_pin)

# RX
set_pin_high(rxen_pin)

Source:

https://github.com/openhop-dev/openhop_core/blob/e07722ea96093752ac8b3c6772d653f8b68224bf/src/openhop_core/hardware/sx1262_wrapper.py#L1271-L1286

That behavior is inverted relative to the Station G3’s active-low LNA control.

Suggested fix

Add polarity-aware enable-pin handling while retaining active-high defaults for existing hardware. For example:

sx1262:
  rxen_pin: 23
  rxen_active_high: false

The bq-station-g3 preset would then specify:

"rxen_pin": 23,
"rxen_active_high": false

The polarity setting would need to be propagated through:

  • The Station G3 hardware preset
  • Repeater configuration parsing
  • Hardware-preset application/API handling
  • openhop_core.hardware.sx1262_wrapper.SX1262Radio
  • TX/RX transition and shutdown handling

Adding matching txen_active_high support may also be useful for symmetry and other front-end modules, with both options defaulting to true for backward compatibility.

Tests should verify that Station G3 GPIO23 is:

  1. LOW during initialization and RX
  2. HIGH before TX begins
  3. LOW again after successful or failed TX
  4. Put into a defined safe state during shutdown

Hardware documentation

Station G3 documentation:

https://wiki.bqvoy.com/en/devkits/station-g3

I can test a proposed fix on a physical Station G3 with a Raspberry Pi Zero 2 W.

## Summary When openHop Repeater uses the **BQ Voyage Station G3** hardware preset with a Raspberry Pi connected directly through the primary SPI slot, it does not configure or control the Station G3’s external LNA control pin. The Station G3 uses **BCM GPIO23** for LNA control: - **LOW:** LNA enabled for reception - **HIGH:** LNA bypassed for transmission The current Station G3 preset sets both enable pins to `-1`, so GPIO23 remains unmanaged: ```json "bq-station-g3": { "name": "BQ Voyage Station G3", "bus_id": 0, "cs_id": 0, "cs_pin": -1, "reset_pin": 16, "busy_pin": 24, "irq_pin": 22, "txen_pin": -1, "rxen_pin": -1, "tx_power": 19, "use_dio2_rf": true, "use_dio3_tcxo": true, "dio3_tcxo_voltage": 1.8 } ``` ## Hardware configuration - BQ Voyage Station G3 - Raspberry Pi Zero 2 W installed in the primary Raspberry Pi slot - Radio connected directly through SPI - `bq-station-g3` hardware preset selected - LNA P jumper removed to permit GPIO control - PA jumpers PL1 and PL2 removed This concerns the Station G3’s **external front-end LNA**, not the SX1262 internal boosted-gain setting. ## Observed behavior With openHop Repeater running: ```bash pinctrl get 23 ``` returns: ```text 23: ip -- | lo // GPIO23 = input ``` GPIO23 remains an input instead of being driven by openHop. Therefore, openHop cannot guarantee that the external LNA is enabled during reception and bypassed before transmission. ## Expected behavior For the Station G3: - During idle/RX: configure GPIO23 as an output and drive it **LOW** - Before and during TX: drive GPIO23 **HIGH** to bypass the external LNA - After TX or a failed TX attempt: return GPIO23 **LOW** for reception - During shutdown: leave the front end in a safe bypass state, if appropriate ## Likely cause The current Station G3 preset explicitly disables `rxen_pin`: https://github.com/openhop-dev/openhop_repeater/blob/13eb8b2ea8b1cdb4a07ed6e282dc99e3aa8a5a8b/radio-settings.json#L425-L441 Simply changing `rxen_pin` to `23` is not sufficient because the current `SX1262Radio._control_tx_rx_pins()` implementation assumes RXEN is active-high: ```python # TX set_pin_low(rxen_pin) # RX set_pin_high(rxen_pin) ``` Source: https://github.com/openhop-dev/openhop_core/blob/e07722ea96093752ac8b3c6772d653f8b68224bf/src/openhop_core/hardware/sx1262_wrapper.py#L1271-L1286 That behavior is inverted relative to the Station G3’s active-low LNA control. ## Suggested fix Add polarity-aware enable-pin handling while retaining active-high defaults for existing hardware. For example: ```yaml sx1262: rxen_pin: 23 rxen_active_high: false ``` The `bq-station-g3` preset would then specify: ```json "rxen_pin": 23, "rxen_active_high": false ``` The polarity setting would need to be propagated through: - The Station G3 hardware preset - Repeater configuration parsing - Hardware-preset application/API handling - `openhop_core.hardware.sx1262_wrapper.SX1262Radio` - TX/RX transition and shutdown handling Adding matching `txen_active_high` support may also be useful for symmetry and other front-end modules, with both options defaulting to `true` for backward compatibility. Tests should verify that Station G3 GPIO23 is: 1. LOW during initialization and RX 2. HIGH before TX begins 3. LOW again after successful or failed TX 4. Put into a defined safe state during shutdown ## Hardware documentation Station G3 documentation: https://wiki.bqvoy.com/en/devkits/station-g3 I can test a proposed fix on a physical Station G3 with a Raspberry Pi Zero 2 W. <!-- github-sync-id:6051932066 -->
Sign in to join this conversation.
No labels
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: adam/pyMC_Repeater#177