惯性聚合 高效追踪和阅读你感兴趣的博客、新闻、科技资讯
阅读原文 在惯性聚合中打开

推荐订阅源

小众软件
小众软件
MyScale Blog
MyScale Blog
N
News and Events Feed by Topic
IT之家
IT之家
OSCHINA 社区最新新闻
OSCHINA 社区最新新闻
有赞技术团队
有赞技术团队
T
The Blog of Author Tim Ferriss
The Cloudflare Blog
博客园 - 聂微东
Apple Machine Learning Research
Apple Machine Learning Research
Cyber Security Advisories - MS-ISAC
Cyber Security Advisories - MS-ISAC
美团技术团队
V
Visual Studio Blog
M
MIT News - Artificial intelligence
V
V2EX
博客园_首页
freeCodeCamp Programming Tutorials: Python, JavaScript, Git & More
Blog — PlanetScale
Blog — PlanetScale
F
Full Disclosure
H
Help Net Security
MongoDB | Blog
MongoDB | Blog
博客园 - 叶小钗
S
SegmentFault 最新的问题
博客园 - 三生石上(FineUI控件)
D
Docker
Engineering at Meta
Engineering at Meta
博客园 - Franky
aimingoo的专栏
aimingoo的专栏
Jina AI
Jina AI
N
Netflix TechBlog - Medium
宝玉的分享
宝玉的分享
大猫的无限游戏
大猫的无限游戏
人人都是产品经理
人人都是产品经理
云风的 BLOG
云风的 BLOG
博客园 - 司徒正美
I
InfoQ
G
Google Developers Blog
L
LangChain Blog
F
Fortinet All Blogs
博客园 - 【当耐特】
Hugging Face - Blog
Hugging Face - Blog
H
Hackread – Cybersecurity News, Data Breaches, AI and More
WordPress大学
WordPress大学
A
Arctic Wolf
Martin Fowler
Martin Fowler
G
GRAHAM CLULEY
L
LINUX DO - 热门话题
C
Cisco Blogs
Y
Y Combinator Blog
罗磊的独立博客

DEV Community

