Knowledge Hub

Factora Academy

Technology and architecture

From the radio to a dashboard

What the worker does after the network server publishes an uplink.

Introduction

Who this is for. Engineers and integrators who will connect a factory.

This article follows one reading from the radio to a dashboard, then names the settings you will touch. Do not put passwords, keys, or network addresses into a lesson, a ticket, or a chat. The click-by-click checklist is How to set up a new factory.

Architecture

Factora is one web application. The LoRaWAN stack is a separate project. Restarting one does not restart the other.

One job for each part
  1. Plant hostiot.factoraerp.com serves the floor, alerts, devices, connectivity, and settings.
  2. Ops hostadmin.factoraiot.com is the ops console for platform staff.
  3. WorkerHolds MQTT connections, runs connectors, and writes the database. It does not serve pages.
  4. DatabaseOne company is one factory. Plant queries are filtered by the signed-in factory.

Step 0. Join and relay

  1. The sensor joins with OTAA: DevEUI, JoinEUI, and AppKey. The AppKey never travels in the uplink.
  2. The gateway is a relay. It adds time, signal strength, and signal quality.
  3. Basics Station is a WebSocket inside TLS. The gateway dials out. The old unencrypted packet forwarder is not used.
Screenshot — Coming soon. Join and relay happen on the gateway and the network server.

Step 1. Decode in the network server

  1. The network server checks the integrity code and the frame counter, removes duplicates, decrypts, and runs the device-profile codec.
  2. Decoded uplinks are JSON on application/<application id>/device/<DevEUI>/event/up.
Screenshot — Coming soon. The decoded object is shown in the network server, not in a Factora codec screen.

Step 2. Store the reading in the worker

  1. The worker connects when the connector is enabled. The code is startMqttConnector in src/lib/connector-runtime.ts.
  2. It subscribes to the connector topics, or to each mapping's external id when the topic list is empty. The default QoS is 1.
  3. The first mapping whose external id matches the topic is used. A number is read at the value path, then stored with its unit, device, company, and time.
  4. A repeat is skipped when the message id or the same timestamp was already stored.
  5. Alert rules for that device run on the new value. A separate scan looks for devices that have gone quiet.
Connector that the worker subscribes
Industrial connectivity is where the connector the worker uses is saved.

Step 3. Read it on a screen

  1. The web app reads stored rows for the floor, Alerts, and Plant dashboards. It does not invent a reading.
  2. Two other doors exist for equipment that is not LoRaWAN: HTTP POST /api/ingest with the device ingest token, and the built-in broker on the server itself.
  3. The built-in broker username is the device code and the password is the ingest token. The only publish topic is factora/<factory slug>/devices/<device code>/telemetry. The payload must be 16 KB or smaller.
  4. A paused factory rejects a plant login. An ops owner can still enter it.
Plant dashboards reading stored rows
Plant dashboards read the database. They do not invent a reading.