GNU Radio Out-of-Tree module providing: - Complete TX chain: PHYEncode → FrameGen → CSSMod - Complete RX chain: CSSDemod → FrameSync → PHYDecode - NETWORKID extraction/encoding (0-255 range) - All SF (7-12) and CR (4/5-4/8) combinations - Loopback tested with 24/24 configurations passing Key features: - Fractional SFD (2.25 downchirp) handling - Gray encode/decode with proper inverse operations - gr-lora_sdr compatible decode modes - GRC block definitions and example flowgraphs - Comprehensive documentation Discovered RYLR998 sync word mapping: sync_bin_1 = (NETWORKID >> 4) * 8 sync_bin_2 = (NETWORKID & 0x0F) * 8
99 lines
2.1 KiB
YAML
99 lines
2.1 KiB
YAML
id: rylr998_tx
|
|
label: RYLR998 Transmitter
|
|
category: '[RYLR998]'
|
|
flags: [python]
|
|
|
|
documentation: |-
|
|
Complete RYLR998 LoRa transmitter chain.
|
|
|
|
This hierarchical block combines all TX components:
|
|
Payload → PHY Encode → Frame Gen → CSS Mod → IQ Output
|
|
|
|
Accepts payload bytes and outputs complex IQ samples ready
|
|
for transmission via SDR.
|
|
|
|
Key features:
|
|
- NETWORKID encoding in sync word
|
|
- Configurable preamble length
|
|
- Hamming FEC encoding
|
|
- CRC generation
|
|
- Whitening
|
|
|
|
Typical use: Message Source → RYLR998 TX → SDR Sink
|
|
|
|
Frame structure generated:
|
|
[Preamble: N upchirps]
|
|
[Sync Word: 2 upchirps encoding NETWORKID]
|
|
[SFD: 2.25 downchirps]
|
|
[Header: explicit mode info, CR 4/8]
|
|
[Payload: encoded data at specified CR]
|
|
[CRC: 2 bytes if enabled]
|
|
|
|
templates:
|
|
imports: |-
|
|
from rylr998 import CSSMod, FrameGen, PHYEncode
|
|
import numpy as np
|
|
make: |
|
|
# RYLR998 TX Hier Block
|
|
self.phy_encode = PHYEncode(sf=${sf}, cr=${cr}, has_crc=${has_crc}, ldro=${ldro})
|
|
self.frame_gen = FrameGen(sf=${sf}, sample_rate=${sample_rate}, bw=${bw},
|
|
preamble_len=${preamble_len}, networkid=${networkid})
|
|
self.css_mod = CSSMod(sf=${sf}, sample_rate=${sample_rate}, bw=${bw})
|
|
|
|
parameters:
|
|
- id: sf
|
|
label: Spreading Factor
|
|
dtype: int
|
|
default: 9
|
|
options: [7, 8, 9, 10, 11, 12]
|
|
option_labels: ['SF7', 'SF8', 'SF9', 'SF10', 'SF11', 'SF12']
|
|
|
|
- id: sample_rate
|
|
label: Sample Rate (Hz)
|
|
dtype: real
|
|
default: 125e3
|
|
|
|
- id: bw
|
|
label: Bandwidth (Hz)
|
|
dtype: real
|
|
default: 125e3
|
|
|
|
- id: cr
|
|
label: Coding Rate
|
|
dtype: int
|
|
default: 1
|
|
options: [1, 2, 3, 4]
|
|
option_labels: ['4/5', '4/6', '4/7', '4/8']
|
|
|
|
- id: has_crc
|
|
label: CRC Enabled
|
|
dtype: bool
|
|
default: 'True'
|
|
|
|
- id: ldro
|
|
label: Low Data Rate Opt
|
|
dtype: bool
|
|
default: 'False'
|
|
|
|
- id: preamble_len
|
|
label: Preamble Length
|
|
dtype: int
|
|
default: 8
|
|
|
|
- id: networkid
|
|
label: NETWORKID
|
|
dtype: int
|
|
default: 18
|
|
|
|
inputs:
|
|
- label: payload
|
|
domain: message
|
|
dtype: byte
|
|
|
|
outputs:
|
|
- label: out
|
|
domain: stream
|
|
dtype: complex
|
|
|
|
file_format: 1
|