Authentication Security Deep Dive: From Brute Force to Salted Hashing (With Java Examples) Why AI Systems Don’t Fail — They Drift Spilling beans for how i learn for exam😁"Reinforcement Learning Cheat Sheet" I Replaced Chrome with Safari for AI Browser Automation. Here's What Broke (and What Finally Worked) How Python Borrows Other People's Work The $40 Architecture: Processing 1 Billion API Requests with 99.99% Uptime Vibe Coding: A Workflow Guide (From Zero to SaaS) Most webhook security guides protect the wrong side. The scary part is delivery. Headless CMS for TanStack Start: Build a Blog with Cosmic EU Age Verification App "Hacked in 2 Minutes" — What Actually Happened Comfy Cloud’s delete function does not actually remove files Running AI Models on GPU Cloud Servers: A Beginner Guide Event-driven media intelligence with AWS Step Functions and Bedrock I scored 500 AI prompts across 8 quality dimensions — here's what broke How to Call Google Gemini API from Next.js (Free Tier, No Backend Needed) The Portal Protocol: Reclaiming Human Connection in the Age of AI How to Fix Your Team's Scattered Knowledge Problem With a Self-Hosted Forum Intro to tc Cloud Functors: A Graph-First Mental Model for the Modern Cloud Designing Multi-Tenant Backends With Both Ownership and Team Access I Built a Neumorphic CSS Library with 77+ Components — Here's What I Learned PostgreSQL Performance Optimization: Why Connection Pooling Is Critical at Scale Cómo construí un SaaS multi-rubro para gestionar expensas en Argentina con FastAPI + Vue 3 🚀 I Built an Ethical Hacking Scanner Tool – Open Source Project I Replaced /usage and /context in Claude Code With a Single Statusline A Pythonic Way to Handle Emails (IMAP/SMTP) with Auto-Discovery and AI-Ready Design I Collected 8.9 Million Polymarket Price Points — Here's What I Found About How Markets Really Move EcoTrack AI — Carbon Footprint Tracker & Dashboard Everyone's Using AI. No One Agrees How. 5 self-hosted ebook managers worth trying in 2026 Building Your First AI Agent with LangChain: From Chatbot to Autonomous Assistant Common SOC 2 Failures (Real World) Stop Vibe-Checking Your AI App: A Practical Guide to Evals How to Use SonarQube and SonarScanner Locally to Level Up Your Code Quality Your Next To-Do App Is Dead — I Replaced Mine with an OpenClaw AI Sign a Nostr event in 60 lines of Python using coincurve — no nostr-sdk, no nbxplorer, no rust toolchain ITGC Audit Explained Like You’re in Big 4 Patch Tuesday abril 2026: Microsoft parcha 163 vulnerabilidades y un zero-day en SharePoint Stop scraping everything: a better way to track competitor price changes Listing on MCPize + the Official MCP Registry while routing payments OUTSIDE the marketplace — how I kept 100% of my x402 revenue Building an AI-Powered Risk Intelligence System Using Serverless Architecture Why We Ripped Function Overloading Out of Our AI Toolchain Testing AI-Generated Code: How to Actually Know If It Works SaaS Churn Is Killing Your Business. Here Is What to Do About It (Without a Support Team) The Speed of AI Is No Longer Linear - And Self-Improving Models Are Why How to Implement RBAC for MCP Tools: A Practical Guide for Engineering Teams From Standard Quote to Persuasive Proposal: AI Automation for Arborists I built a CLI that scaffolds complete multi-tenant SaaS apps Axios CVE-2025–62718: The Silent SSRF Bug That Could Be Hiding in Your Node.js App Right Now The dashboard that ended our friendship Data Pipelines Explained Simply (and How to Build Them with Python) The Hidden Cost of AI Systems Nobody Talks About. undefined vs undeclared, and how typeof behaves Switching from file-based jobs to NATS/Kafka in Rust without changing code io_uring Adventures: Rust Servers That Love Syscalls Why Agentic AI is Killing the Traditional Database The POUR principles of web accessibility for developers and designers Quantum Neural Network 3D — A Deep Dive into Interactive WebGL Visualization How To Install Caveman In Codex On macOS And Windows Automation Pipeline Reliability: Why Your Workflow Breaks When Nobody Is Watching I Built an 'Open World' AI Coding Agent — It Works From ANY Folder From Freelancing to Product: A Tech Service Company's SaaS Transformation China's AI Giants: Adding Tencent Hunyuan & ByteDance Doubao to AI University (74 Providers) On the Vibe Coders and Their Lies clerk: Auto-Summarize Your Claude Code Sessions AI Weekly — 2026/04/10–04/17 | The Model Lockdown Is Here, but the Toolchain Is the Real Battleground AI 週報 — 2026/04/10–2026/04/17 模型封鎖潮來了,但工具鏈才是真戰場 Maybe this is how Open-Source apps are born... 🚀 Fine-Tune LLMs with LoRA and QLoRA: 2026 Guide tRPC v11 + Next.js App Router: End-to-End Type Safety Without the Boilerplate ShadCN UI in 2026: Why I Stopped Installing Component Libraries and Started Owning My Components SaaS Billing in React Server Components: Stripe + Supabase Without a Single `useEffect` Join our DEV Weekend Challenge — $1,000 in Prizes Across TEN winners! Submissions Due April 20 at 6:59 AM UTC. Implementing FSRS Spaced Repetition in Flutter + Supabase — Adding Memory Science to an AI Learning App "I Texted My Localhost From the Train — Claude Code Fixed the Bug Before I Got Home" I Built a Sales Prep AI and It Went Deeper Than Expected Design to Code #2: One JSON, Eleven Outputs Solving the 100M-Row Problem: A Summary Table Pattern for High-Volume Push Notification Logs Flutter Web With Wasm: What Actually Changes For Developers I Built 50 Royalty-Free Soundtracks for My Side Project in a Weekend Using AI Music Generation The Vibe Coding Security Checklist: 7 Things to Check Before You Ship Stop Letting Googlebot Guess Fix Your React App's SEO Right Desconstruindo o Streaming do LinkedIn: Como Criar um Engine de Extração de Vídeo de Alta Performance com HLS e FFmpeg (EDA Part-1) EDA (Exploratory Data Analysis) Explained With Real Life — Why Looking at Your Data Is the Most Important Step in Machine Learning Brand Relationship Management at Scale: Our 4-Touch Outreach System for 200+ Brands Why String.fromEnvironment() Might Return an Empty String in Dart JGuardrails 1.0.0 — Hardening Java LLM Apps Against Jailbreaks, Toxicity, and Prompt Injection Plan and Schedule a Full Week of Threads Content From One Claude Conversation Coding Cat Oran Ep3, Five Tables Changed Everything Updated: BFF Pattern I'm done watching freelancers get buried by 200 proposals. So I'm building the alternative. This is my first post BFS Algorithm in Java Step by Step Tutorial with Examples Tracking LLM Pricing Monthly: An Open Dataset for 22 AI Models How We Measure Content ROI on a Comparison Site: Revenue Attribution Without Perfect Data Introducing Nova AI Ops: The AI-Native Operating System for SRE Teams I built a free desktop video downloader for Windows — Grabbit How Talkie OCR Helps Vision-Impaired & Dyslexic Users Read the World Around Them VRCFaceTracking安装和iPhone面捕配置教程,有bug Even CrowdStrike Can't See Your Agents The Automation Gold Rush: What n8n Workflows and Claude Are Opening Up for Developers Right Now
Beyond Temperature Polling - Designing an Event-Driven Cold Chain Telemetry Stack
applekoiot · 2026-05-06 · via DEV Community

