Skip to main content

Getting Started with LoRaWAN and Zafron

In this tutorial we'll walk through connecting a LoRaWAN device to Zafron using The Things Network.

Requirements​

  • A LoRaWAN device
  • The Things Network commercial or sandbox account
  • Zafron account

Creating a Source​

  1. Log in to your Zafron account.
  2. Click on Sources in the top header.
  3. Click on Create Source.
  4. Input a name and select TTN as the provider.
  5. Click on Create Source.
  6. Copy the URL provided.

Create Source

Create a Webhook in The Things Network​

  1. Log in to your The Things Network account.
  2. Click on Applications in the top header.
  3. Click on your application.
  4. Click on Integrations.
  5. Click on Add Integration.
  6. Select Webhook.
  7. Paste the URL from Zafron.
  8. Select Uplink as the message type.

Create Webhook

Add the Device​

  1. Click on Devices in the top header, then Add Device.
  2. Choose LoRaWAN.
  3. Pick your device model. Models in the supported devices list come with a decoder, so readings arrive named and with units. If your device isn't listed, choose Custom (CayenneLPP); this needs a profile, so create one first (Custom devices).
  4. Keep the name Zafron picked or type your own, enter the device's DevEUI (printed on the label or box; spaces and colons are fine), and select the source you created.
  5. Click Add device.

Watch It Connect​

After adding the device, its page shows a setup checklist until the first reading arrives:

  • Source is receiving packets: turns done once your network server has sent anything to the source.
  • Decoder ready: the catalog decoder, or your profile's decoder for custom devices.
  • Registered in your network server: make sure the device exists in your TTN application with the same DevEUI. Use the Copy button to copy it.
  • First uplink: power on the device. It usually reports within a few minutes, and the page updates by itself.

Send Data​

  1. Send data from your LoRaWAN device.
  2. Check the dashboard in Zafron to see the data.

Dashboard

Custom Devices​

Devices that aren't in the supported devices list still work. When adding one, choose Custom (CayenneLPP) and pick a profile. A profile holds the decoder shared by devices of the same kind:

  1. Click Profiles in the top header, then New Profile.
  2. Input a name, select your source, and click Create Profile.
  3. Open the profile's Schema tab and choose CayenneLPP (no code needed if your device sends Cayenne Low Power Payload) or Custom (write a decoder in JavaScript).
  4. Back in Devices → Add Device → LoRaWAN, choose Custom (CayenneLPP) and pick that profile. Then continue from the name, DevEUI and source step.