Depending on which device you picked, you can skip the section related to its counterpart device below and move to section 2.
1. Setting up Your Device
Based on your preference, you can opt to either follow the mDot instructions, or the LoRa Mote instructions. Alternatively, you can pick your own device and connect it to the gateway, then move to step 2.2 below.
Option A: mDot
To connect the mDot to the gateway, refer to Connecting a MultiConnect® mDot™ to a MultiConnect® Conduit™ by MultiTech.
Option B: LoRa Mote
Now that the LoRa network server is up and running, we will need to setup the LoRa Mote.
The device needs to be configured with similar parameters:
- A devaddr that falls in the specified range (we will use 00000011 as device address).
- a deveui of 1234123412341234.
- An app eui 1234123412341234 (matching the network eui specified on the conduit).
- An app key 12341234123412341234123412341234 (matching the network key specified on the conduit).
Setting up the LoRa Mote will require access to the device over a serial port (provided by the LoRa Mote over USB).
To configure it, you can use the provided Python script which will do the following for you (which you can do yourself manually using a terminal tool like TeraTerm):
- Setup the serial communication tool to use the appropriate device:
- Connect to the LoRa Mote over serial (on Linux it will be assigned a device address like /dev/ttyACM0 – you can get this address by checking dmesg)
- Set baudrate 57600
- Disable software and hardware flow control
- Issue the following commands:
- sys reset (reset the conf on the LoRa Mote)
- mac set devaddr 00000011
- mac set deveui 1234123412341234
- mac set appeui 1234123412341234
- mac set appkey 12341234123412341234123412341234
- mac set adr off
- mac set sync 34
- mac save
Once done, proceed to the following:
- Restart your LoRa Mote and configure it from the hardware buttons.
- When it boots up, click the left button (S2) and then select Join By Otaa (the button to the right S3).
- Using the S2 and S3 buttons, you should be able to configure a periodic push of the sensors data (temperature and ambient light) to the gateway, or push packets on demand.
2. Checking Messages on the Local Broker
Now we need to check if the messages sent on the LoRa network are reaching our gateway successfully.
Since we picked OTAA for joining method, the LoRa network server will negotiate the session keys with the device and will be able to use those in order to decrypt the LoRa packet.
You can check the result by subscribing to all topics on the conduit’s MQTT broker by typing the command mosquitto_sub -t “#” which will show you packets like the following:
Note that although decrypted, the data packet is Base64-encoded.
To view the data, you can simply do something like echo “MjMxIDAyNAA=” | base64 –decode which will output “231 024” (AMBIENT_LIGHT SPACE TEMPERATURE).
Now that you’ve setup your device, you can go back to the completing the recipe.