Core Parts List
Component | Model | Notes |
---|---|---|
MCU | Raspberry Pi Zero 2 W / 3B+ / 4 | Must have USB or SPI support |
LoRa Transceiver | SX1276 or SX1278 module | 433 MHz (Asia), 868 MHz (EU), 915 MHz (US) |
Antenna | Tuned to your region’s band | SMA or u.FL |
Power Supply | 5V 2A USB | Preferably battery-backed or solar |
Optional Display | 0.96” OLED I2C | For status output |
Optional Sensor | DHT22 / GPS / IMU | For telemetry or mesh position sync |
OTR LoRa Node API Summary
/lora/ping
→ Broadcast a ping frame to nearby LoRa devices.
/lora/send
→ Accepts JSON { "payload": "...", "target": "MAC" }
→ Transmit via LoRa.
/lora/receive
→ Listens and returns current payload buffer with timestamp + RSSI.
/lora/bind
→ Bind LoRa device to MAC + wallet address.
/lora/sync
→ Periodically fetch queued CID updates from connected validator node.
Software Stack (Flask or FastAPI)
- Runs headless.
pyLoRa
orlora-pi
library for low-level control.- Local SQLite ledger to queue events for push once internet returns.
- Can mount
alias_api_server.py
and reuse existing CID proof, alias, device auth, etc.
Deployment Options
- As standalone
.img
for Pi (cold boot LoRa validator). - Or bundle
.zip
kit for builders:lora_node_api.py
lora_config.json
startup.sh
api_readme.txt
/lora/send
for sending messages/lora/receive
for logging and fetching recent traffic/lora/bind
for MAC → wallet binding/lora/sync
for CID sync placeholder/lora/ping
as a basic connectivity test
Integration Steps
- Mount into FastAPI python
from lora_node_api import lora_router app.include_router(lora_router, prefix="/lora")
- Log received packets to IPFS (if enabled)
- Add IPFS support via
ipfshttpclient
- Toggle with
LORA_LOG_TO_IPFS = True
in config - Push
.json
message logs to IPFS on receipt - Optionally include: json
{ "mac": "...", "wallet": "...", "message": "...", "timestamp": "..." }
- Add IPFS support via
- Expose
/lora/history
to replay logged packets or download as .zip
lora_node_api.py Module Contents
from fastapi import APIRouter, Request
import time, json
from pydantic import BaseModel
from typing import Optional
lora_router = APIRouter()
message_log = []
class LoRaMessage(BaseModel):
mac: str
message: str
wallet: Optional[str] = None
@lora_router.post("/send")
def send_lora(msg: LoRaMessage):
ts = int(time.time())
entry = msg.dict()
entry["timestamp"] = ts
message_log.append(entry)
return {"status": "queued", "ts": ts}
@lora_router.get("/receive")
def get_messages():
return message_log[-25:]
@lora_router.get("/ping")
def ping():
return {"pong": True}
@lora_router.post("/bind")
def bind_mac(data: dict):
return {"status": "bound", "data": data}
@lora_router.post("/sync")
def cid_sync(data: dict):
return {"status": "sync_queued"}