Zbotic Logo Zbotic Logo
  • Home
  • Shop
  • Sale
  • 3D Print Service
  • PCB Service
  • B2B
  • Blogs
  • Contact Us
0 0

View Wishlist Add all to cart

0 0
0 Shopping Cart
Shopping cart (0)
Subtotal: ₹0.00

View cartCheckout

  • Shop
  • About Us
  • Contact Us
  • Reseller
  • Blogs
020 69134444
1800 209 0998
[email protected]
Help Desk
Facebook Twitter Instagram Linkedin YouTube
Zbotic Logo Zbotic Logo
0 0

View Wishlist Add all to cart

0 0
0 Shopping Cart
Shopping cart (0)
Subtotal: ₹0.00

View cartCheckout

All departments
  • 3D Print Service
  • 3D Printer
  • Batteries & Chargers
  • Development Boards
  • Drone Parts
  • EBike parts
  • Sensor Modules
  • Electronic Components
  • Electronic Modules
  • IoT and Wireless
  • Mechanical Parts and Workbench Tools
  • Motors & Drivers & Pumps & Actuators
  • DIY and Robot Kits
  • Show more
  • Home
  • Shop
  • Sale
  • 3D Print Service
  • PCB Service
  • B2B
  • Blogs
  • Contact Us
Return to previous page
Home Communication & Wireless Modules

LoRaWAN Gateway Build: The Things Network India Coverage

LoRaWAN Gateway Build: The Things Network India Coverage

April 1, 2026 /Posted by / 0

Building a LoRaWAN gateway for India and connecting it to The Things Network (TTN) is one of the most impactful IoT projects you can undertake. A single gateway can cover 5-15 km in rural areas, enabling hundreds of sensors to send data to the cloud without WiFi or cellular connectivity. This guide walks you through building a TTN-compatible LoRaWAN gateway using a Raspberry Pi, configuring it for the IN865 frequency plan, and expanding IoT coverage across India.

Table of Contents

  • What is LoRaWAN and TTN?
  • Gateway Architecture: How It Works
  • Hardware Selection for India
  • Raspberry Pi Gateway Setup
  • Registering on The Things Network
  • Building Your First LoRaWAN Node
  • Antenna Placement for Maximum Range
  • Frequently Asked Questions

What is LoRaWAN and TTN?

LoRaWAN (Long Range Wide Area Network) is a network protocol built on top of LoRa physical layer. While LoRa handles the radio modulation, LoRaWAN adds device addressing, security (AES-128 encryption), adaptive data rate, and multi-gateway support. Think of LoRa as the radio and LoRaWAN as the complete networking stack.

The Things Network (TTN) is a free, community-driven LoRaWAN network server. When you set up a gateway and connect it to TTN, your sensor nodes can send data to the cloud through the TTN infrastructure at zero cost. TTN handles device management, data routing, and integration with platforms like MQTT, HTTP webhooks, and cloud services.

The key components of a LoRaWAN network are:

  • End Devices (Nodes): Sensors with LoRa radios that collect and transmit data
  • Gateways: Receive LoRa packets and forward them to the network server over the internet
  • Network Server (TTN): Manages devices, deduplicates data, handles security
  • Application Server: Your backend that processes and visualises the sensor data

Gateway Architecture: How It Works

A LoRaWAN gateway is fundamentally a bridge between the LoRa radio world and the internet. It listens on multiple LoRa channels simultaneously and forwards all received packets to TTN’s network server. Unlike point-to-point LoRa, the gateway does not need to know which devices are transmitting — it simply captures everything and lets the network server sort it out.

A single-channel gateway (using one SX1278 module) can only listen on one frequency at a time. A proper 8-channel gateway (using a SX1301/SX1302 concentrator) can listen on 8 frequencies simultaneously, which is the TTN-recommended minimum for reliable operation.

For India (IN865 band):

  • Default channels: 865.0625 MHz, 865.4025 MHz, 865.985 MHz
  • Additional channels configurable between 865-867 MHz
  • An 8-channel gateway covers all default channels plus 5 custom channels
🛒 Recommended: Waveshare SX1262 LoRa HAT for Raspberry Pi 868MHz — Single-channel LoRa HAT for building an affordable gateway. Compatible with IN865 band for Indian deployments.

