LogoLogo
  • KPN THINGS USER GUIDE
    • Introduction
    • Getting started
      • Registration and setup
      • Device simulator app
      • Connect devices
        • SIM cards
        • Supported devices and KPN Devices
        • SODAQ R412M
        • Smartrak
        • Marvin development board
        • LoPy5
        • Arduino MKR WAN 1300/1310
        • Arduin MKR NB 1500
    • All videos
    • Tutorials
      • Configure a flow
      • Connect a HTTPs destination
      • Create a simple IoT web applicationPage
      • Send instruction to LoRa DevicePage
      • Send your data to Azure SQL
      • Technical overview
        • Management data model
        • Uplink communication
        • Downlink communication
        • Location data
      • Accounts and projects
        • Customer accounts and users
        • Projects
        • Customer management
        • Cost overview and contract
    • Frequently asked
      • Multi Factor Authentication
  • GENERAL FUNCTIONS
    • Quick reference videos
    • APIs
  • THE PORTAL EXPLAINED
    • Things Manager
      • Devices
        • Bulk operations
      • Data
        • Device data graph
      • Connectivity
        • LoRa connectivity configuration
      • Bulk reports
    • Things Creator
    • Support
      • News
      • Release notes
      • Real-time status
      • Service reports
      • Documents
      • Support tickets
      • Invoices
      • Contact info
    • Shop
  • BUILDING BLOCKS
    • Devices
      • Sensors
        • KPN Conditionsensor CO2 II
        • KPN Conditionsensor CO2 III
        • KPN Conditionsensor CO2 III motionPage 1
        • KPN FillTag I
        • KPN FillTag II
        • 1M2M ED1608
        • Elsys ERS
        • Device Simulator (Mobile Phone app)
        • Generic Device (Internet connected)
        • Generic LoRa device (preset connectivity)
        • Generic LoRa device (programmable)
        • Generic M2M device
        • Generic M2M device (with Internet connection)
      • Trackers
        • KPN Global Tracker Autonomous
        • KPN Global Tracker Wired
        • KPN LocationTag I
        • KPN LocationTag II
        • KPN LocationTag II v2
        • KPN LocationTag II v2 Expert Mode
        • KPN LocationTag II v3
        • KPN LocationTag III (with GPS)
        • KPN LocationTag III (without GPS)
        • KPN LocationTag III v2
        • KPN LocationTag III v2 Buffer
        • KPN LocationTag III v3
        • KPN LocationTag III v4
        • KPN LocationTag V
        • KPN LocationTag VI
        • KPN LocationTag WS
        • Streamline LoRa
        • Streamline M2M
        • Viloc
      • Routers
      • Gateways
        • KPN FSK Basestation
      • Device SDK
    • Connectivity
      • Connecting LoRa devices
        • LoRa connectivity configuration
      • Connecting M2M devices
      • Connecting Internet devices
      • Connecting MQTT Devices
    • Data Processing
      • ThingsML and SenML
        • ThingsML
        • SenML
          • Understanding and Interpreting SenML Data
          • Changes in KPN SenML
      • Device Twin
      • Decoders and encoders
        • Common measurements list
        • Decoder migrations
        • DIY Decoder
          • DIY decoder scripts
      • Merger
      • Device data
      • Devices
    • Destinations
      • HTTPS destination
      • MQTT broker
      • Cumulocity IoT Platform
      • Azure Event Hubs
      • Azure IoT Hub
      • Test Endpoint
      • ThingsBoard
      • Datacake
      • AWS Lambda
      • Google Cloud Run functions
  • IOT LINE UP
    • Freemium
      • Test SIM cards
    • Explorer
    • Modular
    • Tailored
    • Terms and Conditions
Powered by GitBook

© 2024 KPN - All rights reserved.

On this page
  • 1. Setup your Marvin
  • Setup your Arduino environment
  • Test your Marvin device
  • Test the LoRa module on the Marvin
  • 2. Register your Marvin to KPN Things
  • Open the KPN Things Portal
  • Fill in your device information
  • Provide Network Information
  • Check your newly created Device
  • 3. Program your device to send a LoRa message
  • Download the ThingsML library
  • Make a sketch
  • Run the sketch
  • 4. Check incoming data in the Portal
  • Setup data flow in KPN Things

Was this helpful?

Export as PDF
  1. KPN THINGS USER GUIDE
  2. Getting started
  3. Connect devices

Marvin development board

PreviousSmartrakNextLoPy5

Last updated 4 months ago

Was this helpful?

This is an old development board which is no longer available for purchase and should not be used for new designs.

Marvin is the fastest start with LoRa and the Internet of Things. It’s the perfect introduction to IoT for your organization, and is also used in education. Marvin uses its LoRa connectivity to connect to the internet from anywhere in the world where there is LoRa coverage.

1. Setup your Marvin

This part of the getting started is based on the .

