Skip to content
Academia.
ELEmbedded LinuxT550077101 · Fall 2026
CourseFall 2026

Friday · 12:00–16:00 · Odense U174

LoRaWAN, TTN, Gateways, Tracking, and Private-Cloud Integration

Lecture 07: This module introduces LoRaWAN-based IoT communication and deployment. It covers LoRaWAN architecture, The Things Network, gateways, device activation and security, data transmission, payload decoding, GPS tracking, and integration with private cloud systems. The module also considers practical gateway deployment, sensor connectivity, testing, and real-world applications of LoRaWAN.

Learning objectives

✓By the end of this module, students should be able to:
✓• distinguish LoRa modulation, LoRa peer-to-peer, LoRaWAN, The Things Network, and Meshtastic;
✓• explain the history, star-of-stars architecture, protocol roles, security separation, and packet flow of LoRaWAN;
✓• select a legal regional frequency plan and explain why one radio configuration cannot be deployed unchanged worldwide;
✓• compare OTAA and ABP activation and protect device identifiers, root keys, session keys, and frame counters;
✓• explain Classes A, B, and C, Adaptive Data Rate, confirmed traffic, receive windows, roaming, and downlink constraints;
✓• specify, build, place, register, monitor, and maintain a multi-channel LoRaWAN gateway, including a Raspberry Pi-based gateway;
✓• register and join an end device and gateway to The Things Stack/The Things Network;
✓• design compact versioned payloads, decoders, MQTT/webhook integrations, and a resilient private-cloud bridge;
✓• evaluate commercial sensors, GPS trackers, gateways, coverage claims, price ranges, battery life, and total deployment cost;
✓• test coverage, capacity, provenance, security, outage recovery, and field maintainability using defensible evidence.
Block 112:00–12:50content

Block 1 · 12:00–12:50 · From LoRa Radio to a Secure LoRaWAN Network

Embedded Linux — Chapter 7, Part 1

CHAPTER 7

LoRaWAN, TTN, Gateways, Tracking,
and Private-Cloud Integration

Learning objectives
By the end of this module, students should be able to:
  • distinguish LoRa modulation, LoRa peer-to-peer, LoRaWAN, The Things Network, and Meshtastic;
  • explain the history, star-of-stars architecture, protocol roles, security separation, and packet flow of LoRaWAN;
  • select a legal regional frequency plan and explain why one radio configuration cannot be deployed unchanged worldwide;
  • compare OTAA and ABP activation and protect device identifiers, root keys, session keys, and frame counters;
  • explain Classes A, B, and C, Adaptive Data Rate, confirmed traffic, receive windows, roaming, and downlink constraints;
  • specify, build, place, register, monitor, and maintain a multi-channel LoRaWAN gateway, including a Raspberry Pi-based gateway;
  • register and join an end device and gateway to The Things Stack/The Things Network;
  • design compact versioned payloads, decoders, MQTT/webhook integrations, and a resilient private-cloud bridge;
  • evaluate commercial sensors, GPS trackers, gateways, coverage claims, price ranges, battery life, and total deployment cost; and
  • test coverage, capacity, provenance, security, outage recovery, and field maintainability using defensible evidence.
LoRaWAN is a complete network architecture
LoRa is a radio modulation. LoRaWAN defines how end devices use LoRa-compatible physical layers within a managed network: activation, addressing, frame protection, device classes, receive opportunities, data-rate control, gateways, network servers, application delivery, and roaming-related functions. A LoRa transceiver connected to an Arduino is not automatically a LoRaWAN network, and a single-channel receiver is not a standards- compliant production gateway.

7.1  A Short History of LoRaWAN

The radio technology associated with LoRa originated with Cycleo in France and became part of Semtech after its acquisition in 2012. The LoRa Alliance began operating in 2015 as an open, nonprofit industry association to standardize and promote low-power wide-area networking.

90
Embedded Linux – Fall 2026

Early LoRaWAN specifications appeared in 2015, followed by revisions improving interoperability, security, device behavior, and deployment support [48, 49, 50].

The Things Network (TTN) developed as a community effort to build open LoRaWAN coverage, while The Things Industries developed the The Things Stack software and commercial services. Today, LoRaWAN can be deployed as a community network, a commercial managed network, or a private network under an organization’s control.

Historical dates help explain the ecosystem, but a deployment must be based on the exact LoRaWAN version, Regional Parameters revision, network-server version, and device certification/profile in use. “LoRaWAN compatible” is not sufficiently precise for procurement or integration.

7.2  LoRaWAN Architecture and Packet Flow

LoRaWAN commonly uses a star-of-stars architecture. End devices transmit radio frames without selecting one gateway. Every compatible gateway that receives the uplink forwards it over an IP backhaul. The network server validates network-layer information, deduplicates copies, manages radio/network behavior, and routes application data. The application server handles application-layer payload protection and delivery. A join server participates in activation and key derivation in architectures that separate that role.

ChatGPT Image Sep 22, 2026, 09_10_36 PM
Figure 7.1. LoRaWAN star-of-stars architecture, showing the main uplink path. Gateways forward received radio packets to server infrastructure, where network and application roles are separated. Join procedures and downlink scheduling are omitted from this overview.
Embedded Linux – Fall 202691

Gateways are usually transparent packet forwarders rather than application interpreters. Receiving the same uplink through multiple gateways improves diversity and gives the network server multiple metadata observations. It also means that gateway count is not packet count; deduplication is essential.

RolePrimary responsibility
End deviceSenses or acts, prepares LoRaWAN frames, follows class/region/MAC behavior, and protects assigned secrets
GatewayForwards radio packets and metadata over IP; authentication and encryption depend on the selected forwarding protocol
Network serverValidates network frames, rejects replays, deduplicates gateway copies, manages MAC commands, data rate, and downlink scheduling
Join serverHolds activation-related root-key context and supports session-key derivation according to protocol architecture
Application serverDecrypts/interprets application payload context and provides integrations to authorized applications
Application/bridgeValidates decoded data, maps identity, stores/forwards events, applies business logic, and exposes observability
Identity/access serviceAuthenticates users/components and controls permitted resources and operations

Implementations may combine roles in one deployment, but combining software does not erase logical trust boundaries. Prefer authenticated, encrypted forwarding such as correctly configured LoRa Basics Station; the legacy Semtech UDP packet forwarder does not itself provide equivalent transport protection.