Hardware Selection for India

Option 1: Single-Channel Packet Forwarder (Budget: ₹3,000-5,000)

A Raspberry Pi with a single LoRa module. Affordable but can only listen on one channel at a time. Suitable for learning, testing, and small private networks.

  • Raspberry Pi 4 (4GB recommended)
  • Waveshare SX1262 LoRa HAT (868 MHz band)
  • External antenna with SMA connector
  • 5V 3A USB-C power supply
  • MicroSD card (32GB+)

Option 2: 8-Channel Concentrator Gateway (Budget: ₹15,000-30,000)

Uses a RAK2245/RAK2287 concentrator module with SX1302 chip. This is the recommended configuration for TTN community gateways and commercial deployments.

Antenna Selection

The antenna is the most important factor in gateway range. Options for Indian deployments:

  • Small whip antenna (3 dBi): Included with most modules. Range: 1-3 km. Good for indoor testing.
  • Fibreglass omnidirectional (5-8 dBi): Outdoor-rated. Range: 5-10 km. Best for rooftop mounting.
  • High-gain omnidirectional (10-12 dBi): Range: 10-15+ km. Requires proper mast mounting.
🛒 Recommended: LoRa Antenna 868MHz — External SMA antenna tuned for the 868MHz band, compatible with IN865 frequency plan used in India.

Raspberry Pi Gateway Setup

Here is how to set up a single-channel packet forwarder on a Raspberry Pi with the Waveshare SX1262 LoRa HAT:

Step 1: Install Raspberry Pi OS

# Flash Raspberry Pi OS Lite (64-bit) to SD card
# Enable SSH: create empty file named 'ssh' in boot partition
# Configure WiFi: create wpa_supplicant.conf in boot partition

Step 2: Enable SPI Interface

sudo raspi-config
# Navigate to: Interface Options → SPI → Enable
# Reboot after enabling

Step 3: Install Dependencies

sudo apt update && sudo apt upgrade -y
sudo apt install -y python3-pip python3-spidev git
pip3 install RPi.GPIO spidev

Step 4: Configure Packet Forwarder

# Clone the single-channel packet forwarder
git clone https://github.com/tftelkamp/single_chan_pkt_fwd.git
cd single_chan_pkt_fwd

# Edit main.cpp - set frequency for IN865
# Change freq to 865062500 (865.0625 MHz)
# Set server to the nearest TTN router:
# router.in1.thethings.network

make
sudo ./single_chan_pkt_fwd

Step 5: Create System Service

# /etc/systemd/system/lora-gateway.service
[Unit]
Description=LoRa Single Channel Gateway
After=network.target

[Service]
ExecStart=/home/pi/single_chan_pkt_fwd/single_chan_pkt_fwd
WorkingDirectory=/home/pi/single_chan_pkt_fwd
Restart=always
User=root

[Install]
WantedBy=multi-user.target
sudo systemctl enable lora-gateway
sudo systemctl start lora-gateway

Registering on The Things Network

  1. Create an account at console.thethingsnetwork.org
  2. Click Gateways → Register Gateway
  3. Enter your Gateway EUI (8-byte unique identifier — use the Pi’s Ethernet MAC address with FFFE inserted in the middle)
  4. Select frequency plan: India 865-867 MHz (IN865)
  5. Set the gateway location on the map for coverage visualisation
  6. Note down the Gateway Key for authentication

After registration, your gateway should appear as “Connected” on the TTN console within a few minutes. You can monitor incoming packets, signal strength, and uptime from the dashboard.

Building Your First LoRaWAN Node

With the gateway running, build a simple LoRaWAN sensor node using an Arduino and LoRa module:

#include <lmic.h>
#include <hal/hal.h>
#include <SPI.h>

// TTN device credentials (OTAA)
static const u1_t PROGMEM APPEUI[8] = { /* from TTN console */ };
void os_getArtEui(u1_t* buf) { memcpy_P(buf, APPEUI, 8); }

static const u1_t PROGMEM DEVEUI[8] = { /* from TTN console */ };
void os_getDevEui(u1_t* buf) { memcpy_P(buf, DEVEUI, 8); }