TL;DR

If your cold-chain tracker polls temperature every 10 minutes and ships the raw samples to the cloud, three things will eventually go wrong:

  1. You'll miss sub-interval excursions. A 4-minute spike that peaks mid-interval is simply invisible.
  2. Your payload bill will be dominated by 99.9% non-events. Most of those bytes are money set on fire.
  3. When a claim or audit happens, your "evidence" will be a wall of sample points that no one can navigate. Insurers and regulators want events, not rows.

The fix is not a bigger tracker or a faster radio. It's moving the evidence model from time-series polling to event-driven telemetry — where excursion semantics, dwell thresholds, and idempotent payload design do the heavy lifting at the edge.

I've spent close to two decades inside the IoT hardware industry, specifying radios and arguing with firmware teams about sampling rates. This is the architecture I hand to embedded engineers when they ask "what does a grown-up cold-chain stack actually look like?"

What's wrong with temperature polling

The default design — sample at N minutes, ship samples to server, let the server compute excursions — has three embedded failure modes that firmware engineers keep rediscovering:

1. Sub-interval blindness. A 15-minute sample window can hide a 6-minute thermal spike that still ruins a biologic. The server sees "6.5°C, 6.8°C, 7.2°C" as a smooth drift when the truth was a peak at 12°C between samples.

2. Radio-time cost. On LTE-M or NB-IoT, every transmission is budgeted in mAh — not bytes. Polling-and-ship designs burn battery on quiet intervals where nothing changed.

3. Evidence incoherence. A regulator or insurance adjuster doesn't want samples. They want a structured event: when did the excursion start, what threshold was breached, for how long, and what other signals were correlated?

The five-signal event model

A defensible cold-chain payload describes events, not samples. Five signals form the evidence substrate:

Signal Purpose Typical threshold
Temperature Primary product integrity Product-specific: 2–8°C for vaccines, −20 to −80°C for biologics
Humidity Secondary integrity + condensation risk 40–75% RH for most biologics
Light Unauthorized opening / exposure > 100 lux for > 10s
Shock Mishandling / drop > 5G sustained > 100ms
Location Chain of custody GNSS or cell-tower fix on state change

The key word is correlated. A temperature excursion correlated with a light event is almost always an unauthorized opening. A drift correlated with a location change into a dock yard is a handling issue. A drift correlated with neither is probably the cooling system itself.

Event schema, in JSON

Here's a minimal payload schema that covers 95% of cold-chain event types:

{
  "device_id": "GPT29-00A1",
  "seq": 1847,
  "event_id": "evt_01HQ9X7K2M3N4P",
  "event_type": "temperature_excursion",
  "start_ts": 1776572400,
  "end_ts": 1776573120,
  "duration_s": 720,
  "evidence": {
    "temperature": {
      "threshold": 8.0,
      "peak": 12.4,
      "unit": "celsius",
      "samples_1hz": [8.1, 8.4, 9.1, 10.2, 11.5, 12.4, 11.8]
    },
    "correlated": {
      "light": {"triggered": true, "peak_lux": 450},
      "shock": {"triggered": false},
      "location": {"lat": 41.8781, "lon": -87.6298, "hdop": 1.8}
    }
  },
  "firmware_version": "1.4.2",
  "config_digest": "sha256:3e8f..."
}

Enter fullscreen mode Exit fullscreen mode

Three design choices to notice:

  • seq: monotonically increasing device-local counter. Lets the server detect gaps and enforce ordering without trusting wall-clock time.
  • event_id: ULID. Lets the server be idempotent — re-ingestion of the same event is a no-op, which matters when retries happen during flaky radio conditions.
  • config_digest: hash of the config file on-device at event time. When a regulator asks "what thresholds were configured when this event happened?" the answer is in the event itself, not buried in a deploy log.

