# LoRa/LoRaWAN Fabric Pattern Collection

Comprehensive knowledge base of 47 Fabric-style patterns covering all aspects of LoRa and LoRaWAN technology.

## Pattern Categories

### Technology (6 patterns)
Core LoRa modulation and physical layer concepts

- **lora_basics** - Introduction to LoRa technology for beginners
- **lora_vs_lorawan** - Differences between LoRa PHY and LoRaWAN protocol
- **chirp_spread_spectrum** - CSS modulation technique fundamentals
- **modulation_parameters** - SF, BW, CR optimization
- **spreading_factor_deep_dive** - Mathematical analysis of spreading factors
- **lora_vs_lorawan** - Physical layer vs network protocol comparison

### Frequencies (3 patterns)
Regional frequency bands and regulations

- **eu868_band** - European 863-870 MHz band, ETSI compliance, duty cycle
- **us915_band** - North American 902-928 MHz, FCC Part 15.247, frequency hopping
- **as923_band** - Asia-Pacific variants (AS923-1/2/3/4), LBT requirements

### Hardware (6 patterns)
Chipsets, gateways, antennas, and development boards

- **sx1276_chipset** - Second-gen Semtech transceiver family
- **sx1262_chipset** - Third-gen Semtech transceiver, improvements over SX1276
- **gateway_types** - Concentrator chips (SX1301/02/03), backhaul options
- **antenna_selection** - Antenna types, gain, matching, placement
- **end_device_selection** - Module selection, MCU requirements, certification
- **development_boards** - Prototyping platforms and evaluation boards

### Network (10 patterns)
LoRaWAN protocol, architecture, and infrastructure

- **lorawan_architecture** - Star-of-stars topology, components, data flow
- **device_classes** - Class A/B/C operation modes and trade-offs
- **packet_structure** - Frame format, MAC commands, payload encryption
- **duty_cycle_management** - EU868 restrictions, sub-bands, compliance
- **confirmed_vs_unconfirmed** - Message types and reliability strategies
- **multicast** - Group messaging and FUOTA
- **roaming** - Inter-network connectivity and backend interfaces
- **network_server_comparison** - TTN, ChirpStack, AWS IoT Core platforms
- **firmware_updates** - FUOTA protocol and delta updates
- **roaming** - Backend roaming protocol and use cases

### Applications (7 patterns)
Real-world LoRaWAN deployment scenarios

- **smart_cities** - Urban infrastructure monitoring and control
- **agriculture** - Precision farming, irrigation, livestock tracking
- **asset_tracking** - Location tracking with RSSI/TDoA geolocation
- **utility_metering** - Water, gas, electricity AMR
- **environmental_monitoring** - Air quality, weather, pollution sensors
- **building_automation** - HVAC, occupancy, facility management
- **industrial_iot** - Manufacturing, predictive maintenance, SCADA integration

### Range (4 patterns)
RF propagation, link budget, and range estimation

- **link_budget_calculator** - TX power, path loss, sensitivity calculations
- **path_loss_models** - FSPL, Egli, Hata, COST-231 models
- **fresnel_zone** - Clearance requirements and antenna placement
- **geolocation** - RSSI and TDoA positioning without GPS

### Optimization (6 patterns)
Performance tuning and efficiency

- **adaptive_data_rate** - ADR mechanism for SF and power optimization
- **battery_life_optimization** - Power budgeting and lifetime maximization
- **payload_optimization** - Data encoding, compression, CayenneLPP
- **network_capacity** - Device density, collision probability, scalability
- **air_time_calculator** - Transmission duration and duty cycle planning
- **frequency_plan_optimization** - Channel selection and interference mitigation

### Security (3 patterns)
Encryption, authentication, and key management

- **lorawan_security** - Encryption layers, key types, OTAA vs ABP
- **frame_counter** - Replay attack prevention
- **secure_element** - Hardware key storage (ATECC608, SE050)

### Troubleshooting (4 patterns)
Common issues and diagnostic procedures

- **join_failures** - OTAA activation problems and solutions
- **packet_loss** - RF interference, weak signal, collision diagnosis
- **downlink_issues** - RX window failures and gateway scheduling
- **interference_diagnosis** - RF interference identification and mitigation