7.3  LoRaWAN Frame Concepts

A gateway forwards the received LoRaWAN physical payload together with radio metadata such as frequency, data rate, RSSI, and SNR. Those metadata are not all fields transmitted inside the LoRaWAN frame. At the network layer, fields include a message header and, for data frames, device address, frame control, frame counter, optional frame options, an optional port and encrypted frame payload when present, and integrity protection. Exact security processing depends on LoRaWAN version.

The FPort field distinguishes payload use: port 0 carries MAC commands; ports 1–223 are available for application payloads, subject to any adopted application-package reservations. Device address DevAddr is a session/network address, not a permanent globally meaningful asset ID. Frame counters support replay protection and ordering. Resetting counters incorrectly can cause a network server to reject otherwise valid frames.

LoRaWAN limits usable application payload according to regional parameters and data rate. The correct response is compact, versioned encoding rather than assuming Internet-sized messages. Fragmentation and bulk transfer are possible only with additional complexity and are not the natural strength of LPWAN.

Embedded Linux – Fall 202692

7.4  Regional Frequency Plans

LoRaWAN operates in regionally regulated spectrum. Frequency ranges, channel plans, data rates, maximum radiated power, duty cycle or dwell time, listen-before-talk rules, and gateway requirements differ. Select the network server’s exact frequency plan and matching hardware before deployment.

Table 7.2. High-level examples of LoRaWAN regional parameter families. These are orientation ranges, not a substitute for the current Regional Parameters document or national law.

Plan familyIndicative spectrumExample geographyImportant planning issue
EU868Primarily
863–870 MHz
European countries including DenmarkSub-band power/duty rules and network channel plan; verify current ETSI/national requirements
EU433Around 433 MHzPermitted European use casesDifferent antennas, channels, and restrictions; less commonly selected for many deployments
US915902–928 MHzUnited StatesLarge channel set, sub-band/channel-mask behavior, dwell/power rules
AU915915–928 MHzAustralia and related deploymentsSimilar-looking hardware is not sufficient; select the correct regional channel plan
AS923 variantsAround 923 MHz with country-specific variantsParts of Asia-Pacific and other adopted jurisdictionsVariant, channel offset, power, dwell time, and local adoption must match country
IN865Approximately 865–867 MHzIndiaRegion-specific channels and power behavior
KR920Approximately 920–923 MHzSouth KoreaLocal channel and access requirements
CN470Approximately 470–510 MHzChinaDifferent hardware/front end and large regional channel plan
RU864Approximately 864–870 MHzRussian regional planConfirm present legal and network support before deployment
93Embedded Linux – Fall 2026

For this course in Denmark, EU868 is the expected starting plan unless the instructor specifies otherwise. A 915 MHz-only gateway or antenna is not interchangeable with an EU868 installation. The authoritative sources are the current LoRa Alliance Regional Parameters specification, applicable national regulation, and network-operator policy [51].

Engineering caution
Do not copy a frequency from an online tutorial without checking jurisdiction, device certification, antenna, network plan, and current law. A radio that can technically transmit at a frequency is not automatically permitted to do so.

7.5  Fair Use, Duty Cycle, and Network Capacity

Legal radio limits and network-provider fair-use policies are separate. A private network can remove a community provider’s usage policy, but it cannot remove government spectrum rules or physics.

The TTN/The Things Stack Sandbox duty-cycle documentation, checked on 8 September 2026, states a Fair Use Policy of 30 seconds of uplink airtime and 10 downlink messages per end device per 24 hours (including acknowledgements) [52]. Students must recheck the current policy before deployment because service terms can change.

Duty-cycle usage is based on airtime, not message count. Long payloads, high spreading factors, confirmed uplinks, join retries, MAC commands, and repeated downlinks consume capacity. A fleet that transmits synchronously after midnight or after power restoration can collide even when each node individually appears modest.

Gateways have more severe downlink constraints than many newcomers expect. While transmitting, a common gateway radio chain cannot simultaneously receive on that chain; a long downlink can therefore block reception of many uplinks. Network scheduling, regional restrictions, and Class A receive windows further limit delivery. Design LoRaWAN as uplink-oriented and keep downlinks rare, short, and purposeful.

7.6  Device Activation and Identifiers

Over-the-Air Activation (OTAA) performs a join exchange and derives session context. It supports cleaner session renewal and is generally preferred. Activation by Personalization (ABP) installs session parameters directly and can be useful in controlled cases, but counter persistence, key lifecycle, and reprovisioning are easier to get wrong.

Embedded Linux – Fall 202694

Common identifiers and secrets include:

ItemPurposeHandling principle
DevEUIGlobally unique end-device identifierNormally not secret; must be correct and unique
JoinEUIIdentifies the join-server context; called AppEUI in older versionsNormally not secret; multiple devices can share the same JoinEUI
AppKeyRoot key used in activation contextSecret; unique per device wherever feasible; never publish
NwkKeyAdditional root-key role in LoRaWAN 1.1 architecturesSecret; version-specific handling
DevAddrSession/network device addressNot stable asset identity and not normally secret
Session keysProtect network and application session trafficSecret; derived or provisioned according to activation/version
Frame countersSupport replay protection and orderingMust be handled correctly across reset and session lifecycle

In OTAA, the device transmits a join request and accepts a valid join response. The network and join components establish session state. A joined device is not guaranteed continuous coverage; joining proves only that a particular exchange succeeded.

Provisioning should preserve a secure mapping between physical asset label, hardware revision, DevEUI, application, profile, owner, installation location, firmware, root-key custody, and decommission state. Avoid copying one device’s credentials into a fleet image.

7.7  Security and Key Separation

LoRaWAN uses AES-128-based cryptographic mechanisms and separates network-layer and application-layer security roles according to protocol version. The security model is stronger than sending plaintext peer-to-peer frames, but operational security still depends on unique keys, protected storage, correct counters, authentic firmware, secure backend connections, access control, and revocation.

Important rules are:

  • never place root or session keys in public source code, screenshots, reports, decoder scripts, or topic names;
  • avoid fleet-wide shared root keys;
  • protect manufacturing and enrollment systems;
  • restrict TTN console and API rights by role;
  • authenticate gateway and integration connections;
  • rotate integration credentials and revoke lost devices;
  • validate downlink commands at the application and actuator boundary; and
  • maintain recovery when keys, administrators, or cloud services are unavailable.

