How to Deploy E-TOP LoRaWAN Thermostats on ChirpStack and TTN

Once your commercial LoRaWAN gateway and network architecture is in place, the next engineering step is onboarding your room controllers onto a LoRaWAN Network Server (LNS). For building automation integrators, ChirpStack v4 (self-hosted/private LNS) and The Things Network / The Things Stack (TTN) are the two most widely adopted platforms.

This practical deployment guide walks you through registering E-TOP LoRaWAN thermostats—such as the FT-CS08 LoRaWAN FCU thermostat—configuring LoRaWAN 1.0.3 Class C device profiles, deploying an ES5.1-compatible JavaScript payload codec, and verifying end-to-end uplink and downlink communication.

Prerequisites & OTAA Onboarding Credentials

Before creating a device profile in ChirpStack or TTN, confirm that your indoor LoRaWAN gateway is online and connected to your LNS. E-TOP LoRaWAN thermostats support both OTAA (Over-The-Air Activation) and ABP (Activation By Personalization), with OTAA strongly recommended for commercial deployments due to dynamic session key negotiation and AES-128 security.

Prepare the following factory-provisioned credentials from your device label or E-TOP shipment manifest:

Parameter Bit Length Format Engineering Function
DevEUI 64-bit 16 Hex characters Globally unique hardware identifier for each thermostat.
JoinEUI / AppEUI 64-bit 16 Hex characters Identifies the join server or application domain during OTAA.
AppKey 128-bit 32 Hex characters Root AES-128 key used to derive session keys upon joining.

Deployment Tip: Always verify EUI byte order (MSB vs. LSB) in your LNS interface, double-check that AppKey is not mistakenly entered into the DevEUI field, and never expose production keys in public screenshots or code repositories.

Regional Parameters & Frequency Plan Configuration

