Losant IoT
Losant Connector Setup
Losant Setup
Step 1 : Make a Losant Account if you don't have one already
Go to https://www.losant.com, Click sign-up and follow the instructions
Step 2 : Set up a Losant application
Go to the
Applicationssection of your Losant Dashboard [ https://app.losant.com/applications ]Click on
Add ApplicationEither choose a Template that suits you or choose
Blank ApplicationEnter a name for your application and click
Create Application
Step 3 : Create a Device Recipe
Any remote device communicating with the Losant server must be modeled in a Losant application, so that it is properly identified and the data it sends can be properly parsed. For ease of replication, we can make a Device Recipe with the required model. To create a new recipe :
Click on
Device Recipesin the SidebarClick the
Add Device Recipebutton in the top-right cornerGive a name for your recipe and choose
Set my own default names, tags and attributesClick the
Create RecipebuttonThis should take you to the
Propertiestab of your Device Recipe. In this page, ensure that theDevice ClassisStandaoneNow go to the
Attributestab. The parameters to be sent to the Losant Server have to be defined here as attributes along with a suitable data type.Once you have added the attributes necessary for your device, click
Update Attributes.
Step 4 : Create Devices
Click on the
Devicestab in the sidebar.Click on the downward arrow beside the
Add Devicebutton in the top-right cornerClick on
Create from Recipe.Choose the recipe that was made in the previous step and click
Create from Recipe.Optionally, rename the device and click
Save Device
Step 5 : Create an access key
Any device connecting to our application will need to provide authentication credentials. In Losant, these credentials are defined in the form of an access key and a corresponding access secret. A given access key can be shared by more than one device; in our application we are going to create a single access key which will be used by all devices.
Click on the
Access Keystab in the sidebar.Click the
Add Access Keybutton in the top-right corner.Give a descriptive name for your Access Key.
In the
ACCESS KEY DEVICE RESTRICTIONSSection, select the devices that the key applies to. ChooseAll Devicesif you are unsure.Click on
Create Access KeySave your keys as the Secret key cannot be recovered after this. Click on
Download to fileto save it on your PC as a text file.Once saved, acknowledge that you have saved the key and close the window.
Step 6 : Create a Dashboard.
Losant allows creating personalized dashboards to display data coming from any device in a given application, and also to send commands to a device.
Click on the
Dashboardstab in the sidebar.Click the
Add Dashboardbutton in the top-right corner.Enter a name for your Dashboard and click
Create DashboardClick on
Add Block.Losant provides you with many templates for Dshboard blocks. Choose one that is suitable to you.
In the block settings, choose the attributes to be used to generate the view and click on
Add block
IoTify Network Simulator Templates
Now that we have our Losant application and dashboard set up, we need to create a template for each device in the IoTify Network Simulator.
You can import our Losant Connector Template Boilerplate from the link below
https://raw.githubusercontent.com/iotify/nsim-examples/master/connectors/losant-connector.json
Paste this URL in the dialog box that opens when you click
Import a Templatefrom the Network Simulator templates page [ https://beta.iotify.io/network/templates ]
Or make your own from scratch :
Choose a template that suits your application or click on
Blank TemplateSelect the
MQTT(S)protocol and enter a name for your template.In the template editor, Go to the
MQTTtab to set the connection parametersEnsure that the protocol is
mqtt(TCP)Enter
broker.losant.comand theEndpoint URLIn the topic field, enter
losant/<device-id>/stateTo get
device-id, click on the devices tab of your Losant Application homepage. The device Id is listed below the Device name. Click on the button beside the ID to copy it.
Enter the same
device-idin theClientIDfield.
Go to the
Securitytab and provide the authentication credentials to connect to our Losant applicationEnter the
Access Keyas theUsernameEnter the
Access Secretas thePasswordThese can be found in the
.txtfile we downloaded while making the Access key in Losant
Go to the
Device ModelTab.In the message generator section, define the message to be sent to simulate your device.
Click the
Savebutton one you are done editing the template.
Simulation
In the simulate tab of the IoTify Network Simulator, use the newly created template to run a simulation. Ensure that the Number of clients in each simulation is set to 1.
Observe your data being populated in the Losant Dashboard.
Last updated
Was this helpful?