Radio encryption does not protect data after it has been decoded and exported through MQTT, webhook, database, dashboard, or CSV. End-to-end privacy and authorization continue through the complete data lifecycle.

95Embedded Linux – Fall 2026

7.8  Device Classes and Receive Behavior

All LoRaWAN end devices implement Class A. Class B and Class C add receive opportunities at energy and infrastructure cost.

ClassReceive behaviorEngineering implication
AOpens RX1 after uplink and RX2 if no valid intended downlink was received in RX1Lowest-power mandatory class; server downlink waits for an uplink opportunity
BAdds synchronized scheduled ping slotsMore predictable downlink opportunities; requires timing/beacon support and more energy
CListens almost continuously except while transmittingLow downlink latency but high power; normally mains-powered or energy-rich devices

A Class A device that reports every hour may wait nearly an hour before the network gets a receive opportunity. Sending unnecessary uplinks solely to poll for commands consumes capacity and battery. Safety-critical immediate control should not depend on best-effort LoRaWAN downlink.

Embedded Linux – Fall 202696
Block 213:00–13:50content

Block 2 · 13:00–13:50 · Building the Network: Gateways, Connectivity, and TTN

Embedded Linux - Chapter 7 Part 2

7.9   Adaptive Data Rate and Confirmed Traffic

Adaptive Data Rate (ADR) allows the network and device to improve capacity and energy by adjusting data rate and transmit power based on observed link conditions. ADR is most suitable for stationary or slowly changing links with sufficient history. A fast-moving tracker or rapidly changing channel may need device-managed data-rate strategy.

ADR cannot repair a poor antenna, invalid frequency plan, severe interference, or absent coverage. Multiple-gateway reception and good margin allow faster data rates, reducing airtime for the complete network.

Confirmed uplinks request acknowledgement. They should be reserved for information whose delivery knowledge justifies downlink and retry cost. An acknowledgement can still be lost after the server received the message, producing repetition. Application identifiers and idempotency remain necessary.

7.10   Gateways and Concentrators

A LoRaWAN gateway receives multiple LoRa channels and spreading factors and forwards packets over IP. A real gateway is not simply an end-device LoRa transceiver connected to a Raspberry Pi. Its concentrator is designed for simultaneous multi-channel reception and timestamping.

Representative concentrators include the Semtech SX1301 family and newer designs based on the SX1302 or SX1303, combined with suitable RF front ends. Product choice must match region and gateway software.A gateway also needs:

  • host processor or embedded Linux computer;
  • compatible concentrator card and host interface;
  • region-correct RF front end and antenna connector;
  • correct antenna, mounting hardware, and lightning/surge strategy;
  • stable power supply, optional UPS, and thermal design;
  • Ethernet, Wi-Fi, or cellular IP backhaul;
  • enclosure, cable glands, grounding, and environmental rating for outdoor use;
  • packet-forwarding software such as LoRa Basics Station or another network-supported forwarder;
  • unique gateway identity, credentials, time, logs, monitoring, and update strategy;
  • optional GNSS timing/location hardware when required by design.
132.7.2.

Figure 7.2. Conceptual assembly of a Raspberry Pi based multi-channel LoRaWAN gateway. Packet forwarding runs at the gateway. The network server may be elsewhere. Power, modem, concentrator, antenna, enclosure, and interface compatibility must be selected for the actual installation. Drawn cables do not specify verified wiring.

Single-channel “gateways” miss most valid LoRaWAN traffic, cannot reproduce network scheduling correctly, and should not be presented as production-compliant gateways. They may be useful as limited radio experiments if their limitation is explicit.

7.11   Building a Raspberry Pi LoRaWAN Gateway

A Raspberry Pi can host a concentrator and packet-forwarding software. It is suitable for teaching and prototypes and can be engineered for field use, but a commercial outdoor gateway may offer better power, RF, environmental, regulatory, lifecycle, and remote-management integration.

A disciplined build sequence is:

  1. select region-correct concentrator, antenna, and regulatory configuration;
  2. mount the concentrator using the correct host interface and power requirements; an mPCIe-shaped connector may carry SPI or USB rather than PCI Express, so verify the pinout and electrical interface;
  3. attach the antenna before any permitted transmission and verify connectors;
  4. install a supported minimal OS and secure the Pi as described in Module 2;
  5. install the network-supported packet forwarder and verify concentrator reset/pin configuration;
  6. assign a unique gateway EUI and authenticate its connection to the network server;
  7. choose the exact frequency plan and confirm received channel metadata;
  8. place the antenna with safe lightning, grounding, cable-loss, and weather considerations;
  9. monitor backhaul, temperature, storage, service restart, packet rate, and clock;
  10. test power loss, network loss, process restart, update, and recovery before relying on it.

Do not expose the Pi’s SSH interface broadly merely because the gateway needs Internet access. Packet forwarding is an outbound connection in many architectures; management should use a separately protected route.

7.12   Gateway Placement and Coverage Planning

Antenna height and clearance often matter more than transmitter power. Place gateways above local obstructions, minimize lossy coax, respect lightning protection and structural safety, and avoid strong in-band interferers. More gateways improve diversity and can allow lower airtime through ADR, but overlapping gateways do not create infinite capacity.

Coverage testing should use a known device and payload sequence while recording location, height, antenna, data rate, transmit power, RSSI, SNR, gateway count, join success, PDR, latency, and environment. Test inside buildings, near machinery, under vegetation, at ground-level sensor height, and across seasons relevant to the application.

A coverage map based only on successfully received points is biased. Record attempted transmissions and missing sequences. Separate uplink coverage from downlink availability.

7.13   Joining a Gateway to The Things Network

Exact console labels change, but the underlying procedure is stable:

  1. create or select the correct TTN/The Things Stack tenant and regional cluster;
  2. register a gateway with a unique gateway ID and gateway EUI;
  3. select the frequency plan that exactly matches hardware and country;
  1. create the required gateway authentication key or connection credentials;
  2. configure Basics Station or the supported packet forwarder with server endpoint and credentials;
  3. start the service and inspect both local logs and console connection status;
  4. transmit a legal test uplink and verify reception metadata;
  5. document owner, physical location, precision, antenna, firmware, forwarder version, and recovery access.

