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. If you prefer a visual guide, check out the how-to video guide on YouTube at the following link: https://youtu.be/mpu6QKG1Vkg.

In this article,  you will learn how to configure the MultiConnect® Conduit™ to forward incoming data to scriptr.io using a Node-RED app.

Pre-requisites

Hardware

Software

Recipe: Step by Step

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

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

    Alternatively, if you would like to use your existing scriptr.io account, you can import the apps from their GitHub repositories (asset-tracking and quickstart-app) and run the installers (refer to their Readme.md files for more details). Then go to Install Module… by clicking the arrow next to New Script and install the underscore.js module.

  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 frequency based on your hardware and current location (US915 in this example)
    4. Set the Frequency Sub-Band to 1
      LoRaWAN Networking
    5. From the left-side menu, navigate to Key Management
    6. Set the Network ID to Name
    7. Set the Name to MultiTech
    8. Set the Network Key to Passphrase
    9. Set the Passphrase to MultiTechKey Management

    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.

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

    To forward data to scriptr.io, you need to install and configure 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 on Store
    3. Click on public app and search for scriptr.io
    4. Select scriptr.io_simple_client from the resulting list
    5. Click on Add to My Apps
    6. Confirm the action and accept the GPL license agreement
    7. Click on Devices and select your device
    8. Click on 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
    1. From the scriptr.io Workspace, click on your name on the top-right corner, then click Device Directory
    2. Copy the token of the device multiconnect-conduit
    3. Log in to the dashboard of your MultiConnect® Conduit™
    4. Click on Apps, in the menu on the left
    5. Click on “Launch Node-Red”. You will have to sign-in to the Node-Red editor. You can use the same credentials you’ve entered to login to the MultiConnect® Conduit™
    6. Double-click on the “config” node of the Node-Red flow. In the editor that opens:
      • Set the value of the auth_token variable to your scriptr.io’s conduit token which you copied above
      • Set the value of the url variable to the ingest API corresponding to the application that you’d like to run. In this case, set it to “https://api.scriptrapps.io/asset-tracking/api/ingest
    7. Once done, click on the Deploy button for your changes to take effect

    After scriptr.io_simple_client 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 visualize 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 to build a more advanced, production-ready application.

    To run the application:

    • Navigate to the asset-tracking/view/html/login.html file
    • Double-click it 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 2.2, 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 asset-tracking folder, so you can modify it as you see fit. If you’re new to scriptr.io, you might want to start with the quickstart-app, which is a simpler application that provides all the basic functionality, and also works with your MultiTech starter kit out of the box. Both apps are documented, and you can find their Readme files under their corresponding folders.

    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.