Knowledge Hub

Factora Academy

Knowledge Hub · Courses · IoT.Factora · Implementation · 30 min

How to set up a new factory

From the ops console to the first live reading, including steps the screens do not cover yet.

Introduction

What this covers

The order of work for a new factory, from creating the company in the ops console to the first live reading on the floor.

Why it matters on the floor

Skipping a step, such as copying the one-time passwords or switching telemetry off demo, leaves a plant that looks live but shows simulated charts.

By the end you can

  • Create a factory from an industry template as a platform owner
  • Hand over the starter accounts and make each person change their password
  • Move the plant from demo telemetry to real readings and note the screen gaps

About 30 minutes. Prerequisites: Factora IoT technology setup, so the data path and the hosts are already familiar.

How to set up a new factory

Follow these steps in order for a new factory. Do the work as a platform owner, then as a plant admin. A platform viewer can look at the fleet and cannot create a factory or enter one.

Keep passwords, AppKeys, gateway tokens, and certificates in the password store. They are shown once in the product, or they are typed into ChirpStack or Mosquitto. They do not belong in this lesson.

The engineering background is Factora IoT technology setup.

1. Create the company in the ops console

  1. Open the ops console and sign in as a platform owner. MFA is required.
  2. Choose Add factory. The screen is Create a factory (/ops/setup).
  3. Pick an industry template. Optional areas can be skipped. Required areas stay in the layout.
  4. Enter the company name and the plant or site name. The plant name is the site people see. Leave it blank and the site name becomes the company name plus "plant".
  5. Under Advanced, connect FactoraERP or another ERP only if you already have those codes. Otherwise leave ERP as Not now.
  6. Review and choose Create factory. The factory starts in Onboarding. The code saves the time zone as Africa/Nairobi and telemetry as demo, so the built-in simulator may draw charts until you switch to live.
  7. Copy the one-time passwords from the confirmation screen before you leave it. The starter usernames are admin, maintenance, and operator. Each person must change that password at first sign-in. A viewer who tries to create a factory is refused.

Screen gap. The create wizard does not ask for a currency, a ChirpStack tenant, or MFA. Currency stays the database default. Change the time zone later under Settings, Plant, if the site is not on Africa/Nairobi time. Turn MFA on in the next step.

2. 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. People who have not enrolled an authenticator are signed out and enroll on the next login.
  2. Enter the factory (platform owner only) and open Settings, then Team. You can also turn on Require MFA here. If the platform already forces MFA for every factory, the checkbox stays on.
  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. You can reset an authenticator from the team list or from the fleet security panel. That signs them out so they enrol again.

Screen gap. There is no way to set MFA inside the create wizard itself. Do it immediately after create, before anyone uses the one-time password on a shared machine.

3. Sites, areas, and lines

The template already created the starter areas, sensor records, and starter alert rules. ensurePlantAssetsForCompany also creates the production lines that belong to that template.

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

Screen gap. There is no "create a site inside this factory" form. One company is one plant. The site switcher on the command center lists factories an ops owner can enter. It does not add a second site under the same company. A second physical site is a second factory in the ops console.

4. ChirpStack tenant, application, and device profile

Screen gap. Factora has no screen for ChirpStack tenants, applications, or device profiles. Do this in the ChirpStack admin at lns.factoraiot.com (office allowlist, not the plant login).

  1. Create a tenant for this factory, 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. The codec must return JSON. Put the number you will chart on a field such as temperature inside object.
  4. Note the application id. The MQTT topic uses that id, not the factory slug.

5. Register the gateway

Screen gap. The Basics Station address, gateway id, and token or certificate are ChirpStack settings. Factora's Register gateway button on Connect only stores a code, a name, and a location so the plant can show a heartbeat. It does not configure the radio gateway.

  1. In ChirpStack, under the factory tenant, add the gateway by its id.
  2. Choose Basics Station authentication: 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. The gateway opens that connection. Do not open an inbound port on the factory router.
  4. Confirm ChirpStack shows the gateway online before you register sensors.
  5. In the plant, Connect, register a gateway row with a stable code and the place it is installed, so operators can see a heartbeat later. That row stays stale until something sends a heartbeat. The ChirpStack link does not fill it in.

6. Register devices

Screen gap. DevEUI, JoinEUI, and AppKey are not fields on the Factora device form. Enter them in ChirpStack. The Factora device is the measurement you will plot.

In ChirpStack, in the factory application:

  1. Add the device with DevEUI and JoinEUI.
  2. Set the AppKey for OTAA. The sensor must use the same three values. The AppKey is not sent over the air.
  3. Attach the EU868 device profile and codec from step 4.
  4. Power the sensor and wait until ChirpStack shows a join, then an uplink whose object contains the measurement.