A green “connected” indicator proves backhaul activity, not useful RF coverage. Verify live uplinks and metadata. Do not publish exact locations of security-sensitive private gateways unless operationally justified.

7.14   Joining an End Device to TTN Using OTAA

A typical TTN end-device workflow is:

  1. create an application and choose the closest appropriate regional cluster;
  2. select a device from the LoRaWAN Device Repository when an accurate profile exists, or enter parameters manually;
  3. select LoRaWAN MAC version, Regional Parameters version, frequency plan, and device class support;
  4. register a unique DevEUI and the assigned JoinEUI; the JoinEUI may be shared by devices served by the same join context;
  5. provision the device-specific root key or keys through a protected process;
  6. configure firmware with the identical region, identifiers, key byte order/format, and join behavior;
  7. initiate OTAA join with bounded retry/backoff;
  8. inspect join-request and join-accept events without exposing secrets;
  9. transmit a small versioned uplink and confirm frame counter and gateway metadata;and
  10. test power cycle, session renewal, missing coverage, and credential rejection.

Frequent join attempts can consume battery and airtime. Persist session state appropriately where supported, but preserve protocol security and counter correctness. Debug systematically: frequency plan and hardware, antenna, gateway reception, identifiers, key representation, MAC/Regional Parameters version, join nonce/counter behavior, and network events.

7.15   Payload Encoding and TTN Decoders

Binary encoding saves airtime but transfers responsibility to the specification and decoder. Define schema version, field order, byte order, signedness, scaling, range, missing values, flags, and compatibility tests. The Things Stack JavaScript formatter uses ECMAScript 5.1, so this example uses var and ordinary functions rather than ES6 syntax. it expects FPort 1, nine bytes, and big-endian 16-bit fields [52].

Listing 7.1. Illustrative TTN uplink payload decoder
 1function decodeUplink(input) {
 2  var b = input.bytes;
 3
 4  if (input.fPort !== 1) {
 5    return { errors:["unsupported application port"] };
 6  }
 7  if (b.length !== 9) {
 8return { errors:["invalid payload length"] };
 9}
 10if (b[0] !== 1) {
 11  return { errors:["unsupported schema version"] };
 12}
 13
14function signed16(high, low) { 15 var raw = (high << 8) | low; 16 return raw >= 0x8000 ? raw - 0x10000 : raw; 17} 18
19var temperature = signed16(b[2], b[3]) / 100; 20var humidity = (b[4] << 8 | b[5]) / 100; 21var sequence = (b[6] << 8) | b[7]; 22
23var warnings = []; 24if (temperature < -50 || temperature > 100) 25 warnings.push("temperature outside expected range"); 26if (humidity < 0 || humidity > 100) 27 warnings.push("humidity outside expected range"); 28
29return { 30 data: { 31 schema_version:b[0], 32 node_id:b[1], 33 temperature_C:temperature, 34 relative_humidity_pct:humidity, 35 sequence:sequence, 36 status:b[8] 37 }, 38 warnings:warnings 39}; 40}

For example, hexadecimal bytes 01 07 08 7A 18 A6 00 2A 00 on FPort 1 decode as node 7, 21.70 degrees Celsius, 63.10 percent relative humidity, sequence 42, and status 0. In this teaching schema status 0 means no node-reported fault; any nonzero status must be interpreted using the node’s documented fault map. The 16-bit sequence wraps, so combine it with device/session context and a bounded deduplication window. Test decoder boundary values and malformed lengths. A decoder warning does not automatically discard a frame; application policy decides. Maintain decoder version alongside stored data so historical records remain interpretable.

Block 314:00–14:50content

Block 3 · 14:00–14:50 · From Sensor Data to Cloud Applications and Tracking

7.16   TTN Integrations and Private-Cloud Bridge

The Things Stack can deliver application events through MQTT, webhooks, and other integrations. An MQTT client subscribes using application-specific credentials and the cluster endpoint. A webhook receives authenticated HTTP events. Neither method should expose broad administrative credentials.. The documented Things Stack MQTT integration supports MQTT 3.1.1 with QoS 0 only. A local durable queue protects events after the bridge receives them; it cannot recover events missed during a disconnected subscription. Where gap-free ingestion is required, add a supported storage/retrieval or application-level reconciliation mechanism and test its retention and failure behavior [52].

138.7.3.Figure 7.3. A private-cloud bridge validates source identity and schema, queues accepted events, and separates rejected messages for diagnosis. Downstream retries protect events already received and persisted by the bridge; they cannot recover upstream events lost before receipt, including missed QoS deliveries.

A resilient bridge should:

  • authenticate the TTN endpoint and protect its integration credential;
  • subscribe only to required applications/events;
  • validate event type, application/device identity, decoded schema, and ranges;
  • preserve received metadata, frame counter, correlation IDs, gateway observations, and decoder version;
  • deduplicate or make storage idempotent;
  • use bounded retry, durable buffering, dead-letter handling, and backpressure;
  • expose connection state, event rate, rejection reasons, queue depth, oldest age, and storage latency;
  • rotate credentials and recover from revocation; and
  • avoid treating network-server receipt time as the physical observation time.

Private cloud does not mean automatically secure or highly available. Define hosting boundary, TLS, firewall, backup, identity, secrets, updates, database retention, privacy, monitoring, and disaster recovery. A Raspberry Pi can host a laboratory private service, but availability and storage claims must match its power, media, network, and backup design.

7.17   End-to-End Provenance

Provenance connects a stored value to its physical and computational history:

  1. physical asset and sensing channel;
  2. firmware, payload schema, calibration, and observation time;
  3. DevEUI/session address and frame counter;
  4. gateway IDs, radio settings, RSSI/SNR, and network receipt time;
  5. network/application server processing and decoder version;
  6. integration event and correlation identifiers;
  7. bridge version, validation result, and queue state; and
  8. database record, transformation, retention, and consuming analysis.
Not every item must be stored forever, but the project must preserve enough to explain duplicates, gaps, calibration changes, decoder errors, and disputed results. A dashboard value without source and time is not scientific evidence.

7.18   Commercial Devices and Indicative Price Ranges

