Gateway Binary Passthrough

Direct binary data passthrough from Wirepas devices via N8 Gateway secondary MQTT for on-premises installations

Overview

Gateway Binary Passthrough allows the N8 Gateway to deliver raw Wirepas device messages directly to a customer’s local MQTT broker, without Haltian IoT cloud processing.

This is ideal for on-premises installations where you need:

  • Local data processing without internet dependency
  • Low-latency access to raw sensor data
  • Data sovereignty within your network

Use Cases

  • On-premises processing - Process sensor data locally without cloud dependency
  • Custom protocols - Handle proprietary binary formats directly
  • Low-latency applications - Minimize processing overhead
  • Data sovereignty - Keep raw data within local network
  • Air-gapped environments - Operate without internet connectivity

Architecture

The N8 Gateway maintains two parallel connections:

  1. Primary connection (LTE/Ethernet) → Haltian IoT Cloud for management
  2. Secondary MQTT (Local network) → Customer broker for raw data
%%{init: {'theme':'base', 'themeVariables': {'primaryColor':'#73f9c1','primaryTextColor':'#143633','primaryBorderColor':'#143633','lineColor':'#143633'}}}%%
graph LR
    A[Wirepas Sensors] --> B[N8 Gateway]
    B --> C[Haltian IoT Cloud]
    B --> D[Secondary MQTT<br/>Customer Broker]
    C --> E[Parsed Data<br/>Service API]
    D --> F[Raw Binary<br/>Customer Processing]
    
    style B fill:#73f9c1,stroke:#143633,color:#143633
    style C fill:#143633,stroke:#143633,color:#fff
    style D fill:#ff8862,stroke:#143633,color:#fff

Prerequisites

  • Haltian IoT N8 Gateway
  • Customer-hosted MQTT broker (Mosquitto, EMQX, HiveMQ, etc.)
  • Network connectivity between gateway and broker

Configuration

1. MQTT Broker Setup

On your MQTT broker:

  1. Create MQTT user credentials (username/password)
  2. Configure broker to accept connections on port 1883 (unencrypted) or 8883 (TLS)
  3. Credentials can be shared across gateways or unique per gateway

2. Gateway Configuration

Create or edit the secondary MQTT configuration file on the gateway:

File: /data/thingsee/wirepas/secondary-mqtt.cfg

mqtt_hostname: 10.0.100.105
mqtt_port: 1883
mqtt_username: myusername
mqtt_password: mypassword
mqtt_force_unsecure: 1
mqtt_reconnect_delay: 10
gateway_id: BS235200005
ParameterDescription
mqtt_hostnameIP address or hostname of your MQTT broker
mqtt_portMQTT port (1883 for unencrypted, 8883 for TLS)
mqtt_usernameMQTT authentication username
mqtt_passwordMQTT authentication password
mqtt_force_unsecureSet to 1 for unencrypted, 0 for TLS
mqtt_reconnect_delaySeconds between reconnection attempts
gateway_idGateway identifier for topic structure

3. Network Configuration

Recommended network architecture:

  • Segregate gateways into dedicated VLAN
  • Configure firewall to allow only MQTT (1883/8883) to customer infrastructure
  • Gateway uses LTE as primary connectivity for Haltian IoT cloud communication
  • Secondary MQTT uses local network for on-premises data delivery
%%{init: {'theme':'base', 'themeVariables': {'primaryColor':'#73f9c1','primaryTextColor':'#143633','primaryBorderColor':'#143633','lineColor':'#143633'}}}%%
graph TB
    subgraph CustomerNetwork["Customer Network"]
        subgraph VLAN["Gateway VLAN"]
            GW[N8 Gateway<br/>BS235200005]
        end
        MQTT[MQTT Broker<br/>10.0.100.105:1883]
    end
    
    subgraph Cloud["Internet"]
        HIOT[Haltian IoT<br/>Cloud]
    end
    
    GW -->|Secondary MQTT<br/>Local Network| MQTT
    GW -->|Primary Connection<br/>LTE| HIOT
    
    style GW fill:#73f9c1,stroke:#143633,color:#143633
    style MQTT fill:#ff8862,stroke:#143633,color:#fff
    style HIOT fill:#143633,stroke:#143633,color:#fff
    style VLAN fill:#f6fafa,stroke:#143633,stroke-width:2px
    style CustomerNetwork fill:#fff,stroke:#143633,stroke-width:2px
    style Cloud fill:#fff,stroke:#143633,stroke-width:1px,stroke-dasharray: 5 5

Messaging

When enabled, secondary MQTT mirrors all Wirepas data to the customer broker.

Downlink (device configuration) is not available in the current release. All configuration must go through Haltian IoT cloud to ensure device management tools remain synchronized.

Topic Structure

Topics follow the Wirepas reference MQTT implementation:

haltian-iot/wirepas/gw-event/received_data/{gateway-id}/{sink}/{source-node}/{source-ep}/{dest-ep}

Example:

haltian-iot/wirepas/gw-event/received_data/BS235200005/sink1/15056570/22/23
SegmentDescription
gateway-idGateway identifier (e.g., BS235200005)
sinkGateway sink identifier
source-nodeWirepas node ID of the sending device
source-epSource endpoint
dest-epDestination endpoint

Payload Format

The payload is raw binary data as received from the sensor/Wirepas stack:

  • Thingsee/Haltian sensors - CBOR formatted messages
  • Other Wirepas devices - May use ProtoBuf, TLV, or proprietary formats

Your MQTT client must parse messages according to the device’s encoding format.

Identity Mapping

Devices are identified by Wirepas node ID in passthrough messages. To correlate with other identifiers:

  1. Query Haltian IoT Service API for device inventory
  2. Map Wirepas node ID to:
    • Serial number
    • TUID
    • User-assigned name
    • UUID

GraphQL Query Example

query GetDeviceByWirepasNode {
  devices(filter: { wirepasNodeId: 15056570 }) {
    edges {
      node {
        id
        tuid
        name
        serialNumber
      }
    }
  }
}

Client Implementation

Python Example

import paho.mqtt.client as mqtt

def on_message(client, userdata, msg):
    topic_parts = msg.topic.split("/")
    gateway_id = topic_parts[4]
    source_node = topic_parts[6]
    
    # Raw binary payload
    binary_data = msg.payload
    
    # Parse based on your device's format (CBOR example)
    import cbor2
    try:
        decoded = cbor2.loads(binary_data)
        print(f"Node {source_node}: {decoded}")
    except Exception as e:
        print(f"Node {source_node}: {len(binary_data)} bytes (non-CBOR)")

client = mqtt.Client()
client.username_pw_set("myusername", "mypassword")
client.on_message = on_message
client.connect("10.0.100.105", 1883)
client.subscribe("haltian-iot/wirepas/gw-event/received_data/#")
client.loop_forever()

Limitations

LimitationDetails
Gateway onlyN8 Gateway required; cloud passthrough not yet available
Uplink onlyDownlink/configuration must use Haltian IoT cloud
No filteringAll Wirepas data is mirrored (filtering planned)
Manual parsingCustomer responsible for binary decoding

Next Steps