LoRaWAN Fundamentals · Manufacturing & Process Plants

How to Configure a LoRaWAN Sensor: DevEUI, AppEUI and AppKey

LoRaWAN
How to Configure a LoRaWAN Sensor: DevEUI, AppEUI and AppKey

How to Configure a LoRaWAN Sensor: DevEUI, AppEUI, AppKey and the Settings That Matter

Configuring a LoRaWAN sensor is two jobs. First, register its identity on your network server, using three values the sensor ships with: the DevEUI, the AppEUI (also called JoinEUI) and the AppKey. Second, set how the sensor behaves: frequency band, device class, ADR, reporting interval and alarm thresholds. With a sensor that supports QR onboarding and a Bluetooth configuration app, the whole job takes under ten minutes per device.

JobWhere you do itWhat you set
Register the identityNetwork server (ChirpStack, The Things Stack or a vendor cloud)DevEUI, AppEUI/JoinEUI, AppKey, frequency plan, LoRaWAN version
Set the behaviourOn the sensor, via its app or downlinksBand, class, ADR, confirmed messages, heartbeat interval, sampling, thresholds, device name
Confirm it worksBothJoin accepted, first uplink decoded, signal strength checked at the mounting point

The rest of this guide explains the three keys once, then walks through the setup with a Macnman sensor and the Maya app.

The Three Keys, Explained Once

Every LoRaWAN sensor is identified by two EUIs and protected by one key. Get the three right and the sensor joins; get one wrong and it never does.

ValueWhat it isFormatWho sets itWhere it goes
DevEUIThe sensor’s unique hardware identity, like a MAC address64-bit, written as 16 hex charactersThe manufacturer, fixed at the factoryNetwork server, to identify this device
AppEUI / JoinEUIIdentifies the join server or application the device belongs to. Two names for the same field: older specs say AppEUI, LoRaWAN 1.0.4 and most servers now say JoinEUI64-bit, 16 hex charactersThe manufacturer (often the same for a batch); can be all zeros on some networksNetwork server, alongside the DevEUI
AppKeyThe 128-bit secret that proves the device is yours. Used once at join to derive the session keys that encrypt all traffic afterwards128-bit, 32 hex charactersThe manufacturer, unique per deviceNetwork server, and never anywhere else

The DevEUI and AppEUI are identifiers; you can print them on a label. The AppKey is a secret; treat it like a password. Anyone with your AppKey and DevEUI can register a device that impersonates yours.

OTAA vs ABP

Those three values are for OTAA (Over-The-Air Activation): the sensor sends a join request, the server checks the AppKey, and both sides derive fresh session keys. Every join produces new keys, which is why OTAA is the standard for production.

ABP (Activation By Personalisation) skips the join. You pre-load the device address and both session keys into the sensor and the server by hand. It works without a join accept, which is handy on a bench, but the keys never rotate and frame-counter resets cause trouble. Use OTAA unless you have a specific reason not to.

Where the Keys Come From

Reputable sensors ship pre-provisioned: the keys are generated at the factory, unique per device, and shown on a label, a QR code, or in the configuration app. You should never have to type a 32-character key by hand.

On a Macnman sensor, open the Maya app, connect to the sensor over Bluetooth, and go to Key & Identity. The screen shows the DevEUI, AppEUI and AppKey as text you can copy, and as a QR code that LoRaWAN servers can scan to fill the form automatically. Under Advanced Options you can regenerate the keys, which is worth doing when a device changes hands or when the deployment is security-sensitive; remember that the server registration must be updated to match.

The keys are also in the Maya app’s export, so a fleet can be registered in bulk without opening each device.

Step-by-Step: From Box to First Reading

This sequence works for any OTAA sensor; the screen names are from the Maya app.

Step 1: Register the sensor on the network server

Two ways:

  • QR code. On The Things Stack or any server that supports QR onboarding, choose “Scan end device QR code”, open Key & Identity in Maya, and scan. The DevEUI, JoinEUI and AppKey are filled in for you.
  • Manual entry. Create a device in your application, copy the three values from Key & Identity and paste them into the matching fields. Pick the frequency plan (IN865 for India) and the LoRaWAN version (Macnman sensors run LoRaWAN 1.0.4; in ChirpStack that lives in the device profile, with the matching regional parameters revision).

ChirpStack’s form is covered click by click in How to Connect a LoRaWAN Sensor to ChirpStack; the Maya documentation has the TTN and ChirpStack steps side by side under LNS Registration.

Make sure a gateway on that server is online and in range before you go further; a sensor can’t join a network it can’t hear. See Do I Need a Gateway for LoRa?

Step 2: Connect to the sensor over Bluetooth

Open the Maya app, pick the sensor from the scan list, and connect. The sensor’s LED turns solid blue while the app is connected. Set the Device Name here too (up to 20 characters; something like TH_ColdRoom2 beats the serial number when you have fifty devices on a dashboard).