The following ranges are illustrative euro-denominated allowances for a classroom budgeting exercise, retained to show the scale of different equipment categories. They are not a verified 2026 market survey or supplier quotations; VAT, shipping, installation, and recurring fees must be specified separately before a purchase decision. Prices change with quantity, radio region, enclosure, sensors, certification, subscription, GNSS, battery, antenna, and support.

Table 7.5.  Illustrative LoRaWAN equipment categories and classroom budget ranges.
Category/example Typical role Budget allowance Hidden cost or limitation
LoRaWAN radio module MCU integration into custom node EUR 8–30 PCB, antenna, firmware, certification, production test
Development board Prototype and device development EUR 20–80 Not field enclosure; development power can be high
Simple indoor sensor Temperature, humidity, contact, occupancy EUR 40–150 Battery, mounting, calibration, network compatibility
Outdoor environmental node Weather, soil, tank, or farm monitoring EUR 120–800+ Probe quality, enclosure, solar/power, installation, maintenance
Industrial transmitter Metering, pressure, level, Modbus bridge EUR 150–1,000+ Certification, loop/interface, commissioning, vendor tooling
GNSS LoRaWAN tracker Asset/livestock/equipment tracking EUR 50–300 GNSS energy, antenna, reporting interval, enclosure, geolocation limits
Indoor multi-channel gateway Building/laboratory coverage EUR 100–400 Backhaul, antenna placement, power, remote management
Outdoor gateway Farm/campus/municipal infrastructure EUR 400–2,000+ Mast, antenna, surge/lightning, cellular plan, installation labor
Concentrator card Raspberry Pi/custom gateway RF core EUR 80–250 Host, antenna, enclosure, region, integration and support
Managed network service Network/application server operation Free community tier to recurring commercial fee Fair-use limits, SLA, users/devices/messages, support, data location

Representative ecosystem products include RAKwireless concentrator and gateway products, Dragino gateways and sensors, Seeed Studio LoRa/LoRaWAN development and tracker products, Milesight and TEKTELIC sensors/gateways, MultiTech industrial gateways, and modules based on Semtech radios or integrated MCU-radio devices. Product names do not guarantee TTN compatibility: verify region, LoRaWAN version, device profile, activation method, decoder availability, and certification.

The cheapest sensor is rarely the cheapest deployment. Total cost includes site survey, gateway infrastructure, installation, batteries, calibration, failed visits, data service, cybersecurity, replacement stock, and engineering time.

7.19   LoRaWAN GPS Trackers

A LoRaWAN tracker commonly combines a GNSS receiver, LoRaWAN radio, MCU, accelerometer, battery/power management, antenna system, and enclosure. GNSS often dominates energy because acquiring satellites and computing a fix takes time. Reporting every second is normally incompatible with LPWAN airtime, community fair use, and long battery life.

Practical strategies include:

  • motion-triggered acquisition and reporting;
  • adaptive intervals based on movement, geofence, battery, or risk;

  • local track storage with sparse LoRaWAN summaries;
  • sending position only after valid fix and reporting fix age/status;
  • transmitting significant change rather than every sample;
  • using network-assisted or alternative geolocation only with understood accuracy; and
  • defining behavior under indoor operation, canopy, multipath, theft, antenna obstruction, and gateway absence.

A tracker packet should include device identity through the network context, payload version, position or encoded delta, observation time or age, fix/quality indicator, battery state, and sequence. Never interpret the network receipt time as the position time after buffering.

In precision farming, trackers can support livestock location, machine utilization, implement tracking, worker safety, and asset recovery. LoRaWAN is appropriate for sparse state, not continuous high-rate trajectories or remote steering. Robot control should remain local and safe during network loss.

7.20   Deploying Sensor Nodes in the Real World

Successful field deployment requires more than network registration:

  1. define measurement, decision, sampling rate, reporting rate, latency, retention, and loss tolerance;
  2. survey radio coverage at the actual sensor height and season;
  3. select region-correct certified hardware, antenna, and network profile;
  4. calculate airtime, fair-use impact, energy, storage, and fleet load;
  5. protect electronics from water, condensation, UV, insects, fertilizer, vibration, theft, and animals;
  6. place the sensor representatively without letting enclosure or electronics bias the measurement;
  7. record physical asset ID, DevEUI, key custody, firmware, calibration, location, installation photograph, and date;
  8. test join, uplink, reset, battery replacement, network outage, and gateway failure;
  9. monitor freshness, frame-counter gaps, battery, radio quality, gateway diversity, and abnormal join attempts;
  10. plan inspection, cleaning, calibration, battery replacement, firmware update, and secure decommissioning.

Buried soil sensors and ground-level trackers can have far worse propagation than a handheld test node. Wet soil and vegetation absorb energy; metal enclosures and machinery detune or shadow antennas. Install and test the complete product, not a bare board with a laboratory antenna.


7.21   Applications and Limitations

LoRaWAN is well suited to small, infrequent messages over wide areas with battery-powered devices. Applications include environmental and soil monitoring, irrigation status, livestock and asset tracking, water/gas metering, leak detection, waste-bin state, parking occupancy, building monitoring, industrial alarms, cold-chain status, and infrastructure condition.

It is a poor fit for video, audio streaming, large files, frequent firmware delivery, continuous high-rate control, guaranteed low-latency actuation, or applications that require abundant downlink. Coverage can disappear; unlicensed spectrum is shared; payloads are small; data rates are low; joins and downlinks consume scarce resources; and battery claims depend heavily on reporting and radio conditions.

“Ten-year battery life” is not a property of LoRaWAN alone. It depends on battery chemistry and temperature, self-discharge, sleep current, sensor warm-up, GNSS use, message rate, spreading factor, retries, join behavior, receive windows, leakage, and aging.


7.22   Meshtastic Is Not LoRaWAN

Meshtastic is an open-source off-grid mesh communication system that uses LoRa radios to relay messages between compatible nodes [53]. It is valuable for human messaging, position sharing, telemetry, and experimentation without a LoRaWAN network server.

The architecture differs fundamentally:

Property LoRaWAN Meshtastic
Topology Star-of-stars through gateways and servers Decentralized multi-hop mesh behavior
Primary purpose Managed low-power IoT connectivity Off-grid messaging, position, and community telemetry
Infrastructure Gateway backhaul and network/application servers Compatible peer nodes; optional clients/gateways
Forwarding Gateways forward to centralized network logic Nodes may relay messages over radio
Provisioning/security LoRaWAN identities, activation, keys, counters Meshtastic channel and device configuration model
Capacity consequence Shared uplinks and scarce downlinks Relaying consumes additional shared airtime; dense meshes can congest
Interoperability LoRaWAN-certified/profiled ecosystem Meshtastic protocol ecosystem; not a LoRaWAN device join

A Meshtastic-compatible tracker using a LoRa radio is not therefore a LoRaWAN GPS tracker unless it separately implements and is configured for LoRaWAN. Do not assume the same firmware, frequency plan, or network service.


7.23   Exceptional Distance Records and Engineering Reality

The Things Network has reported a sequence of exceptional LoRa/LoRaWAN distance demonstrations: about 702 km in 2017 from a high-altitude balloon, 766 km in 2019, 832 km in 2020, and 1,336 km reported in 2023 between maritime equipment near Denmark and a gateway in the Canary Islands. The 2023 account reports three received messages, which is a demonstration of reception rather than a reliability estimate.

These demonstrations are technically interesting because they reveal what extreme line-of-sight, altitude, sea path, antenna, propagation, and sensitive radio configurations can achieve. They are not normal terrestrial design ranges and should not be used to promote customer coverage. Buildings, terrain, vegetation, antenna height, noise, legal power, and gateway density dominate ordinary deployment.

The phrase “world record” is promotional rather than a complete scientific category unless the rules, independent verification, payload validity, LoRa versus LoRaWAN protocol, power, antennas, altitude, path, frequency, and repeatability are specified. Treat records as case studies, not design requirements.

Block 415:00–15:50content

Block 4 · 15:00–15:50 · Designing and Deploying a Reliable LoRaWAN System

Embedded Linux Fall 2026.

7.24  Testing a LoRaWAN System

A complete test plan includes:

  • join success and time across resets, locations, and gateway availability;
  • frame-counter persistence, duplicates, replay rejection, and session renewal;
  • payload boundary values, decoder failures, schema evolution, and port behavior;
  • PDR, RSSI, SNR, data rate, gateway diversity, latency, and missing attempts;
  • ADR behavior for stable and mobile nodes;
  • confirmed versus unconfirmed traffic and downlink availability;
  • fair-use, duty-cycle, airtime, synchronized fleet, and congestion analysis;
  • gateway backhaul loss, process restart, power loss, thermal/storage condition, and failover;
  • integration credential rejection, MQTT/webhook outage, duplicate event, poison message, queue overflow, and recovery;
  • database backup, provenance, privacy, key rotation, device loss, and decommissioning; and
  • battery measurement across sleep, sensing, GNSS, join, transmit, receive windows, and retries.

7.25  Guided Laboratory: TTN-to-Private-Cloud Path

Laboratory objective
Register a multi-channel gateway and OTAA end device with TTN/The Things Stack, deliver a versioned compact payload to a private service, and demonstrate end-to-end identity, security, observability, and recovery. Trace one known sequence from physical node through gateway/network events and decoder to the stored record.

Part A—region and capacity. Document EU868 selection for the Danish laboratory, legal/network-policy sources, device profile, payload size, data rate, estimated airtime, message schedule, Fair Use impact, and fleet scenario.

Part B—gateway. Register the gateway EUI and ID, frequency plan, authenticated packet-forwarding connection, antenna, placement, and backhaul. Record live uplink metadata and prove multi-channel gateway operation.

Part C—OTAA device. Register unique identifiers and protected keys without including secrets in the report. Record MAC and Regional Parameters versions, profile, class, join attempts, join event, frame counter, and power-cycle behavior.

Part D—payload. Specify and encode a compact versioned payload. Write decoder tests for negative values, maximum/minimum, wrong length, unsupported version, missing status, and corrupted assumptions. Preserve decoder revision.

Part E—integration. Connect through restricted MQTT credentials or authenticated webhook. Validate identity/schema, store idempotently, expose bridge health and queue metrics, and isolate invalid data.

Part F—coverage. Measure known transmissions at multiple locations, heights, and orientations. Record successes and failures, gateway count, RSSI, SNR, data rate, latency, environment, and map coordinates where privacy permits.

Embedded Linux Fall 2026

Part G—fault injection. Test wrong key, wrong frequency plan through configuration only, unsupported schema, frame-counter/session reset behavior, duplicate integration event, gateway restart, backhaul loss, bridge restart, database outage, credential rejection, bounded queue, and recovery.

Portfolio evidence
Include architecture and trust-boundary diagrams, regional-plan justification, gateway bill of materials and placement, device/OTAA profile without secrets, airtime/fair-use calculation, payload dictionary and decoder tests, integration ACL/credential policy, coverage dataset and limitations, outage/recovery evidence, indicative deployment budget, maintenance plan, and one complete provenance trace.

7.26  Self-Assessment and Job-Interview Preparation

These questions support Module 7 and future interviews in LPWAN, IoT, embedded Linux, networking, precision agriculture, smart cities, and industrial monitoring. Strong answers distinguish standard behavior, provider policy, legal limits, and field evidence.

Questions

Q1. Distinguish LoRa, LoRa peer-to-peer, LoRaWAN, TTN, and Meshtastic.

Q2. Describe a LoRaWAN uplink from end device to private-cloud database.

Q3. Why can multiple gateways receive one uplink, and where is duplication removed?

Q4. Why must a deployment select a regional frequency plan rather than only “868 or 915 MHz”?

Q5. Explain the difference between legal duty-cycle limits and TTN Fair Use Policy.

Q6. Why are LoRaWAN downlinks scarcer than uplinks?

Q7. Compare OTAA and ABP and explain why OTAA is usually preferred.

Q8. Distinguish DevEUI, JoinEUI, DevAddr, root keys, session keys, and frame counters.

Q9. What failure occurs when counters or session state are reset incorrectly?

Q10. Compare Classes A, B, and C for energy and downlink latency.

Q11. When is ADR beneficial, and when may it be inappropriate?

Q12. Why should confirmed uplinks be used selectively?

Q13. What makes a multi-channel concentrator different from an end-device LoRa transceiver?

Q14. List the components and operational requirements of a Raspberry Pi LoRaWAN gateway.