static const u1_t PROGMEM APPKEY[16] = { /* from TTN console */ };
void os_getDevKey(u1_t* buf) { memcpy_P(buf, APPKEY, 16); }

static uint8_t payload[4];
static osjob_t sendjob;
const unsigned TX_INTERVAL = 300; // Send every 5 minutes

// Pin mapping for SX1278
const lmic_pinmap lmic_pins = {
  .nss = 10,
  .rxtx = LMIC_UNUSED_PIN,
  .rst = 9,
  .dio = {2, 6, 7},
};

void do_send(osjob_t* j) {
  if (LMIC.opmode & OP_TXRXPEND) return;
  
  // Read temperature sensor (LM35 on A0)
  int rawTemp = analogRead(A0);
  int temperature = (rawTemp * 500) / 1024; // Celsius x10
  
  // Read humidity (analog sensor on A1)
  int humidity = map(analogRead(A1), 0, 1023, 0, 100);
  
  // Pack into payload (2 bytes each)
  payload[0] = highByte(temperature);
  payload[1] = lowByte(temperature);
  payload[2] = highByte(humidity);
  payload[3] = lowByte(humidity);
  
  LMIC_setTxData2(1, payload, sizeof(payload), 0);
}

void onEvent(ev_t ev) {
  switch (ev) {
    case EV_JOINED:
      LMIC_setLinkCheckMode(0);
      break;
    case EV_TXCOMPLETE:
      os_setTimedCallback(&sendjob, os_getTime() + 
        sec2osticks(TX_INTERVAL), do_send);
      break;
  }
}

void setup() {
  Serial.begin(9600);
  os_init();
  LMIC_reset();
  
  // Set IN865 channels
  LMIC_setupChannel(0, 865062500, DR_RANGE_MAP(DR_SF12, DR_SF7), BAND_MILLI);
  LMIC_setupChannel(1, 865402500, DR_RANGE_MAP(DR_SF12, DR_SF7), BAND_MILLI);
  LMIC_setupChannel(2, 865985000, DR_RANGE_MAP(DR_SF12, DR_SF7), BAND_MILLI);
  
  LMIC_setLinkCheckMode(0);
  LMIC.dn2Dr = DR_SF9;
  LMIC_setDrTxpow(DR_SF7, 14);
  
  do_send(&sendjob);
}

void loop() {
  os_runloop_once();
}

Register this device on TTN console under Applications → Add Device. Use OTAA (Over-The-Air Activation) for better security. The device will automatically join the network through your gateway.

🛒 Recommended: Waveshare RP2040-LoRa Development Board — RP2040 microcontroller with integrated SX1262 LoRa module, perfect for building compact LoRaWAN sensor nodes.

Antenna Placement for Maximum Range

The antenna is the single most important factor in gateway coverage. Here are tips specifically for Indian rooftop installations:

  • Height is everything: Every 1 metre of additional height adds roughly 1 km of range. Mount the antenna on a rooftop mast, water tank support, or the highest point of your building.
  • Clear line of sight: The 865 MHz signal can penetrate walls and trees but is significantly attenuated. For best range, ensure the antenna has an unobstructed 360-degree view of the horizon.
  • Lightning protection: India’s monsoon season brings heavy lightning. Install a lightning arrestor on the antenna cable and ground the mast properly. A direct lightning strike will destroy the gateway.
  • Weatherproofing: Use IP67-rated enclosures for the Raspberry Pi and LoRa HAT. Seal all cable entry points with silicone. Indian monsoons will find every gap.
  • Cable length: Keep the coaxial cable between antenna and gateway as short as possible. Every 10 metres of RG-58 cable at 868 MHz loses about 3 dB (half the signal power).
🛒 Recommended: Waveshare SX1268 LoRa HAT 433MHz — Alternative 433MHz band gateway HAT for environments requiring better obstacle penetration.

Frequently Asked Questions

Is The Things Network free to use in India?

Yes. TTN is completely free for community use. There is a Fair Use Policy that limits each device to 30 seconds of airtime per day (approximately 10-20 uplinks depending on spreading factor). For commercial use with higher throughput, consider The Things Industries (paid) or ChirpStack (self-hosted, free).

How many devices can my gateway support?

