Skip to content

Latest commit

 

History

History
168 lines (106 loc) · 4.94 KB

File metadata and controls

168 lines (106 loc) · 4.94 KB

🆕 Registering New Sensors

When introducing a new sensor into the MINTS system, a few configuration steps are required to ensure the data is properly encoded, transmitted, decoded, and stored.

In this example, we’ll add a new sensor named ISG001, which measures basic environmental parameters.


⚙️ Step 1: Define the Sensor Structure

Let’s say your new sensor, ISG001, produces the following data fields:

ISG001_payload = (
    np.float32(sensorDictionary["temperature"]).tobytes().hex().zfill(8) +
    np.float32(sensorDictionary["pressure"]).tobytes().hex().zfill(8) +
    np.float32(sensorDictionary["humidity"]).tobytes().hex().zfill(8) +
    np.float32(sensorDictionary["altitude"]).tobytes().hex().zfill(8) +
    np.float32(sensorDictionary["feelsLike"]).tobytes().hex().zfill(8)
)

Each value is converted to bytes (float32 → 4 bytes) and concatenated to form a hexadecimal payload string.

Before assigning this new sensor, check whether the sensorID already exists in
lrSensorAndPortIDs.py.

If it’s not already defined, assign a new port ID (for example, 201) and update the file accordingly.


🧱 Step 2: Create a Transmitter Script

  1. Duplicate the existing BME280 transmitter as a starting point:

    cp bme280Transmitter.py isg001Transmitter.py
  2. Modify isg001Transmitter.py to use your new ISG001 sensor definition (as shown above), and then run it:

    python3 isg001Transmitter.py

At this point, the new sensorID will not yet appear in InfluxDB, since it hasn’t been registered in the Node-RED workflow for decoding and data routing.


🧩 Step 3: Configure Node-RED

Open the Node-RED interface and navigate to the LoRa Node → InfluxDB tab.

screenshot-mdash-circ-utdallas-edu-1880-2025-10-08-16-23-41
  1. Update the LoRaSummaryWrite function
    Add the new Sensor ID and Port ID mapping:

    201: "ISG001"
  2. Modify the sensorIDCheck switch node
    Double-click on it and add an entry for your new sensor.

    image
  3. Duplicate an existing “Unpack” function
    Copy one unpack node, paste it, rename it (e.g., ISG001 Unpack V2), and update its decoding logic for your fields.

    image
  4. Reconnect workflow links
    Link the new unpack node between:

    • The sensorIDCheck switch node → your ISG001 Unpack V2
    • Your ISG001 UnpackSet Device Name for MINTS Nodes
    image
  5. Deploy the updated flow to apply the changes.


🗂️ Step 4: Export and Commit the Updated Node-RED Flow

Export your current Node-RED instance to keep the configuration synced with the cloud version.

image image

Select All Flows and click Download.

Then upload the downloaded file to the Node-RED Docker folder in the
AirQualityAnalysisWorkflows repository.


☁️ Step 5: Update the Cloud Server (MDASH)

Log in to MDASH via SSH

ssh jxw190004@mdash.circ.utdallas.edu

⚠️ Make sure you have SSH access configured.


Pull the Latest Repository Updates

cd AirQualityAnalysisWorkflows/
git pull

Restart the Node-RED Container

Go to the InfluxDB directory and list running containers:

cd influxdb
podman container ls

You’ll see output similar to:

CONTAINER ID  IMAGE                            COMMAND  STATUS           PORTS
33bad6576ec5  localhost/mints-nodered:latest            Up 2 months ago  0.0.0.0:1880->1880/tcp

Stop and remove the Node-RED container only (leave InfluxDB running):

podman stop 33bad6576ec5
podman rm 33bad6576ec5

Then rebuild and restart:

podman-compose up --build -d

Exit the Server

exit

✅ Step 6: Verify Data

Finally, rerun your transmitter:

python3 isg001Transmitter.py

Confirm that the new ISG001 sensor data is appearing correctly in InfluxDB.

At this point, your new sensor is fully registered in the MINTS IoT workflow.