LoRaWAN devices can reach sensors kilometers away on a coin cell battery. But they don't talk to the cloud directly. They need a gateway and network server in the middle.
This tutorial shows you how to connect any LoRaWAN device to Blynk using LORIOT as the network server. Blynk and LORIOT recently partnered to make this integration path as smooth as possible. You'll set up a complete pipeline: your device sends data over LoRaWAN, LORIOT receives it, and Blynk turns it into a live dashboard you can check from anywhere.
The same pattern works for any LoRaWAN sensor. Temperature probes, soil moisture sensors, door contacts, water level monitors. The steps are identical. The only thing that changes is how you decode the payload, and we'll cover that too.
LoRaWAN Device → Gateway → LORIOT → HTTP Push → Blynk Data Converter → Dashboard
(your sensor) (radio) (network (webhook) (decodes payload, (see your
server) finds your device) data live)
Your device transmits a small packet over LoRaWAN radio. A nearby gateway picks it up and forwards it to LORIOT. LORIOT manages the network side (encryption, deduplication, device management) and pushes the raw payload to Blynk via HTTP.
The key piece is Blynk's Data Converter. It's a function that:
No custom server, no middleware, no MQTT broker to manage.
Before you start, make sure you have:
If you don't have a LORIOT account yet, you can sign up at loriot.io.
Templates define what a type of device can do in Blynk: what data it sends, how the dashboard looks, and what metadata it carries. A template is reusable. You create it once, then create as many devices from it as you need. If you have 50 smart buttons, they all share the same template.
Because of this, name your template for the device type, not the individual device. "LoRaWAN Temperature Sensor" or "Milesight WS101" works well. "Office front door sensor" doesn't, because that's a specific device, not a type.
Create the template:
Add a datastream:
Datastreams are the channels your device data flows through. We'll start with a single datastream that shows the raw payload from your device. You can add decoded datastreams later once you understand the payload format.
The Data Converter references datastreams by name, not by pin number, so the pin assignment doesn't matter for this integration. Just pick the next available one.
Add a metadata field:
Metadata lets Blynk identify which physical device sent each message. We'll use the devEUI as the unique identifier.
Build a simple dashboard:
This is your starting point. Once data is flowing, you'll see the raw hex payload from your device here. Later you can add more widgets for decoded values.
Now tell LORIOT where to send data. We'll configure this before the Data Converter so you have the full picture of what payload Blynk will receive.
When LORIOT sends data to Blynk, the payload looks something like this:
Two fields matter for our Data Converter:
The Data Converter runs inside Blynk every time an HTTP message arrives. No external servers needed.
In your template, go to Data Converter and select HTTP.
Paste this code:
How it works:
This is intentionally simple. It works for any LoRaWAN device. You'll see the raw hex string on your dashboard, which confirms the full pipeline is working. We'll decode the payload in Step 6.
Copy the Endpoint URL shown in the Data Converter page. You'll need it for the next step.
Go back to your LORIOT application output (from Step 2) and paste the Blynk Endpoint URL into the Target URL field.
Save the output. LORIOT will now push every uplink message from your device to Blynk.
Trigger your device. For a button, press it. For a sensor, wait for the next scheduled uplink (most sensors send every few minutes). Within a few seconds, you should see the raw hex payload appear on your Blynk dashboard.
For example, a Milesight WS101 Smart Button might show something like `01754BFF2E02`. That's the raw data from the sensor, hex-encoded. It doesn't mean anything to a human yet, but it means the full pipeline is working: device to gateway to LORIOT to Blynk.
Not seeing data? Check these common issues:
setDataStreamValue('Raw Payload', ..)must match your datastream name exactlyThe raw hex string on your dashboard confirms the pipeline works. Now you need to decode it into something meaningful.
Every LoRaWAN device encodes its payload differently. There's no universal format. A temperature sensor, a door contact, and a smart button all pack their data into hex bytes in their own way. To decode yours, you need to check your device's datasheet or payload documentation. Most manufacturers provide this, and many include example decoders.
Here's what to look for:
Let's walk through a real payload to show how decoding works. A Milesight WS101 Smart Button sends a payload like `01754BFF2E02`. That encodes two readings: 75% battery and a long press event. The exact byte structure is in the device's payload documentation.
The part we care about is the button event. The hex signature `FF2E` means "button event," and the byte after it tells you the press type: `01` = short, `02` = long, `03` = double.
To decode this in Blynk, update your Data Converter. This is Anthony's original decoder for the WS101:
Note: this uses a datastream named "Smart Button" (String type). If you followed the generic setup in Steps 1-5, rename it in the code to match your datastream, or add a new one.
Now your dashboard shows "Long Press" instead of raw hex.
The structure is always the same:
Tip: Most Milesight sensors use the same channel/type/value encoding shown above. The Milesight IoT [payload decoder repository](https://github.com/Milesight-IoT/SensorDecoders) has decoders for all their devices. Other manufacturers typically provide equivalent resources.
You've got a working LoRaWAN-to-Blynk pipeline. Here's how to make it more useful:
Set up notifications. Go to Automations in Blynk and create a rule based on your decoded datastreams. For example: "When Battery drops below 20%, send me a push notification." Or "When Temperature exceeds 30C, send an email."
Add more sensors. The pattern is the same for any LoRaWAN device on LORIOT. Create a new template, add datastreams for the sensor's readings, write a payload decoder, and connect it. You can run dozens of sensors through the same LORIOT-to-Blynk pipeline.
Build a mobile dashboard. Download the Blynk app (iOS / Android) and you can monitor your devices from anywhere. The mobile dashboard syncs automatically with what you've built on the web.
Try a Blueprint. If you want to skip the manual setup next time, check the Blynk Blueprint library for ready-made templates you can use with LoRaWAN sensors.