A mismatch between the thermostat hardware band, the gateway channel plan, and the LNS regional parameters is the most common cause of failed OTAA joins. Ensure all three layers match your local ISM band regulations:

  • Supported Regional Bands: E-TOP LoRaWAN thermostats are factory-configured for EU868, US915, AU915, AS923, IN865, or CN470 depending on project destination.
  • LoRaWAN MAC Version: Select LoRaWAN 1.0.3.
  • Regional Parameters Revision: Select RP002-1.0.3 (verify against the exact revision implemented in your thermostat's firmware release rather than inferring solely from the MAC version).
  • Sub-Band Alignment (US915 / AU915): For US915 and AU915 deployments, verify that the end-device firmware, gateway channel configuration, and network server use compatible channel plans and sub-band settings. Confirm the exact sub-band against the thermostat's factory configuration rather than assuming a generic default.

Step-by-Step Setup on ChirpStack v4 and TTN

Because commercial HVAC thermostats are continuously powered (230VAC or 24VAC) and require responsive remote setpoint adjustments, you must explicitly enable Class C operation in your LNS device profile.

Configuring on ChirpStack v4

  1. Create a Device Profile: Navigate to Device Profiles → Add Device Profile. Name it (e.g., ETOP-FTCS08-ClassC), select your Region, set MAC version to LoRaWAN 1.0.3, and select the matching Regional Parameters revision (e.g., RP002-1.0.3).
  2. Enable Class C: Open the Class-C tab inside the Device Profile and toggle Device supports Class-C to ON.
  3. Attach the Codec: Open the Codec tab, select JavaScript functions, and paste the codec script provided below.
  4. Register the Thermostat: Go to Applications → [Your HVAC App] → Add Device. Enter the DevEUI, assign the new Device Profile, and submit. Then open the OTAA keys tab and enter the 32-character AppKey.

Configuring on The Things Network (TTN / TTS v3)

  1. Register End Device: Inside your TTN Application, click Register end device → Enter end device specifics manually.
  2. Set Frequency & MAC: Choose the matching Frequency plan, set LoRaWAN version to LoRaWAN Specification 1.0.3, and select the corresponding RP002 Regional Parameters revision supported by your firmware.
  3. Enable Class C: Expand Show advanced activation, LoRaWAN class and cluster settings, select OTAA, and check Supports class C.
  4. Enter Keys & Formatter: Input the JoinEUI, DevEUI, and AppKey, then complete registration. Navigate to Payload formatters → Uplink / Downlink, choose Custom Javascript formatter, and save the codec script below.

JavaScript Payload Codec (Decoder & Encoder)

The codec below uses ECMAScript 5.1-compatible syntax to support deployment on both ChirpStack v4 (QuickJS) and The Things Stack (ES5.1). Always validate the formatter output using each platform's built-in test environment before production deployment.

This script implements the E-TOP V1.0.0TX Hex protocol with per-function-code payload length validation, additive checksum verification, and three standard entry points: decodeUplink(), encodeDownlink(), and decodeDownlink(). For full byte-level specifications, refer to our LoRaWAN Thermostat Payload Protocol & Hex Decoder Guide.

  • Application Payload FPort: Defaults to FPort 1 for both uplink telemetry and downlink commands (confirm against your specific project firmware if custom FPorts are used).
  • Single-Command Downlink Scope: The example encodeDownlink() function generates one independent Hex command per call. To write multiple parameters simultaneously, implement a 0xA0 batch write frame as defined in the protocol guide.
// E-TOP Controls LoRaWAN Thermostat Codec (Protocol V1.0.0TX)
// ES5.1-compatible for ChirpStack v4 & The Things Stack (TTN v3)

function calcChecksum(arr, len) { var sum = 0; for (var i = 0; i < len; i++) { sum += arr[i]; } return sum & 0xFF; }

function parseRelayMask(mask) { return { low_fan: Boolean(mask & 0x01), medium_fan: Boolean(mask & 0x02), high_fan: Boolean(mask & 0x04), valve_1: Boolean(mask & 0x08), valve_2: Boolean(mask & 0x10) }; }

function decodeUplink(input) { var b = input.bytes; if (!b || b.length < 5) { return { errors: [“Frame too short”] }; } if (b[0] !== 0x55) { return { errors: [“Invalid uplink header (expected 0x55)”] }; }

var funcCode = b[1]; var dataLen = b[2]; if (b.length !== dataLen + 4) { return { errors: [“Frame length does not match declared data length”] }; }

var expectedCs = calcChecksum(b, b.length - 1); if (b[b.length - 1] !== expectedCs) { return { errors: [“Checksum verification failed”] }; }

// Per-function-code expected data length check var expectedLengths = { 0x01: 1, 0x02: 1, 0x03: 1, 0x04: 1, 0x05: 1, 0x06: 2, 0x07: 2, 0x08: 1, 0x09: 2, 0x0A: 1, 0x0B: 1, 0x0C: 1, 0x0D: 1, 0x0E: 1, 0x0F: 1, 0x10: 1, 0xA0: 19 }; if (typeof expectedLengths[funcCode] === “undefined”) { return { errors: [“Unsupported function code: 0x” + funcCode.toString(16)] }; } if (dataLen !== expectedLengths[funcCode]) { return { errors: [“Invalid data length for 0x” + funcCode.toString(16)] }; }

var modes = [“ventilation”, “cooling”, “heating”, “auto”]; var fans = [“auto”, “low”, “medium”, “high”]; var devices = { 1: “C2524”, 2: “E90”, 3: “E60” }; var data = { fPort: input.fPort || 1, function_code: “0x” + funcCode.toString(16).toUpperCase() }; var d = 3; // Data payload start index

switch (funcCode) { case 0x01: data.power = b[d] === 1 ? “ON” : “OFF”; break; case 0x02: data.child_lock = b[d] === 1 ? “locked” : “unlocked”; break; case 0x03: data.operating_mode = modes[b[d]] || “unknown”; break; case 0x04: data.fan_speed = fans[b[d]] || “unknown”; break; case 0x05: data.relay_status = parseRelayMask(b[d]); break; case 0x06: data.room_temp_c = ((b[d] << 8) | b[d + 1]) / 10.0; break; case 0x07: data.setpoint_temp_c = ((b[d] << 8) | b[d + 1]) / 10.0; break; case 0x08: data.keycard = b[d] === 1 ? “inserted” : “removed”; break; case 0x09: data.external_ntc_c = ((b[d] << 8) | b[d + 1]) / 10.0; break; case 0x0A: data.cold_pi_v = b[d] / 10.0; break; case 0x0B: data.heat_pi_v = b[d] / 10.0; break; case 0x0C: data.ec_fan_v = b[d] / 10.0; break; case 0x0D: data.humidity_rh = b[d]; break; case 0x0E: data.control_mode = b[d] === 1 ? “program” : “manual”; break; case 0x0F: data.device_type = devices[b[d]] || (“0x” + b[d].toString(16)); break; case 0x10: data.firmware_version = “V” + (b[d] >> 4) + “.” + (b[d] & 0x0F); break; case 0xA0: // Strictly 19-byte aggregated telemetry block data.power = b[d] === 1 ? “ON” : “OFF”; data.child_lock = b[d + 1] === 1 ? “locked” : “unlocked”; data.operating_mode = modes[b[d + 2]] || “unknown”; data.fan_speed = fans[b[d + 3]] || “unknown”; data.relay_status = parseRelayMask(b[d + 4]); data.room_temp_c = ((b[d + 5] << 8) | b[d + 6]) / 10.0; data.setpoint_temp_c = ((b[d + 7] << 8) | b[d + 8]) / 10.0; data.keycard = b[d + 9] === 1 ? “inserted” : “removed”; data.external_ntc_c = ((b[d + 10] << 8) | b[d + 11]) / 10.0; data.cold_pi_v = b[d + 12] / 10.0; data.heat_pi_v = b[d + 13] / 10.0; data.ec_fan_v = b[d + 14] / 10.0; data.humidity_rh = b[d + 15]; data.control_mode = b[d + 16] === 1 ? “program” : “manual”; data.device_type = devices[b[d + 17]] || (“0x” + b[d + 17].toString(16)); data.firmware_version = “V” + (b[d + 18] >> 4) + “.” + (b[d + 18] & 0x0F); break; }

return { data: data }; }

function encodeDownlink(input) { var cmd = input.data || {}; var frame = [];

// Encodes one independent command per call if (cmd.query_all === true) { // Batch Query All Parameters: AA A0 01 01 4C frame = [0xAA, 0xA0, 0x01, 0x01]; } else if (typeof cmd.power !== “undefined”) { var pwr = (cmd.power === “ON” || cmd.power === 1 || cmd.power === true) ? 0x01 : 0x00; frame = [0xAA, 0x01, 0x02, 0x02, pwr]; } else if (typeof cmd.operating_mode !== “undefined”) { var modeMap = { ventilation: 0x00, cooling: 0x01, heating: 0x02, auto: 0x03 }; if (typeof modeMap[cmd.operating_mode] === “undefined”) return { errors: [“Invalid mode”] }; frame = [0xAA, 0x03, 0x02, 0x02, modeMap[cmd.operating_mode]]; } else if (typeof cmd.fan_speed !== “undefined”) { var fanMap = { auto: 0x00, low: 0x01, medium: 0x02, high: 0x03 }; if (typeof fanMap[cmd.fan_speed] === “undefined”) return { errors: [“Invalid fan speed”] }; frame = [0xAA, 0x04, 0x02, 0x02, fanMap[cmd.fan_speed]]; } else if (typeof cmd.setpoint_temp_c === “number”) { var val = Math.round(cmd.setpoint_temp_c * 10); if (val < 50 || val > 350) return { errors: [“Setpoint out of range (5.0 - 35.0 C)”] }; frame = [0xAA, 0x07, 0x03, 0x02, (val >> 8) & 0xFF, val & 0xFF]; } else { return { errors: [“No supported downlink command specified”] }; }

frame.push(calcChecksum(frame, frame.length)); return { bytes: frame, fPort: input.fPort || 1 }; }

function decodeDownlink(input) { var b = input.bytes; if (!b || b.length < 5 || b[0] !== 0xAA) { return { errors: [“Invalid downlink frame (expected 0xAA header)”] }; } if (b[b.length - 1] !== calcChecksum(b, b.length - 1)) { return { errors: [“Downlink checksum mismatch”] }; } var op = b[3] === 0x01 ? “query” : (b[3] === 0x02 ? “write” : “unknown”); var res = { function_code: “0x” + b[1].toString(16).toUpperCase(), operation: op }; if (b[1] === 0x07 && op === “write” && b.length === 7) { res.setpoint_temp_c = ((b[4] << 8) | b[5]) / 10.0; } return { data: res }; }

Link Verification: End-to-End Uplink & Downlink Testing

After saving the device profile and payload codec, power on the thermostat to initiate the OTAA join sequence. Follow this six-stage verification checklist to confirm complete communication:

Stage Expected Result in ChirpStack / TTN
1. JoinRequest Gateway receives the OTAA join request from the thermostat.
2. JoinAccept Network server authenticates the AppKey and completes the join handshake.
3. Uplink Thermostat transmits its periodic or event-triggered Hex application frame.
4. Decode JavaScript codec parses the raw Hex into valid JSON telemetry without errors.
5. Downlink Platform schedules and transmits the queued Hex command via the gateway.
6. Response Thermostat executes the command and returns an updated status uplink.

Verify the Downlink Queue and Device Response

  • Batch Query Test: Send the raw Hex command AA A0 01 01 4C on FPort 1 (or pass {"query_all": true} to the encoder) to request a full 19-byte 0xA0 telemetry report.
  • Setpoint Write Test: To set the target temperature to 18.0°C, send AA 07 03 02 00 B4 6A (or pass {"setpoint_temp_c": 18.0}).
  • Class C Delivery Behavior: Because the thermostat operates in Class C mode, it can receive eligible downlink messages without waiting for its next scheduled Class A receive window. Actual command delivery and screen update times depend on gateway availability, network-server scheduling, RF conditions, and device firmware processing. Always confirm in your LNS logs that the gateway transmitted the packet and that the thermostat returned a corresponding status uplink.

Need Engineering Support for Your LoRaWAN HVAC Deployment?

Contact E-TOP Controls for FT-CS08 sample kits, full V1.0.0TX protocol documentation, or custom OEM payload structures tailored to your ChirpStack, TTN, or BMS platform.

Request Samples & Technical Docs →
 

Frequently Asked Questions (FAQs)

+ Q1: Can the same JavaScript payload codec run on both ChirpStack v4 and TTN v3?

A: Yes. Although ChirpStack v4 runs QuickJS (ES2020) and The Things Stack (TTN v3) runs ECMAScript 5.1, writing the codec in ES5.1-compatible syntax allows the same decodeUplink, encodeDownlink, and decodeDownlink functions to run on both platforms.

+ Q2: Why does my thermostat fail to join via OTAA on ChirpStack or TTN?

A: The most common causes are: (1) mismatched regional frequency plans, RP002 revisions, or US915/AU915 sub-band settings between the gateway and thermostat, (2) reversed byte order (LSB vs. MSB) when entering DevEUI/JoinEUI, or (3) an incorrect AppKey. Check the gateway's live frames tab to confirm the JoinRequest is reaching the LNS.

+ Q3: What happens if I forget to enable Class C in the Device Profile?

A: If Class C is not enabled in ChirpStack or TTN, the network server will treat the thermostat as a Class A device. Downlink commands (such as remote setpoint changes) will remain queued in the server and will only be transmitted after the thermostat sends its next scheduled uplink, causing noticeable control delays.

+ Q4: How do I test a LoRaWAN downlink command on ChirpStack or TTN?

A: Open the device's Queue (ChirpStack) or Messaging → Downlink (TTN) tab, select FPort 1, and submit either a raw Hex payload (such as AA 07 03 02 00 B4 6A for 18.0°C) or a JSON object handled by your encoder. Then monitor the gateway logs and live events to verify transmission and the thermostat's status uplink response.

+ Q5: How can I integrate decoded LoRaWAN thermostat data into an existing BMS?

A: Once ChirpStack or TTN decodes the Hex frame into JSON, you can forward the data via built-in integrations such as MQTT, HTTP Webhooks, or REST APIs to a middleware layer or protocol gateway, which maps the HVAC data points into BACnet/IP, Modbus TCP, or your facility's BMS dashboard.

+ Q6: Can E-TOP customize the LoRaWAN Hex payload format for our existing IoT platform?

A: Yes. As an OEM/ODM thermostat manufacturer, E-TOP Controls supports custom firmware modifications, including tailored Hex payload structures, custom DevEUI provisioning workflows, and pre-configured regional frequency plans for volume B2B projects.