Gateway Binary Passthrough
Beta - This feature is in beta and available on Haltian IoT N8 Gateway only.
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
For cloud-based binary passthrough via Haltian IoT MQTT, see Cloud Binary Passthrough.
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:
- Primary connection (LTE/Ethernet) → Haltian IoT Cloud for management
- 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:#fffPrerequisites
- 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:
- Create MQTT user credentials (username/password)
- Configure broker to accept connections on port 1883 (unencrypted) or 8883 (TLS)
- 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
| Parameter | Description |
|---|---|
mqtt_hostname | IP address or hostname of your MQTT broker |
mqtt_port | MQTT port (1883 for unencrypted, 8883 for TLS) |
mqtt_username | MQTT authentication username |
mqtt_password | MQTT authentication password |
mqtt_force_unsecure | Set to 1 for unencrypted, 0 for TLS |
mqtt_reconnect_delay | Seconds between reconnection attempts |
gateway_id | Gateway 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 5Messaging
Uplink Data
When enabled, secondary MQTT mirrors all Wirepas data to the customer broker.
Future releases may add filtering options to limit mirroring to specific Wirepas endpoints.
Downlink Data
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
| Segment | Description |
|---|---|
gateway-id | Gateway identifier (e.g., BS235200005) |
sink | Gateway sink identifier |
source-node | Wirepas node ID of the sending device |
source-ep | Source endpoint |
dest-ep | Destination 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:
- Query Haltian IoT Service API for device inventory
- 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
| Limitation | Details |
|---|---|
| Gateway only | N8 Gateway required; cloud passthrough not yet available |
| Uplink only | Downlink/configuration must use Haltian IoT cloud |
| No filtering | All Wirepas data is mirrored (filtering planned) |
| Manual parsing | Customer responsible for binary decoding |
Next Steps
- Cloud Binary Passthrough - Cloud-based raw data via Haltian IoT MQTT
- Service API - Query device inventory for identity mapping
- N8 Gateway Documentation - Hardware setup guides