Factora IoT Infrastructure Guide
This lesson is the short version of the Factora IoT Infrastructure Guide. The full document is a PDF you can keep:
Download the Factora IoT Infrastructure Guide (PDF)
The guide explains each piece the same way: what it is, why we use it, and how it is set up. It does not contain passwords. Hardware is not named, because no gateway or sensor brand has been chosen.
Engineers who will connect a factory should continue with Factora IoT technology setup and How to set up a new factory.
Four layers
- A sensor on the factory floor measures something and sends a short radio message.
- A gateway at the factory hears that message and forwards it over the internet.
- The cloud server checks, decodes, and stores the message.
- The web app shows dashboards and raises alerts.
The journey of one reading
A reading such as a cold-room temperature is meant to reach the database in a few seconds.
- The sensor wakes, measures, encrypts the payload, and transmits on the EU868 LoRaWAN band.
- Any gateway in range adds the time, signal strength, and signal quality. It cannot read the encrypted payload.
- The gateway keeps one outbound TLS connection open to
wss://lns.factoraiot.com:3001using LoRa Basics Station. The factory does not open an inbound port. - The gateway bridge checks the gateway and publishes the packet to Mosquitto.
- ChirpStack v4 (EU868 only) checks the message, drops duplicates and replays, decrypts it, and runs the codec for that device profile.
- ChirpStack publishes JSON on
application/<application id>/device/<DevEUI>/event/up. - The Factora worker MQTT connector subscribes to that factory's application topic, maps the message to a device, and writes a Reading row in PostgreSQL.
- Alert rules run on that reading. Dashboards read the database.
Steps 1 to 6 run in the LoRaWAN stack. Steps 7 and 8 run in the Factora worker (src/lib/connector-runtime.ts) and the web app. The first live factory connector is still a setup task: the code is ready, and no production gateway is registered yet.
Meters that are already on the internet can skip LoRaWAN. They can use the HTTP ingest API, or the built-in MQTT broker, which listens only on the server loopback address, port 1883.
The parts
| Part | Job | Where it runs |
|---|---|---|
| Sensors | Measure and transmit by radio | Factory floor |
| LoRaWAN gateway | Relay radio packets | Factory |
| Basics Station bridge | Receive gateways on port 3001 | LoRaWAN project |
| ChirpStack v4 | Join, check, decrypt, decode | LoRaWAN project |
| Mosquitto | MQTT broker between those parts and Factora | LoRaWAN project, internal only |
| Factora worker | Subscribe, store readings, check alerts | Factora project |
| PostgreSQL | Factories, devices, readings, alerts, users | Two separate databases |
| Next.js app | Dashboards, alerts, settings, ops console | Factora project |
| Caddy | HTTPS, host routing, admin allowlists | Factora project |
Web addresses:
| Address | Who it is for |
|---|---|
| iot.factoraerp.com | Factory staff, with a login |
| admin.factoraiot.com | Ops console. Password and authenticator code (MFA) |
| lns.factoraiot.com | ChirpStack admin screens. Office network. Gateways use port 3001, not the web screen |
| factoraacademy.factoraerp.com | This academy |
Other products can share the same machine. They use their own databases.
How a factory is kept separate
One ChirpStack tenant, one Mosquitto user, and one Factora company belong to the same factory. Every Factora row that matters carries that company's id. A plant user can see only that factory. Platform staff use the ops console.
What is already running, and what is still ahead
The Factora app, the worker, PostgreSQL, and Caddy are live. ChirpStack, the Basics Station bridge, Mosquitto, and the EU868 region are installed. No production gateway or sensor is registered yet, and the first factory's MQTT connector in Factora has not been created. Backups of the Factora database run on a schedule. The ChirpStack database is not in that nightly job yet.
The rest of this academy stays on the tasks a person does in the product. The PDF is the place for server layout, backups, and capacity.
