Knowledge Hub

Factora Academy

Setting up a new factory

How to set up a new factory

Create the company, the people, the gateway, the sensor, and the MQTT connector.

Introduction

Who this is for. A platform owner who creates the factory, then a plant admin who finishes the site.

Follow these steps in order for a new factory. Do the work as a platform owner, then as a plant admin. Keep passwords, AppKeys, and gateway tokens in the password store. The engineering background is in Technology and architecture.

Architecture

A factory is one company in Factora, one tenant in the network server, and one broker user.

One job for each part
  1. Ops consoleCreates the factory and the first plant passwords.
  2. PlantAreas and lines, Device registry, Industrial connectivity, Settings, and Alerts.
  3. Network serverTenant, application, gateway, device keys, and codec.
  4. WorkerHolds the MQTT connection and writes readings.

Step 0. Create the company in the ops console

  1. Open the ops console and sign in as a platform owner. MFA is required there.
  2. Choose + Add factory. The screen is Create a factory.
  3. Pick an industry template. Optional areas can be skipped. Required areas stay.
  4. Enter the company name and the plant or site name. Leave the plant name blank and the site name becomes the company name plus plant.
  5. Under Advanced · ERP connection, choose Not now unless you already have the codes.
  6. Review and choose Create factory. The factory starts in Onboarding with the time zone and currency you chose, and telemetry starts as demo.
  7. Copy the one-time passwords. The starter usernames are admin, maintenance, and operator.
Create a factory review
Create a factory, review step.

Step 1. Turn on MFA and add people

  1. On the fleet page, open the new factory and open security. Turn on Require MFA for all team members.
  2. Enter the factory as a platform owner. Open Settings, then Team. You can turn on Require MFA here as well.
  3. Add each extra person with a display name and a role: admin, maintenance, or operator. The new password is shown once.
  4. Each person installs an authenticator, scans the enrolment code at sign-in, and stores the recovery codes.
Settings, Team
Settings, Team, including Require MFA for all team members.

Step 2. Add areas and lines

  1. Enter the factory as admin.
  2. Open Areas and lines.
  3. Add an area by name and kind, then add a line under that area.
Areas and lines
Areas and lines.

Step 3. Create the network server tenant

Do this in the network server admin, not in Factora.

  1. Create a tenant named factory-<factory slug>.
  2. Create one application in that tenant for the site's sensors.
  3. Create or reuse a device profile: region EU868, LoRaWAN 1.0.x, OTAA, and a codec named for the measurement.
  4. Note the application id. The MQTT topic uses that id, not the factory slug.
Screenshot — Coming soon. Tenant, application, and device profile are not Factora screens.

Step 4. Register the gateway

  1. In the network server, under the factory tenant, add the gateway by its id.
  2. Choose a per-gateway token, or a client certificate when you are ready for mutual TLS.
  3. On the gateway, set the server to wss://lns.factoraiot.com:3001.
  4. Confirm the gateway is online, then in the plant choose Register gateway on Industrial connectivity.
Register gateway
Industrial connectivity, where Register gateway lives.

Step 5. Register devices

  1. In the network server, add DevEUI and JoinEUI, set the AppKey, and attach the EU868 device profile.
  2. Power the sensor and wait for a join, then an uplink whose object contains the measurement.
  3. In Device registry, choose Create device if the template does not already have the row you need: code, name, parameter, unit, and area.
  4. Store the ingest token if it is shown. A LoRaWAN sensor does not use it.
Register sensor
Device registry and Register sensor.

Step 6. Add the broker user

This is a change on the LoRaWAN broker, then a reload. Factora cannot do it.

  1. Add a user named factora-<factory slug> with a new password in the broker password file.
  2. Allow that user to read only application/<application id>/#. Do not allow that user to publish, and do not allow another factory's application.
  3. Reload the broker. Leave the gateway-bridge user and the network server user as they are.
Screenshot — Coming soon. Broker users are not created in Factora.

Step 7. Create the MQTT connector

  1. Enter the factory as admin and open Industrial connectivity.
  2. Set Type to MQTT and name the connector for the site.
  3. Set Broker / endpoint to mqtt://mosquitto:1883.
  4. Set Topic / node / register pattern to application/<application id>/device/+/event/up.
  5. Enter Password / secret and choose Save connector. Status should become connected.
Save connector
Connector form: Type, Name, Broker / endpoint, Topic / node / register pattern, Password / secret, Save connector.

Step 8. Map devices to sensors

  1. On the same page, under Map external source → FactoraERP device, choose the connector.
  2. Set External id to the uplink topic. For one sensor use application/<application id>/device/<DevEUI>/event/up. Match the DevEUI spelling, including letter case.
  3. Choose the FactoraERP device and choose Activate mapping.
  4. When an uplink arrives with no mapping, it is listed under Discovered. You can choose Map to selected device.
Discovered devices
Discovered devices, for topics that arrived with no mapping.

Step 9. Set alert rules

  1. The industry template already creates an offline rule and the limits that came with the template.
  2. On Register sensor, Min threshold and Max threshold add a minimum rule and a maximum rule for that new device.
  3. On Alerts, use Alert rules to write a sentence for a sensor that already exists: when it is above, below, or outside a value for a number of minutes, notify admin, maintenance, or operator.
  4. Operators acknowledge on Alerts. Maintenance can resolve.
Alerts
Alerts, including Acknowledge and Resolve. Alert rules is on this page.

Step 10. Verify the first readings

  1. The network server shows an uplink for the DevEUI, with a decoded object.
  2. The Factora connector stays connected, accepted messages increase, and the last error is empty.
  3. The device last value and last seen time move. Open the device and Plant dashboards and confirm the same number.
  4. Trigger one alert only if the plant agrees. Confirm it appears, acknowledge it, and resolve it.
Plant dashboards with a reading
Plant dashboards, where the first stored reading should appear.

Step 11. Go live

  1. Gateway online on Basics Station, EU868, and the sensor has joined.
  2. Broker user can read only this factory's application topic.
  3. Factora connector is connected to mqtt://mosquitto:1883. Remember the username gap before you call this done.
  4. Mapping external id matches the uplink topic, and the value path points at the codec field.
  5. Settings, Plant: Telemetry is Live mode (gateway ingest), and status is Active when staff should use it every day. Paused blocks plant login. Onboarding does not.
  6. Require MFA is on, and every person has enrolled. One-time passwords and the AppKey are only in the password store.
  7. The platform owner has left the factory so day-to-day work is done by plant users.
Settings, Plant
Settings, Plant, where Telemetry is set to Live mode (gateway ingest).