Excursion detection at the edge

The detection logic lives on-device. Pseudocode:

# threshold     = configured limit (e.g., 8.0 C)
# dwell_seconds = configured minimum duration to count as an event
# hysteresis    = configured re-entry offset (e.g., 0.5 C)

state = "normal"
excursion_start = None

def on_sample(temp_c, ts):
    global state, excursion_start

    if state == "normal" and temp_c > threshold:
        excursion_start = ts
        state = "pending"

    elif state == "pending":
        if ts - excursion_start >= dwell_seconds:
            emit_event("temperature_excursion", start=excursion_start)
            state = "active"
        elif temp_c <= threshold - hysteresis:
            state = "normal"  # transient, discard

    elif state == "active" and temp_c <= threshold - hysteresis:
        emit_event("temperature_excursion_end", end=ts)
        state = "normal"

Enter fullscreen mode Exit fullscreen mode

Two things matter here:

  • dwell_seconds filters out sensor noise. A 400ms spike from a door-open gust isn't an event. A 4-minute climb is.
  • Hysteresis prevents flapping — the state doesn't flip back to normal until we're comfortably below threshold.

Payload design: batched, idempotent, resumable

Events don't have to ship individually. A practical pattern:

Event buffer (on-device, ring buffer, ~200 events)
  |
  v
On network available OR buffer > watermark:
  POST /ingest with batch of events, ordered by seq
  |
  v
Server ACKs with last seq accepted
  |
  v
Device purges up to last-ACKed seq

Enter fullscreen mode Exit fullscreen mode

The invariant is: an event is persisted on-device until the server has positively acknowledged it. No ACK = no purge. This is how you survive a 14-day ocean crossing with intermittent satellite backhaul, which is a normal scenario for bulk pharma cold chain.

Why this is also a power win

On LTE-M with PSM enabled, the device is asleep 99% of the time, waking on:

  • Sample interval (cheap — no radio, just ADC + MCU)
  • Event emission (medium — short radio burst)
  • Scheduled heartbeat (expensive — full PSM wake + network attach)

If you poll-and-ship every 10 minutes, you're doing a full attach every 10 minutes. If you event-drive, you attach only when something interesting happens, plus a daily heartbeat. On a 10,000 mAh cell with a typical duty cycle, this turns a 14-month battery life into a 5-year battery life. The hardware is the same. The firmware state machine isn't.

What it looks like in dollars

Skipping ahead to the economics (which matter even on Dev.to, because engineers eventually have to defend a budget): a specialty pharma distributor running 200 shipments/month at ~$180K per shipment will typically see losses drop from ~$2.1M/year to ~$380K/year when event-driven, multi-sensor monitoring replaces polling-and-inspect-on-receipt. Annual cost of the monitoring stack for that fleet — hardware amortization, cellular, platform — lands around $340K. The ROI story isn't 5% or 15%. It's ~5× on the first line item alone.

I wrote up the full business-case framework here. The point on Dev.to is that the architecture is what makes those numbers possible. Polling architectures cap the upside at "we noticed after the fact." Event-driven architectures move the intervention window from "on receipt" to t+10 minutes.

Things I'd push back on in a design review

If I joined a cold-chain IoT project tomorrow and saw one of these, I'd stop the review:

  • Polling-only, no on-device event model
  • Single-signal (temperature-only) trackers on high-value biologics
  • No seq or idempotency key — just "POST most recent readings"
  • Config changes deployed OTA without embedding the config digest in subsequent events
  • No hysteresis on excursion detection (you'll see alert storms from sensor noise)
  • Battery budget that assumes continuous radio availability (ocean legs exist)

Takeaways

  1. Move evidence semantics to the edge. Events beat samples.
  2. Design for correlation. Temperature alone is not an evidence class.
  3. Make payloads idempotent with event_id + seq. You will re-deliver; plan for it.
  4. Embed config_digest in every event. Auditors ask, and the answer should be in the data, not in a deploy log.
  5. Event-driven isn't just cleaner — it buys you ~5× battery life on the same hardware.

What's the weirdest cold-chain failure you've debugged? I've watched a light sensor catch a forklift operator leaving a reefer door open for a 15-minute smoke break — that one would never have surfaced from temperature alone. Drop yours in the comments.


This article was written with AI assistance for research and drafting.