Integration & Gateways · Study deck

Sensor Protocol Review for Gateway Translation

A soil sensor probe may expose an analogue voltage, an I²C register, or a LoRaWAN payload even though all three claim to report moisture.

Gateway Gus is your guide for this deck.

communicationprotocolbridging
Gateway Gus, the module guide, in a scene from this chapter.
iotclass.org

After studying this chapter

Learning objectives

You will be able to:

  • build a source review packet covering identity, meaning, timing, and failure
  • resolve byte-order and bus-contention risks before trusting a translated value
  • avoid hiding staleness when converting a raw sample into a normalized record
  • Explain: Some expose named or numbered registers that hold values, status bits, counters, or commands.
iotclass.org

Major section

Overview: The Source Side Decides What a Gateway Can See

Some expose named or numbered registers that hold values, status bits, counters, or commands.

  • A gateway can only translate what the source protocol actually exposes.
  • The trap is that the same numeric value can mean very different things.
  • And some publish self-contained packets or event records.
iotclass.org

Major section

Overview: The Source Side Decides What a Gateway Can See (continued)

A gateway cannot translate a source well if the source meaning is undocumented, and the most common reason a bridge ships wrong data is that nobody wrote down what the source value meant.

  • A reading of 21 might be a temperature, a fault code, a counter, an echo of the last command, or a stale cached value that the device never refreshed.
  • A source-protocol review makes that meaning explicit, so the rest of the IoT system inherits a trustworthy record instead of a guess.
  • The gateway cannot infer that intent from the signal alone.
iotclass.org

Major section

Overview: The Source Side Decides What a Gateway Can See (continued)

The protocol bridge can normalize only what this source review makes explicit: identity, scale, unit, source time, quality, and owner.

  • Each family hands the gateway a different kind of meaning, and each needs a different review.
  • For example, a greenhouse input labelled channel AI-3 might be a 4-to-20 milliamp pressure loop today and a dry-contact alarm after a maintenance change next month.
  • It needs the channel schedule, calibration span, fault-state convention, owner, and change record before the number is safe to normalize.
iotclass.org

Major section

Overview: The Source Side Decides What a Gateway Can See (continued)

The One-Minute View: Know, Infer, Prove Meaning lives at the source A number with no unit, scale, identity, time, or quality is not a measurement yet; the source review supplies that meaning.

  • Know, infer, prove Separate what the gateway directly knows from what it infers, and keep evidence that the inference is safe.
  • Families, not one model Analog, serial, register, and packet sources carry different assumptions; do not review them with one checklist.
  • A register labelled "status" might pack several independent bits, so reading it as a single number quietly merges separate meanings.
iotclass.org

Major section

Practitioner: Classify the Family, Build the Review Packet · Under the Hood: Byte Order, Timing, and Failure Drills

A reviewer must be able to point to the exact physical or logical source.

  • A wrong map or swapped order gives a believable wrong value.
  • Meaning Unit, scale, offset, enumerations, status bits, and what each quality state means.
  • A frozen value is trusted as live.

Key terms

Translation
Translation is not only value conversion; timing and quality decide whether a value can be trusted.

Why it matters

The practitioner workflow starts by classifying the source family, because the family decides what the gateway can read and what evidence the review needs.

iotclass.org

Major section

What the Gateway Can Actually Observe

An analogue input gives the gateway a voltage but usually not a device identity or fault code.

  • I²C supplies addressed register reads on a short local bus, yet the application must still know register types and scales.
  • Modbus adds explicit addresses and exception replies.
  • An I²C no-ack can be labelled as a bus communication fault.

Key terms

Protocol selection
Protocol selection is thus part of the evidence chain.
iotclass.org

Major section

What the Gateway Can Actually Observe (continued)

LoRaWAN carries framed uplinks from a named device, but the payload decoder must recover each field.

  • MQTT may already provide named topics and values, although topic design alone does not guarantee unit, freshness, or trust.
  • A missing LoRaWAN uplink is known only after its expected reporting window passes.
  • Bus sharing changes failure evidence.
iotclass.org

Major section

What the Gateway Can Actually Observe (continued)

A wireless device has link and replay evidence that a direct analogue channel lacks.

  • Sensor probe C sends bytes 02 76 in a LoRaWAN uplink, decoded as hexadecimal 0x0276 = 630, using the same 0.1% scale.
  • Translation must not assign a more precise quality state than the sensor source protocol supports.
  • Sampling behavior also differs.
iotclass.org

Major section

What the Gateway Can Actually Observe (continued)