Step 3: Set the LoRaWAN settings

In the app’s LoRaWAN Settings:

SettingWhat to choose for a battery sensor in India
FrequencyIN865. The band must match the server’s frequency plan and the gateway’s region; a sensor on EU868 will never join an IN865 network. See LoRaWAN in India: IN865 and WPC Rules.
ClassClass A for battery devices. Class C only for mains-powered units that must react to downlinks instantly (controllers, relays).
ADROn. The network picks the lowest spreading factor the link supports, which saves battery and airtime.
Custom Spreading FactorOff when ADR is on. Turn it on to fix the SF by hand for a sensor on a vehicle, a known-poor link, or a range test.
Confirmed MessagesOff for routine readings. On only for critical alarms, because each acknowledgement costs airtime and battery.

Step 4: Set the reporting behaviour

In Basic Settings and Data Sampling & Uploading:

  • Heartbeat is how often the sensor reports, whether or not anything changed. 15 minutes is a sensible starting point for most monitoring; 5 minutes for cold rooms and process lines; 60 minutes for ambient logging. The battery cost of each choice is in How Long Do LoRaWAN Sensor Batteries Last?
  • Sampling lets the sensor take several readings and send them in one uplink: set a sample count and a gap, for example 12 samples 5 minutes apart, and the sensor transmits once an hour with all twelve readings inside. You get 5-minute resolution at hourly airtime and battery cost.
  • Triggers set the thresholds (a temperature above or below a limit, say) that make the sensor send an alarm immediately rather than waiting for the next heartbeat. Set a sensible hysteresis so a reading hovering at the limit doesn’t send an alarm every minute.

Step 5: Watch it join

Once the keys are on the server and the sensor is powered, it starts a join. The LED blinks green slowly while it tries. On the server, the device page shows the join request, the join accept and then the first uplink. If the Maya app is still connected, Send Uplink forces a transmission so you don’t have to wait for the next heartbeat.

If nothing appears after a couple of minutes, go to the mistakes list below before changing anything.

Step 6: Decode the first uplink

A joined sensor sends bytes; the server needs a decoder to turn them into temperature: 24.35. Macnman publishes one per product in the LoRa Module SDK; paste it into the device profile (ChirpStack) or payload formatter (TTN). How decoders work, and what the wrong values mean, is in LoRaWAN Payload Decoder for Temperature Sensors.

Step 7: Check the signal where the sensor will live

A sensor that joins on the desk may not report from inside a rack or cold room. Take it to the mounting point and check RSSI, SNR and spreading factor in the app’s Network Health screen before fixing it to the wall. Thresholds and fixes are in Built-In LoRaWAN RF Testing for Right-First-Time Installs.

The Settings Cheat-Sheet

Starting values for a battery temperature and humidity sensor on a private IN865 network. Adjust once you’ve seen a week of data.

SettingStart withChange it when
Frequency bandIN865Never, in India
ActivationOTAAOnly for bench tests with no join server
ClassAMains-powered device needing instant downlinks → C
ADROnMobile sensor or deliberate range test → Off with fixed SF
Spreading factorADR-managedFixed at SF10–SF12 for a sensor the gateway barely hears
Confirmed messagesOffAlarm-only devices where every event must be acknowledged
Heartbeat15 min5 min for cold chain and process alarms; 60 min for ambient logging
Sampling12 samples × 5 min, or offWhen you need fine resolution without frequent uplinks
ThresholdsSet per application, with hysteresisWhenever the SOP’s limits change
Device nameLocation + functionOn relocation

Why a Sensor Doesn’t Join: The Usual Suspects

In order of how often we see them on support calls.

  1. A key is wrong by one character. Copy and paste from the app or scan the QR code; never retype. Check the server shows exactly what Maya shows.
  2. Byte order. Some tools display EUIs least-significant-byte first; ChirpStack and The Things Stack expect most-significant-byte first. If the DevEUI on the server reads backwards compared with the app, the join will fail silently. Copy the values as the Maya app shows them.
  3. Wrong frequency plan. The device is on IN865, the server application or gateway is on EU868 or AS923, or the sensor was ordered as the wrong regional variant. All three must agree.
  4. LoRaWAN version mismatch. A device profile set to LoRaWAN 1.1 for a 1.0.4 sensor, or the wrong regional parameters revision, can reject the join. Match the datasheet.
  5. No gateway in range, or the gateway isn’t connected to this server. A gateway on someone else’s server will hear the join request and ignore it.
  6. Keys regenerated on the device but not updated on the server, or the same keys registered twice on two applications.
  7. Join request heard, no accept received. The gateway hears the sensor but the sensor can’t hear the gateway’s reply, usually because the sensor is at the edge of range or the gateway’s downlink antenna is poor. Move closer to confirm, then fix the gateway placement: see the placement guide.
  8. Device sat unregistered too long. A sensor that fails many joins backs off, by design, to as little as one attempt every few hours. Power-cycle it once the server is ready.

