Gateways and peripherals

I’ve been a bit confused about the role of gateways versus devices in Losant and wondering if my architecture is set up optimally. In my application, I have industrial controllers which we might consider to be peripherals and do not have Internet communications directly. The industrial controllers connect to a separate cellular modem which packages up the information from the controller and sends it via a proprietary protocol based on UDP. Since Losant cannot directly process UDP packets, I use an intermediary server on AWS to take the incoming UDP packets from all of our devices and generate an HTTP request which is then used to trigger a webhook within Losant.

Currently we uses Devices within Losant to correspond to each cellular modem. I’m wondering whether this is the right way to approach it? This seems to work OK for now because we only have one cellular modem for each industrial controller, however that may change in the future where we have multiple controllers accessing one cellular modem for the back haul to the internet. Also I’m wondering what should be the role of the intermediary server within the Losant model of devices, peripherals and gateways? Are there any specific advantages or disadvantages of using a particular combination of devices, peripherals, and gateways?

@paul_wareham,

This is a great question. I’ve been thinking up some resources to help people know and understand if their “architecture is set up optimally”. I’m typing up a longer response for you now :slight_smile:

I’m going to break down your post to respond to somethings individually.

Starting here:

“I’ve been a bit confused about the role of gateways versus devices.”

Gateways are very similar to regular devices. They connect directly to Losant and can report their own state and receive commands. The only difference is that gateways are allowed to report state for other peripheral devices. So, essentially the answer here comes down to, who reports the state data to Losant.

Let’s say you had an ethernet-connected gateway computer connected to your controller, that gateway could be a Losant Gateway (or Losant Edge Compte) device that reports on behalf of all of your industrial controllers (or Peripherals). Here, the Gateway (or Edge Compte) device would make the state call to Losant for the Peripheral devices.

Now here is where your situation is different, all of your data comes in via a Webhook, and you’re reporting state within a Workflow. So, your devices never directly report state to Losant; all the information comes over via HTTP. Since the actual state report happens in a workflow, your devices would most likely be Standalone Devices.

“Currently we use Devices within Losant to correspond to each cellular modem. I’m wondering whether this is the right way to approach it?”

Yeah, here each controller should be its own device. I like to keep my devices closely associated with the thing that’s generating the data. And to your point, it won’t always be a 1-1 mapping to modem-controller. (In terms of IoT, your cellular modem is a “Gateway,” but it’s not a Losant Gateway because it doesn’t report state for itself or behalf of your controllers.)

To sum things up, the Losant Gateway device type is essential if a device with that type is authenticating to Losant and reporting state (for itself or other devices).

I hope this helps :slight_smile: Happy to answer any follow up questions.

1 Like

Great explanation. Thank you so much!

1 Like