Skip to content

Commit 1501b0e

Browse files
committed
Ensure meshadv tx power is within legal limits and add note
1 parent b9c5010 commit 1501b0e

File tree

3 files changed

+7
-9
lines changed

3 files changed

+7
-9
lines changed

docs/docs/examples.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -153,7 +153,7 @@ pyMC_Core supports both direct SX1262 radio control and KISS TNC devices:
153153
- **Hardware**: FrequencyLabs meshadv Hat
154154
- **Platform**: Raspberry Pi (or compatible single-board computer)
155155
- **Frequency**: 868MHz (EU) or 915MHz (US)
156-
- **TX Power**: Up to 22dBm
156+
- **TX Power**: Up to 27dBm (Note: Actual tx power is [10dB higher than configured value](https://github.com/chrismyers2000/MeshAdv-Pi-Hat/issues/18))
157157
- **SPI Bus**: SPI0
158158
- **GPIO Pins**: CS=21, Reset=18, Busy=20, IRQ=16
159159

@@ -342,7 +342,7 @@ All examples use the SX1262 LoRa radio with the following default settings:
342342
#### meshadv (Frequency Labs)
343343
- **Radio Type**: SX1262 direct hardware control
344344
- **Frequency**: 869.525MHz (European standard)
345-
- **TX Power**: 22dBm
345+
- **TX Power**: 22dBm (Note: Actual tx power is [10dB higher than configured value](https://github.com/chrismyers2000/MeshAdv-Pi-Hat/issues/18))
346346
- **Spreading Factor**: 11
347347
- **Bandwidth**: 250kHz
348348
- **Coding Rate**: 4/5

examples/common.py

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -70,7 +70,7 @@
7070
"rxen_pin": 12,
7171
"use_dio3_tcxo": True,
7272
"frequency": int(910.525 * 1000000), # US: 910.525 MHz
73-
"tx_power": 22,
73+
"tx_power": 12, # real meshadv power is 10dB higher, see https://github.com/chrismyers2000/MeshAdv-Pi-Hat/issues/18
7474
"spreading_factor": 7,
7575
"bandwidth": int(62.5 * 1000),
7676
"coding_rate": 5,
@@ -94,9 +94,11 @@
9494
},
9595
}
9696

97+
9798
def get_supported_radios():
9899
return list(RADIOS.keys()) + ["kiss-tnc"]
99100

101+
100102
def create_radio(radio_type: str = "waveshare", serial_port: str = "/dev/ttyUSB0") -> LoRaRadio:
101103
"""Create a radio instance with configuration for specified hardware.
102104
@@ -143,9 +145,7 @@ def create_radio(radio_type: str = "waveshare", serial_port: str = "/dev/ttyUSB0
143145
logger.debug("Imported SX1262Radio successfully")
144146

145147
if radio_type not in RADIOS:
146-
raise ValueError(
147-
f"Unknown radio type: {radio_type}. Use f{get_supported_radios()}"
148-
)
148+
raise ValueError(f"Unknown radio type: {radio_type}. Use f{get_supported_radios()}")
149149

150150
radio_kwargs = configs[radio_type]
151151
logger.debug(f"Radio configuration for {radio_type}: {radio_kwargs}")

examples/discover_nodes.py

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -177,9 +177,7 @@ def main():
177177
if args.radio_type == "kiss-tnc":
178178
print(f"Serial port: {args.serial_port}")
179179

180-
asyncio.run(
181-
discover_nodes(args.radio_type, args.serial_port, args.timeout, args.filter)
182-
)
180+
asyncio.run(discover_nodes(args.radio_type, args.serial_port, args.timeout, args.filter))
183181

184182

185183
if __name__ == "__main__":

0 commit comments

Comments
 (0)