A steady analogue voltage could be a real reading, a stuck sensor, or an open circuit held by the input electronics.

  • The bridge applies the scale, keeps the radio reception time distinct from any sensor measurement time, and publishes a topic for that sensor probe.
  • A frame-counter repeat should be visible as a possible duplicate rather than treated as a new observation.
  • These checks respect what each sensor protocol can prove.
iotclass.org

Major section

What the Gateway Can Actually Observe (continued)

A polled sensor source lets the gateway choose when to ask, but its register may contain a value measured earlier.

  • For I²C, predict the register value and error when the sensor probe is removed, then check both.
  • Protocol selection is thus part of the evidence chain.
  • A buffered logger can deliver several old samples together.
iotclass.org

Major section

What the Gateway Can Actually Observe (continued)

A bridge designer should record whether identity comes from wiring, bus address, network credentials, or topic naming; whether time comes from the sensor or gateway; and which fault states are observable.

  • Two I²C devices can contend through an address mistake, while several Modbus nodes can share a serial line and fail behind one broken cable.
  • An event-driven sensor chooses when to send and may need a sequence number to reveal loss.
  • That library becomes regression evidence when decoder code, gateway firmware, or the target schema changes.
  • A replacement sensor probe may use the same address but a different calibration date or range.
iotclass.org

Major section

Summary · Key Takeaway

A gateway can only translate what the source protocol exposes, so the source review is where meaning is established and most often lost.

  • The same numeric value can mean a temperature, a fault code, a counter, a command echo, or a stale reading; a source review makes the meaning explicit.
  • A normalized record carries source id, point name, value with unit, separate source and gateway times, an explicit quality state, and a reference to the raw sample and map version.
  • The source boundary decides what a gateway can ever know, so a sensor-protocol review preserves identity, meaning, timing, quality, and failure evidence, not just bytes.
iotclass.org

Deck summary

Key takeaways

Some expose named or numbered registers that hold values, status bits, counters, or commands.

  • A gateway cannot translate a source well if the source meaning is undocumented, and the most common reason a bridge ships wrong data is that nobody wrote down what the source value meant.
  • The protocol bridge can normalize only what this source review makes explicit: identity, scale, unit, source time, quality, and owner.
  • The One-Minute View: Know, Infer, Prove Meaning lives at the source A number with no unit, scale, identity, time, or quality is not a measurement yet; the source review supplies that meaning.
iotclass.org

Retrieval practice

Recall check 1 of 3

Gateway Gus says: answer from memory, then check your reasoning.

Q1A gateway publishes a bare number with no unit, no channel identity, no source time, and no quality flag. What is the core problem?

AThe source meaning is undocumented
BThe number is probably wrong because gateways corrupt values during conversion
CNothing, as long as the dashboard can display the number
DThe gateway should simply pick a unit automatically
Show answer

Answer: A Without recorded meaning, identity, time, and quality, a raw number is ambiguous and cannot be trusted as a measurement.

iotclass.org

Retrieval practice

Recall check 2 of 3

Gateway Gus says: answer from memory, then check your reasoning.

Q2A gateway reads a register and publishes a normalized temperature record. Which evidence best proves the translation is correct?

AOnly the final temperature value and the topic name shown on the dashboard
BThe gateway hostname, adapter version, dashboard URL, and operator account
CRaw sample, point map, scale, byte order, unit, source time, and quality state for that reading
DA successful adapter run with no exception and one screenshot of the published record
Show answer

Answer: C That set lets another reviewer reproduce the translation and judge whether the value is fresh, correctly scaled, and meaningful.

iotclass.org

Retrieval practice

Recall check 3 of 3

Gateway Gus says: answer from memory, then check your reasoning.

Q3A multi-register value is decoded with the wrong word order, so it produces a plausible but incorrect number instead of an error. Why is this more dangerous than a failed read?

AIt is not more dangerous because a wrong value and a failed read are equally easy to detect
BWrong word order should be caught by a numeric range check before the adapter publishes the value
CA plausible wrong value can pass inspection and quietly corrupt decisions, while a failed read is visible
DByte order only affects text fields, so numeric values are protected from this class of error
Show answer

Answer: C Quiet, plausible errors are the hardest to catch, which is why byte order, word order, and signedness must be pinned down and proven with a known sample.

iotclass.org

Print reference

Answers

Answer key.

  1. A · Without recorded meaning, identity, time, and quality, a raw number is ambiguous and cannot be trusted as a measurement.
  2. C · That set lets another reviewer reproduce the translation and judge whether the value is fresh, correctly scaled, and meaningful.
  3. C · Quiet, plausible errors are the hardest to catch, which is why byte order, word order, and signedness must be pinned down and proven with a known sample.
iotclass.org