Changing Settings After Installation

You don’t have to climb back up a pole to change an interval.

  • Over the air. Macnman sensors accept downlink configuration commands from the server for intervals, thresholds and similar settings. A Class A device picks them up at its next uplink; a Class C device applies them immediately.
  • Over Bluetooth. Any change can be made on site in the Maya app, and the LED gives a single red blink when a parameter is written.
  • Firmware. Signed over-the-air firmware updates go through the app; the LED flashes blue during an update.
  • Reset. The app can reset a device to factory settings when it is redeployed; regenerate the keys at the same time if it is changing owners.

Keep the Keys Safe

The AppKey is the only secret in the system.

  • Don’t paste AppKeys into tickets, chats or spreadsheets that are shared beyond the people who register devices.
  • Regenerate keys when a device changes hands, and register the new ones before the old ones are deleted from the server.
  • Use the app’s device-sharing controls so site staff can read live values without being able to change network settings.
  • If a device goes missing, delete its registration on the server; without that, a found device can still join.

Configure Once, Deploy Many

Macnman designs and manufactures LoRaWAN sensors in India for the IN865 band, and every one ships pre-provisioned with unique keys, QR onboarding and Bluetooth configuration through the Maya app, so registration is a scan rather than a typing exercise.

Starting a pilot? Tell us your server (ChirpStack, The Things Stack or another) and we’ll ship the devices with a key export ready to import, or pre-register them on your server for you: get in touch. The pilot kit includes sensors and a gateway configured to join each other out of the box.

Frequently Asked Questions

How do you configure a LoRaWAN sensor?
Register its DevEUI, AppEUI (JoinEUI) and AppKey on your network server with the right frequency plan, then set the sensor’s band, class, ADR, reporting interval and alarm thresholds through its configuration app or downlinks. Power it on, confirm the join and the first decoded uplink, and check signal strength at the mounting point.

What is a DevEUI?
A 64-bit identifier, written as 16 hex characters, unique to each LoRaWAN device and fixed at the factory. It identifies the device to the network server, much like a MAC address identifies a network card.

What is the difference between AppEUI and JoinEUI?
They are the same 64-bit field. Older LoRaWAN versions called it AppEUI; LoRaWAN 1.0.4 and most current servers call it JoinEUI. It identifies the join server or application the device belongs to.

What is an AppKey?
A 128-bit secret, written as 32 hex characters, shared between the device and the network server. It’s used during the OTAA join to derive the session keys that encrypt all later traffic. It’s the one value that must be kept private.

Where do I find a sensor’s DevEUI and AppKey?
On its label or QR code, or in its configuration app. Macnman sensors show all three values, and a scannable QR code, under Key & Identity in the Maya app.

Should I use OTAA or ABP?
OTAA. It derives fresh session keys at every join and is what production networks expect. ABP pre-loads fixed session keys and skips the join; it’s useful on a bench but less secure and prone to frame-counter problems.

Should ADR be on or off?
On, for stationary battery sensors. The network then assigns the lowest spreading factor the link supports, saving battery and airtime. Turn it off, with a fixed spreading factor, for sensors that move or for range tests.

Should I use confirmed uplinks?
Not for routine readings. Each confirmation costs airtime and battery, and a missed reading is replaced by the next one. Reserve confirmed messages for alarm events that must be acknowledged.

What reporting interval should I set?
15 minutes suits most monitoring. Use 5 minutes for cold rooms and process alarms, and 60 minutes for ambient logging. Add threshold alarms so the sensor reports immediately when a limit is crossed, whatever the interval.

Why won’t my LoRaWAN sensor join?
Usually a mistyped key, reversed byte order, a frequency-plan mismatch between sensor, gateway and server, a LoRaWAN version mismatch in the device profile, or no gateway in range on that server. Check those in order before changing anything else.

Can I change settings after installation?
Yes. Intervals and thresholds can be changed by downlink from the server (applied at the next uplink for Class A) or on site over Bluetooth, without removing the sensor.

On this page

WhatsAppLinkedInEmail
products image macnman
Got an IoT idea?

Let’s bring it to life!

Let‘s Make it Easy

Reach Out Now

Icon

Contact to Sales

Talk to our friendly team

chat@macnman.com
Icon

Call Us

24 X 7 Always On

+91 7972856163
Icon

Contact to Support

We are here to help

support@macnman.com
Icon

Visit Us

Visit our office HQ

View on Google Map

Socials

LoRaWAN

4G IoT

WiFi Ble IoT

Nb IoT

Customize

Maya

Documentation

Case Studies

Blogs