An 8-channel gateway can theoretically support thousands of devices. Practically, with sensors reporting every 15 minutes at SF7, a single gateway handles 500-2000 nodes. A single-channel gateway is limited to about 50-100 nodes.

What frequency plan should I use in India?

Use IN865-867 for all LoRaWAN deployments in India. This is the only official LoRaWAN frequency plan approved by the Indian DoT. Do not use EU868 or US915 plans even if they seem similar.

Can I see my gateway on the TTN map?

Yes. After registration, your gateway appears on the TTN global coverage map at ttnmapper.org. This helps the community see LoRaWAN coverage across India. Currently, cities like Bangalore, Pune, Hyderabad, and Delhi have the most community gateways.

Do I need internet connectivity for the gateway?

Yes. The gateway needs a reliable internet connection (WiFi or Ethernet) to forward packets to the TTN server. The bandwidth requirement is minimal — even a slow 256 kbps connection is sufficient for hundreds of sensor nodes.

Conclusion

Building a LoRaWAN gateway and connecting it to The Things Network is a powerful way to enable IoT coverage in your area. Whether you are a student expanding TTN coverage on your college campus, a farmer deploying sensors across fields, or a startup building an IoT product, the gateway is the foundation of your LoRaWAN network. Start with a single-channel Raspberry Pi gateway for learning, and upgrade to an 8-channel concentrator for production use.

Get started with LoRaWAN in India today. Browse our complete collection of LoRa modules, HATs, and antennas at Zbotic.in for everything you need to build your gateway and sensor nodes.

Tags: gateway, India, iot, LoRaWAN, TTN
Share Post
  • Facebook
  • Linkedin
  • Whatsapp
Smart Door Lock with RFID: Ard...
blog smart door lock with rfid arduino access control system 612505
blog plc programming basics ladder logic tutorial for arduino users 612507
PLC Programming Basics: Ladder...

Related posts

Svg%3E
Read more

ESP-NOW: Direct ESP32-to-ESP32 Communication Without WiFi

April 1, 2026 0
ESP-NOW ESP32 communication is a game-changing protocol developed by Espressif that enables direct peer-to-peer wireless communication between ESP32 boards without... Continue reading
Svg%3E
Read more

SDR Getting Started: HackRF and RTL-SDR Projects India

April 1, 2026 0
Software Defined Radio (SDR) lets you explore the electromagnetic spectrum using your computer, replacing expensive hardware radios with affordable USB... Continue reading
Svg%3E
Read more

Zigbee vs WiFi vs BLE: Choosing the Right Wireless Protocol for IoT

April 1, 2026 0
Choosing between Zigbee vs WiFi vs BLE for your IoT project is one of the most important design decisions you... Continue reading
Svg%3E
Read more

RFID Module Guide: RC522, PN532, and Long-Range UHF Options

April 1, 2026 0
The RFID module RC522 Arduino combination is the starting point for thousands of access control, attendance, and inventory tracking projects... Continue reading
Svg%3E
Read more

RS485 Modbus Communication: Industrial Sensors with Arduino

April 1, 2026 0
RS485 Modbus Arduino interfacing opens the door to industrial-grade sensor communication. Unlike hobbyist I2C or SPI sensors, RS485 Modbus sensors... Continue reading

Add comment Cancel reply

Your email address will not be published. Required fields are marked

Facebook Twitter Instagram Pinterest Linkedin Youtube

Get the latest deals and more.

Download on Google Play Download on the App Store

Call us: 020 69134444 / 1800 209 0998

Monday - Saturday 09:30 AM - 06:00 PM
For Technical Supports Email: [email protected]
For Sales / Enquiries Email: [email protected]

  • My Account

    • Cart

    • Wishlist

    • Checkout

    • My Orders

    • Track Order

    • My Account

  • Information

    • FAQs

    • Blogs

    • Career

    • About Us

    • Contact Us

    • Payment Options

  • Policies

    • Privacy Policy

    • Terms & Conditions

    • GST Input Tax Credit

    • Shipping Return Policy

    • E-Waste Collection Points

    • Our Sitemap

© Zbotic.in is registered trademark of Moxie Supply Pvt Ltd – All Rights Reserved
Login
Use Phone Number
Use Email Address
Not a member yet? Register Now
Reset Password
Use Phone Number
Use Email Address
Register
Already a member? Login Now