Setup your Arduino environment

  • Download the and follow the installer. We'll use it later on to program the Marvin.

  • Connect your Marvin to your computer.

Test your Marvin device

We will now test whether the Marvin device is working by letting a LED blink.

  • Download and open it in the Arduino IDE, or copy-paste the code into an empty Arduino IDE sketch.

  • From the Tools menu, under Board, select Arduino Leonardo

  • Also from the Tools menu, under Port, make sure the correct COM port is selected. If you have multiple options, select the one stating Arduino Leonardo. If non of your ports is labelled that way, disconnect your Marvin, reopen the menu, check which COM port disappeared, reconnect the Marvin and choose the previously identified COM port.

  • From the Sketch menu, click Upload to send the software to the Marvin. If all went well it will say Uploading complete in the bottom of the Arduino IDE and the second LED on the Marvin board will blink!

Test the LoRa module on the Marvin

The LoRa connectivity on your Marvin device is managed by the Microchip RN2483 module. With the following steps we check whether this module works correctly.

  • Upload the sketch to your Marvin.

  • Meanwhile, from the Tools menu, open the Serial Monitor

  • In the Serial Monitor, set the baud rate to 57600 baud (same as detailed in the sketch) and select Both NL & CR (#1 in the screenshot below).

Now you can directly speak to the LoRa module and get a response! #2 in the screenshot above shows you where to enter commands you want to send, and #3 highlights where answers from the module will be shown.

  • If you for instance send sys get ver, the module will return its firmware version back. This will be 1.0.1 with some historic date.

  • Now execute the command sys get hweui to retrieve the DevEUI that is stored in the module. Store the value in a text file. You'll need it when adding the device to KPN Things.

2. Register your Marvin to KPN Things

Open the KPN Things Portal

Fill in your device information

  1. Select the Own LoRa device (preset connectivity) device type

  2. Enter a name for your Marvin device

  3. Click Add Device to continue

Provide Network Information

  1. AppEUI: you can use the following value: 0059AC00000FFFFF

Store these three values somewhere, because you will be needing them to program your device later on.

4. Click Add Network Info to save the network information and then Finish to continue.

Check your newly created Device

You are now on the Device Detail Page. In the LoRa tab you will see the network status. This can temporarily be Pending creation, but if you refresh the page it should switch to Active. This means your device is correctly registered to the network.

If the Network Status ended up in Failed, something has gone wrong. Most likely the DevEUI is already registered through another application like Thingpark or the LoRa Developer Portal. Please make sure you remove the device registration from the other application and re-add the device in the Things Portal. For more information consult our FAQ.

3. Program your device to send a LoRa message

Download the ThingsML library

  • From the Tools menu in your Arduino IDE click on Manage Libraries...

  • Now, in the Library Manager, search for ThingsML and click Install. When the installation is finished, click Close.

Make a sketch

From the File menu, click on Examples.

  • Now find ThingsML, then select marvin, and within that choose marvin_example, as such:

  • A sketch will open. Now update the values for the variables DevEUI, AppEUI, and AppKey in the code with the values you entered earlier in the Portal.

Run the sketch

  • Upload the sketch to your Marvin and open the Serial Monitor. You will see a lot of commands being send to the LoRa module to configure it and to join the network. At some point you will see the following:

> mac join otaa
< ok

This means your Marvin is trying to join the network. After some seconds the following line will appear

< accepted

This means the device has joined our network!

If you see denied instead of accepted , move closer to your window or walk out into the garden to improve reception from the LoRa network. Then disconnect and reconnect the Marvin to your computer. You probably need some more coverage to be able to join the network.

After joining, your Marvin will send a message every 30 seconds containing an empty temperature measurement in ThingsML format. Read more about ThingsML.

4. Check incoming data in the Portal

Now your Marvin has joined and is sending data, you could visit the LoRa Data tab on your Device Detail Page in the Portal. You should see your Join request and Join accept appear like in the screenshot below and at this point you will see more data as well. Learn more about LoRa data history.

Setup data flow in KPN Things

You now successfully connected your Marvin device to KPN Things! To further setup your data flow in KPN Things, you can go to the next step:

Download and open it in the Arduino IDE, or copy-paste the code into an empty Arduino IDE sketch. With this program we can communicate directly with the LoRa module.

Possible other commands can be find in the module or in .

Open the . Go to the All Devices page and click on Add new Device.

DevEUI: the value you retrieved from the LoRa module in the step .

AppKey: Every device should have its own unique AppKey, since it is the root security key of your device. You can generate a unique AppKey here:

If the network status sticks to Pending creation, you could try to delete the Device and and provision again (Restart at step ).

MarvinMultiSerial.ino
data sheet
one of the many
examples
by others
KPN Things Portal
https://www.loratools.nl/#/keys
Test the LoRa module on the Marvin
Register your Marvin to KPN Things
Getting Started by the IoT Academy
Arduino IDE
blinky.ino