How do I use Connectors?

Setting up connectors allows you to send data to a server without logic and SDKs installed to devices.

If you are not sure about Onomondo Connectors, you can get an introduction here:

Before starting, you need to know which device that will be sending data, what data you want it to send, and where it is to be sent. Afterwards, follow these three steps to set up a Connector.

  1. Setting up the device to send data.
  2. Configuring the new Connector.
  3. Adding the Connector to a SIM.

Step 1: Setting up the device to send data

Make sure your device is connected to the network. Haven't done that before and need help? 

Once your device is connected you need to set it up to generate the desired payload. You need to send it using one of the protocols, like TCP or UDP. For simplicity, let's use an example with JSON payload sent over TCP using python. This code would be running on your device:

import socket

payload = { "Hello": "There!" }

s = socket.socket(socket.AF_INET, socket.SOCK_STREAM)
s.connect(('1.2.3.4', 4321))
s.send(payload)
s.close()

This is enough to send the data to your service of choice - the rest happens at Onomondo. Notice that there is no overhead like encryption (e.g. https). With Onomondo you don't need to do that as it's sent to Onomondo before it's sent on the Internet, and encryption is added on our end.

But what IP address should I use?

It doesn't matter, because you set the routing rule on Onomondo - this way it's easier to update where to send data without updating your devices. Do not use the IP loopback address, 127.0.0.1. Simply using 1.2.3.4 and port 4321 provided in the example is sufficient. Also, if you avoid using domain names your device doesn't need to do a DNS lookup which consuming extra data and may stall the transmission.

Using HTTP: HTTP Severs often check for the correct HOST header in the requests being sent. If it is not set to allow the dummy IP the device is sending (i.e. 1.2.3.4) using TLS connector then it will return a 402 error to the device, which can be seen if the data is being captured by live-monitor. This can be fixed by either:
 - Updating the server to accept the dummy IP
- Stopping the server from checking the HOST header
- Adding the correct HOST header on the device

Video demo

In this demo, Customer Success Manager Jason shows you how to set up a Connector on a SIM, add a passthrough, and change connectors - all in under 5 minutes.

Step 2: Configuring the new to a new Connector

Under the "Connectors" tab in the Onomondo app you can click the button "Add Connector" to configure your new Connector.

Currently, we offer:

  • TLS Connector
  • IBM Watson IoT
  • Microsoft Azure IoT
  • Google Cloud IoT Core

If you have a different service that you would like a Connector for, email us at support@onomondo.com. We are always looking to update our roadmap with new Connectors and we are happy to discuss it with you.

The Connector configuration has four sections:

  1. Connector name
  2. Connector type
  3. Type configuration
  4. Passthrough connection

Once you have named your Connector, you will need to pick the type. 

For this example we are going to use a IBM Watson IoT. This is an event-based Connector. If you are interested in device initiated 2-way example you can get more information:

Each type will allow you to connect to a specific service. Selecting a type will change the fields to fill out in the "Type configuration" section. Fill in the fields with the information provided from your cloud Platform credentials.  Once they are filled out, the 'Add' button will be available to create the Connector.

Step Three: Adding the Connector to a SIM

Once you have created a Connector, go to the SIMs tab. Find the SIM you want to attach to the Connector you have created.  Click "Go to the SIM" button to display the SIM detail page. Click the edit button. 

edit-sim-button

In the SIM settings menu, select the Connector dropdown menu and pick the newly created Connector and click Update.

 add-ibm-connector

Step Four: Adding a Passthrough

An optional addition is setting up a passthrough. This identifies exceptions that the Connector will not pick and send to the HTTPS endpoint specified in the Connector. A couple of examples could be:

  1. Sending a ping - selecting the passthrough for packets with the ICMP protocol
    pingPassthrough
  2. Allowing DNS server lookup - selecting the passthrough for packets with the UDP protocol on port 53
    DNSpassthrough
  3. Another sever endpoint - for example updating device firmware. Setting protocol and IP address should be sufficient.
    firmwarePassthrough

Witness the magic of Onomondo's Connectors

Once the Connector is added, data sent from your device will reach the service you have chosen.

Using the example code on a Raspberry Pi 3 with a Huawei E3531 cellular modem your IBM Watson IoT account will receive the data.

If you need to change a connector, it is just a matter of repeating steps 1 and 2 without having to update the device.

Magic!