Q15. Why is a single-channel receiver not a production LoRaWAN gateway?

Q16. A gateway appears connected in the TTN console but devices cannot join. Give a layered diagnosis.

Q17. A device joins once but fails after power cycle. What should be investigated?

Q18. What must a binary payload specification state?

Q19. Why must decoder version and original metadata be preserved with stored data?

Q20. Design an authorization policy for TTN MQTT integration and a private bridge.

Q21. What makes a LoRaWAN GPS tracker energy-intensive despite low-power radio?

Q22. Why is LoRaWAN inappropriate for continuous robot teleoperation?

Q23. Explain why the reported 1,336 km transmission is not a reasonable farm coverage assumption.

Q24. Compare a EUR 30 development board with a EUR 300 field node in terms of total deployment value.

Q25. Design a field-maintenance plan for 100 agricultural sensor nodes and two gateways.

Q26. What evidence is required to trace a stored temperature value back to the physical observation?

Embedded Linux Fall 2026

Answers and discussion

A1. LoRa is radio modulation; peer-to-peer uses it with an application-defined direct protocol; LoRaWAN is the standardized LPWAN network architecture; TTN is a community network using The Things Stack ecosystem; Meshtastic is a separate LoRa-based decentralized mesh protocol.

A2. The device creates an authenticated/encrypted LoRaWAN frame; one or more gateways forward copies over IP; the network server validates, deduplicates, and schedules MAC behavior; the application server processes application payload; MQTT/webhook emits an event; a bridge validates and stores it with provenance.

A3. End devices broadcast rather than associate with one gateway. Spatially diverse gateways can receive the same frame. The network server identifies and deduplicates copies while preserving gateway metadata.

A4. Regions differ in channels, masks, data rates, power, duty/dwell rules, and hardware front ends. “915 MHz” does not distinguish US915, AU915, and AS923 variants, and legal requirements remain national.

A5. Legal limits are imposed by regulators and apply to private and public networks. Fair Use is an additional provider/community policy controlling shared-service consumption. Leaving TTN does not remove law.

A6. Gateways share regulated airtime, common hardware often cannot receive while transmitting, Class A devices listen only after uplink, and downlinks can block many uplinks. Scheduling and duty rules constrain them further.

A7. OTAA joins and derives renewable session state, supporting better lifecycle. ABP installs session values directly and requires careful persistent counters and reprovisioning. OTAA still requires secure unique root-key provisioning.

A8. DevEUI is persistent device identity; JoinEUI identifies join context; DevAddr is a session/network address; root keys establish session security; session keys protect current traffic roles; counters help reject replay and order frames.

A9. The server may treat new frames as replayed and reject them, or insecure configuration may reopen replay risk. Correct persistence and new-session activation are required.

A10. Class A receives only after uplink and is most energy-efficient; Class B adds synchronized scheduled slots; Class C listens almost continuously for low latency and consumes much more power.

A11. ADR improves capacity and battery for stationary/stable devices with representative history. Mobility and rapidly changing links can make old link estimates inappropriate. It cannot fix antennas or absent coverage.

A12. Confirmations consume downlink, may trigger retries, and reduce network capacity. Use them only where delivery knowledge has sufficient value, and still deduplicate application effects.

A13. A concentrator receives multiple channels and spreading factors concurrently with suitable timing and RF architecture. An end-device transceiver typically handles one configured channel/modulation state at a time.

A14. Pi/host, region-correct concentrator/front end, antenna and short low-loss path, reliable power, storage, enclosure, Ethernet/Wi-Fi/cellular backhaul, packet forwarder, gateway identity/credentials, monitoring, secure management, updates, and outdoor surge/lightning measures.

A15. It hears only a narrow subset, misses traffic on other channels/settings, and cannot properly support network downlink scheduling. It creates misleading coverage and interoperability expectations.

A16. Check region and hardware, antenna/connectors, concentrator detection/reset, channel configuration, received uplink logs, gateway clock, packet-forwarder server/credentials, DevEUI, JoinEUI, root key, device profile, MAC version, join events, and receive-window/downlink scheduling.

Embedded Linux Fall 2026

A17. Investigate whether it attempts OTAA again or restores session, persistent frame counters/nonces, power stability, keys and byte representation, join backoff, firmware state, and whether server session/counter state matches.

A18. Schema version, exact byte positions and lengths, endianness, signedness, scaling, units, allowed range, missing/sentinel values, flags, port, compatibility, and invalid-input behavior.

A19. Decoder changes can change meaning without changing raw bytes. Metadata links the result to device, frame counter, radio path, time, gateway, and processing. Without both, historical correction and provenance are impossible.

A20. Give the bridge a unique restricted credential for one application and only required event topics; protect and rotate it; validate TLS/server identity; map authorized device IDs; separate read, write, and administrative roles; log access without secrets; and revoke independently.

A21. GNSS acquisition and tracking, antenna, motion sensing, MCU awake time, fix retries, and frequent desired positions can dominate. LoRaWAN airtime also prevents high-rate reporting, so adaptive sparse tracking is required.

A22. It has low data rate, shared and variable latency, scarce downlink, intermittent coverage, and no hard delivery guarantee. Safety and control loops remain local; LoRaWAN can carry sparse status or high-level requests.

A23. It relied on exceptional maritime/propagation geometry and does not reproduce ground-level fields with vegetation, terrain, buildings, interference, ordinary antennas, and required reliability. Records show physical possibility, not service coverage.

A24. The development board lacks field enclosure, power conditioning, certified integration, connectorization, calibration, installation, lifecycle, and support. The field node may reduce engineering visits and failure cost; compare total lifecycle rather than purchase price.

A25. Maintain asset/DevEUI inventory, keys and ownership, firmware/configuration/calibration, locations/photos, battery and inspection schedule, freshness/battery/gateway-diversity alerts, replacement stock, secure updates, seasonal coverage survey, gateway backhaul/power maintenance, incident procedure, and secure decommissioning.

A26. Preserve asset and sensor channel, calibration and firmware, observation time/status, payload schema/raw bytes, DevEUI/session/frame counter, gateway/radio metadata, network correlation IDs, decoder revision, integration event, bridge validation/version, and database transformation/record identity.

7.27  Authoritative References and Verification Links

