Devices

Devices on Fostrom are the virtual representation of your actual device. You can connect any device to Fostrom, as long as you can establish a secure connection over one of the protocols we support: MQTT or HTTP. We're also working on a custom protocol and Device SDKs powered by it to make the process of integration seamless and simple. Until then, read our protocol guides to get started with connecting your devices to Fostrom.

Adding a Device

To add a new device, click on the New Device button in the Devices tab. You need to enter a name unique to the fleet.

You can also enter tags, separated by spaces. Tags are helpful to group devices with shared capability together. You can then broadcast messages to all devices having a particular tag through Actions. Make sure to add descriptive but specific tags to your devices. It will help discoverabilty and enhance operational control as your fleet grows.

We highly recommend that you add a description too. You may want to keep note of where the physical device is located, or denote some important information to other members of the organization.

There is currently one advanced option available: Offline Threshold. This option allows you to configure when the device should be declared offline.

Device List

Once you add devices, you'll see them in the list on the Devices tab. The indicator on the left of each device indicates whether the device is online or offline. The following is what each indicator means:

  • Green: The device is currently connected to Fostrom with an open socket. This is usually the case when the device connects over MQTT with a keep-alive connection.

  • Blue: The device is currently active, but does not hold an open socket to Fostrom. This is usually the case when the device connects over HTTP or MQTT without a keep-alive connection. The active state is determined based on the last heartbeat received and the offline threshold.

  • Red: The device is offline. This means that the device hasn't sent heartbeats or any other packets in the last 3 minutes or whatever value is configured in the Offline Threshold option.

  • Grey: You can briefly see a grey indicator, while the state of each device is loaded.

Device Dashboard

The device dashboard allows you to access the credentials you need to connect the device to Fostrom. Along with that, you can also access the device settings.

We're going to add activity charts and mailbox previews soon.

Device Credentials

To access the credentials, just click on the Connection button in the device dashboard, which should open a modal showing you the Fleet ID, Device ID, and Device Secret. Copy these and refer to the docs on the protocol of your choice on how to use these values. As always, ensure that the device secret is stored safely on your device. If you wish to reset the device secret, you can do it from the device's settings, but note that if your device is connected, it will immediately disconnect from Fostrom and fail connecting subsequently.

Device Settings

Similar to the organization and fleet names, you can change the device's name in Settings, but you should avoid it as it is used in URLs. Changing the device name will not affect the ability of your device to connect to Fostrom, or any of your programmed Actions, as the Device ID is used in those places.

You can change the description, tags, and offline threshold at any time.

You can also reset the device secret or delete the device from the Danger Zone tab.

Device Mailbox

Each device has its own mailbox, in which messages are queued, usually by action runs. The mailbox is a sequential FIFO queue. The device either asks for a message, or is pushed a message if no other pending messages remain in the mailbox.

The device can then process the message, and needs to send an Acknowledgement. Once the message is acknowledged, it can fetch the next message in the mailbox and so on. The device can also Reject or Requeue a message. In case of a rejection, there's no material difference compared to acknowledging it. Once a message is acknowledged or rejected, it is removed from the mailbox.

In case of a requeue, the message is removed from the bottom of the queue and added back to the top of the queue. This way, the device can postpone processing a message without removing it from the mailbox. Note that the original message is requeued with a new and different message ID.

The aspects of actually fetching and acknowledging messages differs in the different protocols, so refer to their specific docs.