In the plant, the template may already have a sensor row. If you need another one, open Devices as admin and create it: code, name, type, unit, and area. Min and max on that form create alert rules. The ingest token shown at create is for HTTP or the built-in broker. A LoRaWAN sensor does not use that token. Store the token anyway. It is shown once.

7. Mosquitto user and ACL

Screen gap. Factora cannot create a Mosquitto user. This is a change on the LoRaWAN broker, then a reload of Mosquitto.

  1. Add a user named factora-<factory slug> with a new password in the Mosquitto password file.
  2. Allow that user to read only application/<application id>/#. Do not allow that user to publish, and do not allow it to read another factory's application.
  3. Reload Mosquitto. The gateway-bridge user and the ChirpStack user stay as they are.

8. Create the MQTT connector in Factora

Enter the factory as admin. Open Connect.

  1. Type MQTT.
  2. Name it for the factory, for example the site name plus MQTT.
  3. Broker: mqtt://mosquitto:1883
  4. Topic: application/<application id>/device/+/event/up
  5. Password: the Mosquitto password from step 7. It is stored encrypted and is not shown again.
  6. Save. The worker subscribes at QoS 1. Status should become connected. Broker URL required means the broker box was empty. Connection lost means the worker cannot log in or cannot see the broker.

Screen gap. The connector code reads a username from the connector config (src/lib/connector-runtime.ts). The Connect form does not have a username field. It sends the broker, the topic, QoS 1, and the password. A connector saved only from this form logs in without the factora-<factory slug> user, and Mosquitto will refuse it while anonymous login is off. Username entry is not supported in the UI yet.

9. Map devices to sensors

On the same Connect page, add a mapping:

  1. Choose the connector.
  2. External id: the uplink topic, or a pattern. For one sensor use application/<application id>/device/<DevEUI>/event/up. The DevEUI must match ChirpStack's spelling, including letter case.
  3. Choose the Factora device.
  4. Activate the mapping.

When an uplink arrives with no mapping, it is listed under Discovered and the connector error is No device mapping. You can map a discovered topic to the selected device.

Screen gap. The form always stores the value path value. A ChirpStack uplink keeps the codec result in object, for example object.temperature. The worker will not find a number at value. The API can store another payloadPath. The screen cannot. Until that field exists, a mapping created from the form will not turn a normal ChirpStack uplink into a reading.

Also, the first matching mapping is the only one used. One uplink topic cannot fill two Factora devices (temperature and humidity) through two mappings.

10. Alert rules

The industry template already creates an offline rule and the limits that came with the template. On Devices, min and max on the create form add a minimum rule and a maximum rule for that device.

Screen gap. There is no separate rule editor for an existing device. The device page shows the device and its recent alerts. It does not add a new limit. To change a limit you did not set at create time, that control is not in the UI yet. Operators acknowledge on Alerts. Maintenance can resolve.

11. Verify the first readings

  1. ChirpStack 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's last value and last seen time move. Open the device and a dashboard and confirm the same number.
  4. Trigger one alert on purpose only if the plant agrees: a limit the real process can cross safely, or a short offline window while the sensor is unplugged. Confirm the alert appears, acknowledge it, and resolve it.
  5. Put the sensor back in normal range and confirm the next reading stores.

If the chart moves while ChirpStack shows no frames, you are looking at demo simulator data. The factory is still in demo telemetry until step 12.

12. Go-live checklist

  • [ ] ChirpStack gateway online on Basics Station, EU868.
  • [ ] Sensor joined and a decoded uplink is visible in ChirpStack.
  • [ ] Mosquitto user can read only this factory's application topic.
  • [ ] Factora connector connected to mqtt://mosquitto:1883 with the factory user. Remember the username screen gap before you call this done.
  • [ ] Mapping external id matches the uplink topic, and the value path points at the codec field.
  • [ ] Device last seen updates from the connector, not from the simulator.
  • [ ] Settings, Plant: telemetry Live mode (gateway ingest). Demo mode keeps the simulator running for any factory that is not paused.
  • [ ] Settings, Plant, or the ops fleet: status Active when staff should use it every day. Paused blocks plant login. Onboarding does not.
  • [ ] Require MFA is on, and every person has enrolled.
  • [ ] One-time passwords and the AppKey are only in the password store.
  • [ ] Alert list and the floor match the first real reading.
  • [ ] The platform owner has left the factory (exit the ops session) so day-to-day work is done by plant users.

Create a free account or log in to save this lesson on your progress.

Check understanding

Progress is stored in this browser until you log in. Passing is 70%.

1. Who can create a factory in the ops console?
2. Where do you enter DevEUI, JoinEUI, and AppKey?
3. The Connect form, as it ships today,
4. Switching telemetry to Live mode