This guide demonstrates how to get your MultiConnect® Conduit™ connected to scriptr.io, and visualize your mDot™ Box data on online dashboards. It is aimed to get the MultiConnect® Conduit™ IoT Starter Kit for LoRa® Technology users started with scriptr.io in just a few minutes, and jump start their development process.

In this article,  you will learn how to configure the MultiConnect® Conduit™ to forward incoming data to scriptr.io using a Node-RED app. If you prefer a visual guide, check out the video tutorial on our YouTube channel: https://youtu.be/DWdibpfoPcA

Pre-requisites

Hardware

Software

  • A scriptr.io account pre-loaded with the MultiTech apps: you can register for free using the following URL: https://www.scriptr.io/register?promocode=mtstarterkit.
  • A DeviceHQ account: sign-up to DeviceHQ so you can install the scriptr.io Node-RED app on the Conduit™. When  you sign up, make sure to register your device by going to Tasks > Register Device in the Devices page. It will prompt you to enter your device’s Serial number and UUID which you should find on the bottom of the device.

Recipe: Step by Step

  1. Registering for a free scriptr.io account with the mtstarterkit promo code

    Navigate to https://www.scriptr.io/register?promocode=mtstarterkit and follow the registration instructions to register to scriptr.io using the mtstarterkit promotion code. This will automatically install the MultiTech Asset Tracking app on your account.

  2. Setting Up Your MultiConnect® Conduit™

    The following assumes that the LoRa MultiConnect® mCard™ is already installed on the conduit. If not, please check this guide from MultiTech.

    2.1. Setting Up the Ethernet Network

    1. Connect your conduit to the network using an ethernet cable.
    2. The conduit will be accessible on a default IP address (192.168.2.1). You might need to manually change your IP to something on the same network (192.168.2.2/255.255.255.0) in order to proceed, in case your network is on a different subnet.
    3. Access the admin interface using that IP and go to Setup -> Network Interfaces where you will be able to configure the network on the conduit to fit your existing network requirements:
      1. The ethernet port we’re trying to configure is eth0, click the edit button on the right.
      2. Configure appropriately (easiest might be to set it to DHCP if your network allows that).
    4. Access the admin interface using the new IPs (either manually provided or from the DHCP) and confirm that you can still access the MultiConnect® Conduit™ under the new address:

    lora-blog-eth0-conf

    2.2. Setting Up the LoRa Network

    Setting up LoRa on the conduit is all done from the admin interface, under LoRaWAN:

    1. Under the LoRaWAN section on the left panel, go to Network Settings
    2. Set the LoRa Mode to “Network Server”
    3. Select the appropriate Channel Plan based on your hardware and current location (US915 in this example)
    4. Set the Frequency Sub-Band to 1
    5. Click Submit to save your changes
      LoRaWAN Networking
    6. From the left-side menu, navigate to Key Management
    7. Set the Network ID to Name
    8. Set the Name to MultiTech
    9. Set the Network Key to Passphrase
    10. Set the Passphrase to MultiTech
    11. Click Submit to save your changesKey Management
    12. You will be prompted to restart the LoRa services, click restart, then click the Save and Restart red menu item from the left menu and wait for the Conduit™ to finish rebooting

    For more information on getting the mDot™ Box connected to the Conduit, refer to this article by MultiTech.

  3. Sending Data from the MultiConnect® Conduit™ to Scriptr.io

    In this step, we will explain how you can start forwarding the data to a scriptr.io MQTT endpoint by installing and configuring a Node-RED client app on your MultiConnect® Conduit™.

    3.1. Installing the scriptr.io client on your MultiConnect® Conduit™

    To forward data to scriptr.io, you need to install the scriptr.io Node-Red client app on your MultiConnect® Conduit™ from the DeviceHQ store by following the below steps. Note, however, that if you don’t have a DeviceHQ account, please follow the instructions found here.

    1. Sign-in to your Device HQ account
    2. Click Store
    3. Click Public Apps and search for scriptr.io
    4. Select scriptr.io_simple_client from the resulting list
    5. Click Add to My Apps
    6. Confirm the action and accept the GPL license agreement
    7. Click Devices and select your device
    8. Click Tasks
    9. From the list, pick Install App
    10. From the Name drop-down, select scriptr.io_simple_client
    11. Click Schedule App Install
    12. Wait for the confirmation dialog to appear (“Confirm app install”) then click OK to confirm the installation. The installation will occur on the next check-in, i.e. the next time the Conduit™ checks in with DeviceHQ. If you don’t want to wait, you can manually check-in by clicking the Check-In To DeviceHQ button under Administration > Remote Management. Note that you will need to have the Remote Server option enabled for the Conduit™ to connect to DeviceHQ:
      conduit-remote-management

    3.2. Configuring the scriptr.io client

    In this step, you will configure the Node-RED app to know to which scriptr.io account to forward the data to. In other words, you need to specify the scriptr.io authentication token to be used by scriptr.io to identify the device and the account it belongs to.

    1. Double-click the config node to edit it. In the editor that opens, set the value of the auth_token variable to the myDevice token which you can retrieve from your scriptr.io Workspace as described next:
      1. Go to your scriptr.io Workspace
      2. Click your user icon on the top-right corner, then click Device Directory
      3. Click the copy button corresponding to the myDevice device to copy its token to your clipboard
        myDevice-token
      4. Paste this value in the config node’s editor in Node-RED as the value of the auth_token variable
    2. Click the Done button to close the “Edit function node” editor
    3. Once done, click the Deploy button for your changes to take effect

    After the Node-RED app is installed on your MultiConnect® Conduit™, it will start conveying data to the scriptr.io application previously set in your Node-RED configuration. You can view the data flowing in real-time by opening the dashboard of the asset tracking application, which is described in the following step.

  4. Running your IoT Application in Scriptr.io

    The asset tracking application is a simple proof of concept that displays your device on a map, and visualizes the data from your mDot™ Box device in scriptr.io. In addition to providing you with an easy way to visualize your data, this app is meant to help you jump start your development and build a more advanced, production-ready application.

    To run the application:

    • Navigate to the assettracking/index.html file
    • Double-click to open in the editor
    • Click View to start the application

    The default credentials are demo/demo.

  5. Connecting your mDot™ Box and Viewing the Data

    Now that everything is ready, you just need to turn on the mDot™ Box and choose LoRa Demo. In the LoRa Demo section, you can either choose to trigger a message to be sent once, or set it to regularly send data every 10s, 1m, 5m, 10m, 15m or 30m. Whichever option you choose, you will start seeing the data on the dashboard as soon as you press the button.

    Note that the LoRa Demo mode doesn’t send GPS location, so the device will be shown in a default location on the map, New York, until you turn on the Survey GPS mode. Once you do that, the device location will be updated on the map, so you’ll need to navigate to the device’s current location to see it.

    If you would like to change the default location, go back to the Node-RED App that you configured in step 3.8, open the config node, and change the values of the lat and lon variables to the desired values.

  6. Going Forward

    Scriptr.io allows you to reduce the time to market of your IoT applications by accelerating your development pace, thanks to a plethora of API and visual development tools, such as our dashboard builder, our decision table editor, and the multitude of tools at your disposal in the Workspace. In addition to our long list of demo applications / modules / connectors which you can find under our GitHub account, we have built a few demo apps specifically for the MultiConnect® Conduit™ to help you get started.

    The asset tracking app code can be found in your Workspace under the app and assettracking folders, so you can modify it as you see fit. The app is documented, and you can find its Readme file under the app folder.

    Furthermore, if you want your Conduit™ to go through a DMP (Microsoft Azure, AWS, IBM Bluemix, TTN, etc.) before it reaches your IoT application on scriptr.io, connect to scriptr.io using MQTT, or use a device other than the mDot™ Box, then we recommend checking our previous blog post on connecting the MultiConnect® Conduit™.

    For a deeper dive in scriptr.io, you can check out our one-page documentation as well as our how-to guides.

    Finally, if you have any questions or feedback, we’d love to hear from you at support@scriptr.io.