Because specifications, regional rules, console workflows, service policies, products, and prices evolve, students should verify current information using primary sources:

Embedded Linux Fall 2026
Chapter summary
LoRaWAN is a standardized, secure-by-design LPWAN architecture built above LoRa-compatible radio, not merely a long-range serial link. End devices, multi-channel gateways, network/join/application servers, and integrations have distinct responsibilities and trust boundaries. Deployment success depends on the correct regional plan, rare downlinks, fair airtime, secure OTAA provisioning, counter continuity, compact versioned payloads, suitable device class and ADR policy, well-placed and monitored gateways, representative field testing, resilient cloud bridging, and complete provenance. Commercial prices and spectacular distance records are context, not substitutes for lifecycle cost and measured coverage. Meshtastic solves a different off-grid mesh problem and should not be confused with LoRaWAN.

Summary

This module introduces LoRaWAN as a complete low-power wide-area network architecture built above LoRa-compatible radio. It covers LoRaWAN architecture and packet flow, regional frequency plans, device activation and security, device classes, ADR, confirmed traffic, multi-channel gateways, Raspberry Pi gateways, gateway placement, The Things Network, OTAA end-device joining, payload encoding and decoders, MQTT/webhook integrations, private-cloud bridging, GPS tracking, real-world sensor deployment, testing, and LoRaWAN applications and limitations.

Course outline

What we will learn

From Linux foundations to physical interfaces, networking, security and a complete embedded system.

Linux foundationsKernel, users, processes and file systems
Command lineShells, scripting and automation
Embedded hardwareBoot, storage and device drivers
Physical I/OGPIO, sensors and actuators
Device busesUART, I²C and SPI
NetworkingTCP/IP, SSH and remote management
Distributed systemsMessage passing and cooperating nodes
Engineering practiceGit, testing, logging and deployment
SecurityLeast privilege, updates and secrets

Teaching method

Short introductions are followed by laboratory activities. Work is normally completed in teams of three. Each team develops an embedded Linux system; the examination portfolio is individual.

Project ideas

Applications you could build

Each project should begin with one reliable end-to-end function.

Automatic Raspberry Pi-based GPS trackerSample examination report available in PDF format
Environmental monitoring stationValidated sensing, local storage and dashboard
Energy monitoring systemMeasure, log and visualize equipment power use
Greenhouse automationClimate sensing, actuation and remote supervision
Field-robot telemetryLocation, operating state, measurements and faults
LoRaWAN sensor networkField nodes, TTN integration and private cloud
Intelligent irrigationSensing, decisions, valves and safe failure handling
Multi-node IoT gatewayProtocol translation, buffering and secure forwarding
ROS 2 communication systemDistributed nodes, QoS and service integration
Edge-AI monitoring systemLocal inference, measured performance and safe fallback

A complete project should demonstrate

NeedA clear user and purpose
Physical interfaceA sensor, actuator or device
Linux integrationPrograms, scripts or services
CommunicationA justified data-exchange method
ReliabilityLogging and failure handling
EvidenceTests, results and reflection

Contractor and client roles

Project groups

Each group develops a project for one client group and evaluates the project received from another contractor group.

Contractor

Heros

ProjectProject 01
Delivers to
Client not assigned
Receives from
Contractor not assigned

Fridays · four 50-minute slots · Odense

Fall 2026 lecture plan

The SDU timetable remains authoritative for dates, times and rooms.

Project progression

Project ideas and proposals begin in Module 1 and evolve throughout the course. Module 10 is the formal integration, architecture and verification review; Modules 11–12 complete implementation, demonstration and individual portfolio evidence.

Lecture 07 · participation

Student questions

Questions remain hidden until the student is called. Model answers are revealed separately.

Instructor classroom view

The roster, answers, attendance and participation records are available only to the authorized primary owner after sign-in.

Instructor sign in

Definitions

Essential course vocabulary

Plain-language definitions for the technical terms used throughout the course.

TermDefinitionExample
ActuatorA device that produces a physical action.Motor, valve, relay or fan
BootThe sequence that starts the hardware, kernel, services and applications.Starting an embedded computer
CLIA text interface that accepts commands.Windows Terminal or a Linux terminal
CommandAn instruction interpreted by a shell.pwd, ls or Get-Location
Device driverSoftware through which the operating system communicates with hardware.GPIO or camera driver
DirectoryA named container for files and other directories./home/student/eml
DistributionA complete operating system built around the Linux kernel.Ubuntu or Debian
Embedded systemA computer integrated into a larger product for a defined purpose.Greenhouse controller
File systemThe structure used to name, store and retrieve files.ext4
GPIOA configurable digital input or output pin.Reading a switch
I²CA two-signal serial bus for peripherals.Environmental sensor
KernelThe privileged core managing memory, processors, devices and processes.Linux kernel
MQTTA lightweight publish/subscribe messaging protocol.Sending sensor data
ProcessA running instance of a program.A data logger
PWMRapid switching used to control average power or a signal duty cycle.Motor speed
RootThe privileged Linux user or the top directory, depending on context.Administrative access
ScriptA file containing commands that automate work.A backup script
SensorA device that converts a physical quantity into data.Temperature sensor
ServiceA background program providing an ongoing function.SSH server
ShellA program that interprets commands and starts programs.Bash or PowerShell
SPIA synchronous bus commonly used for fast peripherals.Display or converter
SSHEncrypted remote command-line access.Managing a Raspberry Pi
TCP/IPThe principal protocol family used across computer networks.Device-to-server communication
UARTAn asynchronous serial interface.Debug console
User spaceThe environment where ordinary programs run outside the kernel.Application software
Version controlA system that records and manages file changes.Git

Official examination information · EKA T550077102

Individual portfolio examination

Form

Portfolio

Individual presentation portfolio submitted at semester end.

Grade

7-point scale

No second examiner.

Weighting

No split published

No separate written-exam or coursework percentages are stated.

Re-examination

Same form

Same form as the ordinary examination.

Team project and individual assessment

The team project creates practical evidence, but each student is assessed individually through the presentation portfolio. Classroom participation points support engagement and do not form part of the official grade.

Document from the beginning

  • Your own decisions and identifiable contribution
  • Commands, code, configuration and version history
  • Tests, results, failures and improvements
  • Reflection on trade-offs and learning

People and course systems

Contacts and official links