## Usage

Each pattern follows the Fabric structure:

```
# IDENTITY and PURPOSE
[Expert role and specialization]

# STEPS
[Analysis and extraction steps]

# OUTPUT INSTRUCTIONS
[Format and content guidelines]

# OUTPUT FORMAT
[Structured markdown template with examples]

# INPUT
INPUT:
```

## Pattern Selection Guide

### Getting Started
1. **lora_basics** - Start here for LoRa introduction
2. **lora_vs_lorawan** - Understand the technology stack
3. **lorawan_architecture** - Learn network components

### Planning Deployment
1. **eu868_band** / **us915_band** / **as923_band** - Choose your region
2. **link_budget_calculator** - Estimate range requirements
3. **gateway_types** - Select gateway hardware
4. **end_device_selection** - Choose end device modules

### Optimization
1. **adaptive_data_rate** - Enable automatic optimization
2. **battery_life_optimization** - Maximize device lifetime
3. **payload_optimization** - Minimize air time
4. **network_capacity** - Scale to thousands of devices

### Troubleshooting
1. **join_failures** - Can't activate devices
2. **packet_loss** - Missing uplinks
3. **downlink_issues** - No downlink received
4. **interference_diagnosis** - RF interference problems

## Technical Depth

### Beginner Patterns
- lora_basics
- lora_vs_lorawan
- device_classes
- smart_cities applications

### Intermediate Patterns
- modulation_parameters
- adaptive_data_rate
- link_budget_calculator
- lorawan_security

### Advanced Patterns
- chirp_spread_spectrum
- spreading_factor_deep_dive
- network_capacity
- multicast

## Coverage Summary

### Modulation & RF
- Chirp spread spectrum (CSS) modulation
- Spreading factors (SF5-SF12)
- Bandwidth options (7.8-500 kHz)
- Coding rate (4/5 to 4/8)
- Sensitivity (-123 to -148 dBm)
- Link budget calculations

### Regional Bands
- EU868: ETSI EN 300 220, 1% duty cycle
- US915: FCC Part 15.247, 400ms dwell time
- AS923: 4 variants, LBT in Japan

### Chipsets
- SX1276/77/78/79 (2nd gen)
- SX1261/62/68 (3rd gen, 61% lower RX current)

### Network
- Star-of-stars topology
- Class A (lowest power)
- Class B (scheduled RX)
- Class C (continuous RX)
- OTAA and ABP activation
- ADR optimization
- Multicast support

### Applications
- Smart cities, agriculture, asset tracking
- Utility metering, environmental monitoring
- Building automation, industrial IoT

### Security
- AES-128 encryption
- Application and network session keys
- Frame counter replay protection
- Secure element integration

## Quick Reference

### Maximum Range
- Theoretical: ~15 km rural LOS
- Urban: 2-5 km
- Indoor: 100-500 m

### Battery Life
- Class A: 5-10 years typical
- Depends on: SF, TX frequency, payload size

### Data Rates
- EU868: 250 bps (SF12) to 11 kbps (SF7/250k)
- US915: 980 bps (SF10) to 12.5 kbps (SF8/500k)

### Network Capacity
- Devices per gateway: Hundreds to thousands
- Limited by: Duty cycle, air time, collision probability

## Resources

### Official Specifications
- LoRa Alliance: lora-alliance.org
- Semtech LoRa: semtech.com/lora
- LoRaWAN Specification: Latest version

### Tools
- Semtech LoRa Calculator
- RF Wireless World calculators
- ChirpStack open-source network server
- The Things Network (TTN)

### Development
- RadioLib (Arduino)
- LoRaMac-node (official stack)
- ChirpStack Gateway Bridge

## Pattern Statistics

- Total Patterns: 47
- Technology: 6
- Frequencies: 3
- Hardware: 6
- Network: 10
- Applications: 7
- Range: 4
- Optimization: 6
- Security: 3
- Troubleshooting: 4

---

Created: 2025-10-04
Source: Wikipedia research + technical specifications + real-world deployment experience
Format: Fabric pattern system.md style
