How To Setup Mcthings Platform Alongside Mcmodule To Rails Temperature/Voltage

The exciting move of whatever IoT solution is tinkering amongst the hardware as well as software as well as become far work! On this move 2, I'm setting upward the mcThings platform to assemble upward information as well as flow it alive via a IoT cloud dashboard application such as +LosantHQ

In fellowship to integrate mcThings amongst Losant to read temperature as well as voltage data, you lot ask at to the lowest degree a mcModule, a mcDongle, a mcGateway, a USB stick, money jail mobile telephone CR2032 batteries, ii micro USB data/power cables and mc-Studio IDE software (free to download).
The USB stick is needed for updating the application processor of the mcGateway; spell the micro USB power/data cables are needed for powering as well as transferring data, equally good equally for updating the mcDongle as well as the mcGateway board. Here are the steps:

1) Sign upward amongst Losant to create an account

2) Create a New Application

3) Create novel device

4) Select Start from Scratch

5) Create a Gateway (you tin telephone band it whatever advert you lot like)

6) Create a Peripheral (you tin telephone band it whatever advert you lot like) as well as thus select the advert of the Gateway you lot created inwards footstep 5.

7) Download mcStudio from (make certain .NET Framework 4.6.2 is installed on your computer)

8) Connect the mcGateway to your WiFi network. You tin practice this past times using an ethernet cable to connect the mcGateway to your router. You ou tin connect too via WPS WiFi pairing, or via the mcStudio IDE.

mc-Module 110 on far come about of the board
9) Update firmware for mcModules as well as mcGateway. Head 1 time to a greater extent than to and download these below:

10) Open mcOTA, click "Search Device" as well as thus insert the money battery inwards the mcModule. Once the device information appears, click Start Update.
Wait until message reads Firmware upload complete
11) Repeat the same procedure to a higher house for updating the mcGateway. You’ll ask to update both the host module on the gateway as well as the application processor. The host is updated using the mcDongle as well as the mcOTA application as well as the processor is updated using USB. 
When updating the mcGateway's application processor, brand certain your USB stick is formatted using FAT32, as well as house the “mcGw110.bin” file inwards the USB stick without chaging the advert of the file from “mcGw110.bin”

Before inserting the USB stick into the mcGateway board, disconnect the power/data cable from the mcGateway as well as insert the USB stick. Then, reconnect the ability cable as well as concur downward both buttons (RESET as well as USER SW). The flashing light-green LED on the mcGateway board volition demo solid light-green for a few seconds, indicating the application software is beingness updated. when the light-green lite starts flashing again, the application processor updating process has completed.

12) Connect the mcGateway to your PC as well as click Connect Gateway

Create novel project

Add TempSensor library

For Temperature as well as BatteryVoltage, I instruct inwards the next code. You tin instruct the code here

Once the code is entered, Save, Build as well as Load

13) Now, become to "Device Maintenance as well as Connection". To instruct in that place select Tools -> Devices 
Then, connect mcGate110 as well as select Gateway Config to pick out upward the GatewayConfigForm as well as instruct inwards the next details:
MQTT Server:
MQTT Port: 1883
MQTT Username: Your Losant Access Key
MQTT Password: Your Losant Access Secret
MQTT ClientId: This is the Device ID of the gateway you lot created inwards Losant.
To obtain the access keys from Losant, become to Applications->Access Keys

14) Once the to a higher house is correctly laid up, you lot should last able to refresh as well as instruct a Connected message from the Losant dashboard..

15) Now, nosotros are create to create a widget from the Losant dashboard to visualize the data. In this case, temperature as well as battery voltage. First, nosotros create a dashboard

Then, select a Block. In my case, I selected GAUGE

Enter the information applicable to you. Choose an Application, Gauge Type, Precision Type, Duration, all tin last laid how you lot like. Device IDs / Tags (enter the device module you lot created). For Label as well as Attribute you lot must instruct inwards Celcius as well as Temperature.

To visualize BatteryVoltage, merely instruct inwards "Voltage" nether label as well as select "BatteryVoltage" nether attribute.