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.
- MultiConnect® Conduit™ IoT Starter Kit for LoRa® Technology: from which we’re going to be using the following in this post:
- MultiConnect® Conduit™: we’re using the MTCDT-LEU1-247A Firmware 1.6.4, other AEP versions should work as well.
- MultiConnect® mCard™: along with the MultiConnect® Conduit™, you will also need the MTAC-LORA-H-915 if you’re in the US, or MTAC-LORA-H-868 if you’re in Europe.
- MultiConnect® mDot™ Box: although the device generating the data doesn’t matter (as long as it knows how to talk LoRa to the MultiConnect® Conduit™), in this guide, we will use the mDot™ Box as it’s very easy to use.
- 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=multitech.
- Node-RED app which you can find the DeviceHQ application store.
Recipe: Step by Step
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.
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
- Connect your conduit to the network using an ethernet cable.
- 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.
- 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:
- The ethernet port we’re trying to configure is eth0, click the edit button on the right.
- Configure appropriately (easiest might be to set it to DHCP if your network allows that).
- 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:
2.2. Setting Up the LoRa Network
Setting up LoRa on the conduit is all done from the admin interface, under LoRaWAN:
- Under the LoRaWAN section on the left panel, go to Network Settings
- Set the LoRa Mode to “Network Server”
- Select the appropriate frequency based on your hardware and current location (US915 in this example)
- Set the Frequency Sub-Band to 1
- From the left-side menu, navigate to Key Management
- Set the Network ID to Name
- Set the Name to MultiTech
- Set the Network Key to Passphrase
- Set the Passphrase to MultiTech
For more information on getting the mDot™ Box connected to the Conduit, refer to this article by MultiTech.
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.
- Sign-in to your Device HQ account
- Click on Store
- Click on public app and search for scriptr.io
- Select scriptr.io_simple_client from the resulting list
- Click on Add to My Apps
- Confirm the action and accept the GPL license agreement
- Click on Devices and select your device
- Click on Tasks
- From the list, pick Install App
- From the Name drop-down, select scriptr.io_simple_client
- Click Schedule App Install
- 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:
3.2. Configuring the scriptr.io client
- From the scriptr.io Workspace, click on your name on the top-right corner, then click Device Directory
- Copy the token of the device multiconnect-conduit
- Log in to the dashboard of your MultiConnect® Conduit™
- Click on Apps, in the menu on the left
- 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™
- 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 “
- 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.
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
- Double-click it to open in the editor
- Click View to start the application
The default credentials are demo/demo.
- Navigate to the
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
confignode, and change the values of the
lonvariables to the desired values.
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-trackingfolder, 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™.
Finally, if you have any questions or feedback, we’d love to hear from you at firstname.lastname@example.org.