Download as pdf or txt
Download as pdf or txt
You are on page 1of 70

Building Enterprise IoT Solutions with

Eclipse IoT Technologies: An Open


Source Approach to Edge Computing
1st Edition Frédéric Desbiens
Visit to download the full and correct content document:
https://ebookmeta.com/product/building-enterprise-iot-solutions-with-eclipse-iot-techn
ologies-an-open-source-approach-to-edge-computing-1st-edition-frederic-desbiens/
More products digital (pdf, epub, mobi) instant
download maybe you interests ...

Building Enterprise IoT Solutions with Eclipse IoT


Technologies: An Open Source Approach to Edge Computing
1st Edition Frédéric Desbiens

https://ebookmeta.com/product/building-enterprise-iot-solutions-
with-eclipse-iot-technologies-an-open-source-approach-to-edge-
computing-1st-edition-frederic-desbiens-2/

Connectivity and Edge Computing in IoT Customized


Designs and AI based Solutions Gao

https://ebookmeta.com/product/connectivity-and-edge-computing-in-
iot-customized-designs-and-ai-based-solutions-gao/

IoT System Testing: An IoT Journey from Devices to


Analytics and the Edge 1st Edition Jon Duncan Hagar

https://ebookmeta.com/product/iot-system-testing-an-iot-journey-
from-devices-to-analytics-and-the-edge-1st-edition-jon-duncan-
hagar-2/

IoT System Testing An IoT Journey from Devices to


Analytics and the Edge 1st Edition Jon Duncan Hagar

https://ebookmeta.com/product/iot-system-testing-an-iot-journey-
from-devices-to-analytics-and-the-edge-1st-edition-jon-duncan-
hagar/
Getting Started with Open Source Technologies: Applying
Open Source Technologies with Projects and Real Use
Cases 1st Edition Sachin Rathee

https://ebookmeta.com/product/getting-started-with-open-source-
technologies-applying-open-source-technologies-with-projects-and-
real-use-cases-1st-edition-sachin-rathee/

AWS IoT With Edge ML and Cybersecurity: A Hands-On


Approach 1st Edition Syed Rehan

https://ebookmeta.com/product/aws-iot-with-edge-ml-and-
cybersecurity-a-hands-on-approach-1st-edition-syed-rehan/

AWS IoT With Edge ML and Cybersecurity: A Hands-On


Approach 1st Edition Syed Rehan

https://ebookmeta.com/product/aws-iot-with-edge-ml-and-
cybersecurity-a-hands-on-approach-1st-edition-syed-rehan-2/

5G IoT and Edge Computing for Smart Healthcare 1st


Edition Akash Kumar Bhoi

https://ebookmeta.com/product/5g-iot-and-edge-computing-for-
smart-healthcare-1st-edition-akash-kumar-bhoi/

Chess Explained The c3 Sicilian 1st Edition Sam Collins

https://ebookmeta.com/product/chess-explained-
the-c3-sicilian-1st-edition-sam-collins/
Building Enterprise
IoT Solutions with Eclipse
IoT Technologies
An Open Source Approach to
Edge Computing

Frédéric Desbiens
Building Enterprise IoT Solutions with Eclipse IoT Technologies: An Open Source
Approach to Edge Computing
Frédéric Desbiens
Embrun, ON, Canada

ISBN-13 (pbk): 978-1-4842-8881-8 ISBN-13 (electronic): 978-1-4842-8882-5


https://doi.org/10.1007/978-1-4842-8882-5

Copyright © 2023 by Frédéric Desbiens


This work is subject to copyright. All rights are reserved by the Publisher, whether the whole or part of the
material is concerned, specifically the rights of translation, reprinting, reuse of illustrations, recitation,
broadcasting, reproduction on microfilms or in any other physical way, and transmission or information
storage and retrieval, electronic adaptation, computer software, or by similar or dissimilar methodology now
known or hereafter developed.
Trademarked names, logos, and images may appear in this book. Rather than use a trademark symbol with
every occurrence of a trademarked name, logo, or image we use the names, logos, and images only in an
editorial fashion and to the benefit of the trademark owner, with no intention of infringement of the
trademark.
The use in this publication of trade names, trademarks, service marks, and similar terms, even if they are not
identified as such, is not to be taken as an expression of opinion as to whether or not they are subject to
proprietary rights.
While the advice and information in this book are believed to be true and accurate at the date of publication,
neither the authors nor the editors nor the publisher can accept any legal responsibility for any errors or
omissions that may be made. The publisher makes no warranty, express or implied, with respect to the
material contained herein.
Managing Director, Apress Media LLC: Welmoed Spahr
Acquisitions Editor: Jonathan Gennick
Development Editor: Laura Berendson
Coordinating Editor: Jill Balzano
Cover photo by Szabo Viktor on Unsplash
Distributed to the book trade worldwide by Springer Science+Business Media LLC, 1 New York Plaza, Suite
4600, New York, NY 10004. Phone 1-800-SPRINGER, fax (201) 348-4505, e-mail orders-ny@springer-sbm.
com, or visit www.springeronline.com. Apress Media, LLC is a California LLC and the sole member (owner)
is Springer Science + Business Media Finance Inc (SSBM Finance Inc). SSBM Finance Inc is a Delaware
corporation.
For information on translations, please e-mail booktranslations@springernature.com; for reprint,
paperback, or audio rights, please e-mail bookpermissions@springernature.com.
Apress titles may be purchased in bulk for academic, corporate, or promotional use. eBook versions and
licenses are also available for most titles. For more information, reference our Print and eBook Bulk Sales
web page at http://www.apress.com/bulk-sales.
Any source code or other supplementary material referenced by the author in this book is available to
readers on GitHub.
Printed on acid-free paper
Avec tout ce que je sais, on pourrait faire un livre...
il est vrai qu'avec tout ce que je ne sais pas,
on pourrait faire une bibliothèque.
With everything I know, I could create a book...
and with everything I know not, I could create a library.
—Sacha Guitry, Le KWTZ, in Pièces en un acte

This book is dedicated to the contributors, committers, and project


leads of the Eclipse Foundation. Without your dedication and
commitment to open source, this book would not exist.
Table of Contents
About the Author�����������������������������������������������������������������������������������������������������xv

About the Technical Reviewers�����������������������������������������������������������������������������xvii


Acknowledgments��������������������������������������������������������������������������������������������������xxi

Introduction����������������������������������������������������������������������������������������������������������xxiii

Part 1: Fundamentals and Protocols�������������������������������������������������������������� 1


Chapter 1: What Is IoT?�������������������������������������������������������������������������������������������� 3
IoT and Other Current Trends�������������������������������������������������������������������������������������������������������� 4
Edge Computing and IoT��������������������������������������������������������������������������������������������������������������� 6
IoT Reference Architecture����������������������������������������������������������������������������������������������������������� 9
Common Layers��������������������������������������������������������������������������������������������������������������������� 10
Constrained Devices�������������������������������������������������������������������������������������������������������������� 12
Edge�������������������������������������������������������������������������������������������������������������������������������������� 14
IoT Platforms������������������������������������������������������������������������������������������������������������������������� 16
Protocols: Foundational Building Blocks������������������������������������������������������������������������������������� 20
An Extensive IoT and Edge Toolkit����������������������������������������������������������������������������������������������� 22

Chapter 2: CoAP������������������������������������������������������������������������������������������������������ 25
CoAP: A Slimmer HTTP���������������������������������������������������������������������������������������������������������������� 26
Characteristics���������������������������������������������������������������������������������������������������������������������������� 26
Protocol Stack����������������������������������������������������������������������������������������������������������������������������� 29
Security��������������������������������������������������������������������������������������������������������������������������������������� 31
Eclipse Californium��������������������������������������������������������������������������������������������������������������������� 32
Sandbox Server��������������������������������������������������������������������������������������������������������������������� 33
Getting Started���������������������������������������������������������������������������������������������������������������������� 34
Simple GET Request: Demo��������������������������������������������������������������������������������������������������� 34

v
Table of Contents

Simple GET Request: The Code���������������������������������������������������������������������������������������������� 35


Simple Server: Demo������������������������������������������������������������������������������������������������������������� 37
Simple Server: The Code������������������������������������������������������������������������������������������������������� 38
About DTLS���������������������������������������������������������������������������������������������������������������������������� 40
CoAP and Constrained Devices��������������������������������������������������������������������������������������������������� 42

Chapter 3: LwM2M������������������������������������������������������������������������������������������������� 45
LwM2M: Built on CoAP’s Foundation������������������������������������������������������������������������������������������ 45
Data Model: Objects and Resources������������������������������������������������������������������������������������������� 46
Additional Capabilities over CoAP����������������������������������������������������������������������������������������������� 48
Bootstrap������������������������������������������������������������������������������������������������������������������������������� 49
Client Registration����������������������������������������������������������������������������������������������������������������� 49
Device Management and Service Enablement���������������������������������������������������������������������� 50
Information Reporting������������������������������������������������������������������������������������������������������������ 50
LwM2M Versions������������������������������������������������������������������������������������������������������������������������� 50
LwM2M v1.0 (February 2017)����������������������������������������������������������������������������������������������� 50
LwM2M v1.1 (June 2018)������������������������������������������������������������������������������������������������������ 51
LwM2M v1.2 (November 2020)��������������������������������������������������������������������������������������������� 51
LwM2M Protocol Stack��������������������������������������������������������������������������������������������������������������� 52
Eclipse Leshan���������������������������������������������������������������������������������������������������������������������������� 53
Sandbox Server��������������������������������������������������������������������������������������������������������������������� 54
Quick Test Drive��������������������������������������������������������������������������������������������������������������������� 54
Building Your Client��������������������������������������������������������������������������������������������������������������� 58
Building Your Own Server������������������������������������������������������������������������������������������������������ 61
LwM2M and Constrained Devices����������������������������������������������������������������������������������������������� 63
Working with 6LoWPAN��������������������������������������������������������������������������������������������������������� 65

Chapter 4: MQTT����������������������������������������������������������������������������������������������������� 67
What Is MQTT?���������������������������������������������������������������������������������������������������������������������������� 68
Messages������������������������������������������������������������������������������������������������������������������������������������ 68
Topics and Topic Filters��������������������������������������������������������������������������������������������������������������� 70
Quality of Service������������������������������������������������������������������������������������������������������������������������ 73

vi
Table of Contents

Publish and Subscribe���������������������������������������������������������������������������������������������������������������� 74


Connections and Sessions���������������������������������������������������������������������������������������������������������� 76
Retained Messages��������������������������������������������������������������������������������������������������������������������� 78
Protocol Stack����������������������������������������������������������������������������������������������������������������������������� 79
MQTT-SN������������������������������������������������������������������������������������������������������������������������������������� 80
New Features in MQTT v5����������������������������������������������������������������������������������������������������������� 82
User-Defined Properties�������������������������������������������������������������������������������������������������������� 83
Reason Codes������������������������������������������������������������������������������������������������������������������������ 83
Availability of Optional Features�������������������������������������������������������������������������������������������� 84
Message Expiry��������������������������������������������������������������������������������������������������������������������� 84
Request/Response����������������������������������������������������������������������������������������������������������������� 84
Clean Session������������������������������������������������������������������������������������������������������������������������ 84
Server DISCONNECT�������������������������������������������������������������������������������������������������������������� 85
AUTH Packet�������������������������������������������������������������������������������������������������������������������������� 85
Passwords Without Usernames��������������������������������������������������������������������������������������������� 85
Shared Subscriptions������������������������������������������������������������������������������������������������������������ 85
Flow Control�������������������������������������������������������������������������������������������������������������������������� 86
LWT Delay������������������������������������������������������������������������������������������������������������������������������ 86
Broker Reference������������������������������������������������������������������������������������������������������������������� 87
Security��������������������������������������������������������������������������������������������������������������������������������������� 87
Broker: Eclipse Mosquitto����������������������������������������������������������������������������������������������������������� 88
Installation����������������������������������������������������������������������������������������������������������������������������� 88
Configuration������������������������������������������������������������������������������������������������������������������������� 89
Setting Up TLS����������������������������������������������������������������������������������������������������������������������� 92
Sandbox Servers������������������������������������������������������������������������������������������������������������������� 95
Building Clients with Eclipse Paho���������������������������������������������������������������������������������������������� 96
Java��������������������������������������������������������������������������������������������������������������������������������������� 96
Python����������������������������������������������������������������������������������������������������������������������������������� 98
MQTT and Constrained Devices������������������������������������������������������������������������������������������������ 100
Eclipse Paho Embedded Clients������������������������������������������������������������������������������������������ 100
Zephyr RTOS������������������������������������������������������������������������������������������������������������������������ 101

vii
Table of Contents

Chapter 5: Sparkplug�������������������������������������������������������������������������������������������� 103


Sparkplug and Interoperability�������������������������������������������������������������������������������������������������� 104
Architecture������������������������������������������������������������������������������������������������������������������������������ 106
Sparkplug MQTT Requirements������������������������������������������������������������������������������������������������ 107
Basic Principles������������������������������������������������������������������������������������������������������������������������ 107
Topic Namespace���������������������������������������������������������������������������������������������������������������������� 108
Namespace�������������������������������������������������������������������������������������������������������������������������� 109
Group ID������������������������������������������������������������������������������������������������������������������������������� 109
Message Type���������������������������������������������������������������������������������������������������������������������� 110
edge_node_id���������������������������������������������������������������������������������������������������������������������� 110
device_id����������������������������������������������������������������������������������������������������������������������������� 110
Message Types�������������������������������������������������������������������������������������������������������������������������� 110
Payload Definition��������������������������������������������������������������������������������������������������������������������� 112
Metrics�������������������������������������������������������������������������������������������������������������������������������� 113
Session Management��������������������������������������������������������������������������������������������������������������� 114
Example������������������������������������������������������������������������������������������������������������������������������������ 114
Host Application������������������������������������������������������������������������������������������������������������������� 115
Edge Nodes������������������������������������������������������������������������������������������������������������������������� 115
Devices�������������������������������������������������������������������������������������������������������������������������������� 115
Leveraging Eclipse Tahu����������������������������������������������������������������������������������������������������������� 117

Chapter 6: DDS������������������������������������������������������������������������������������������������������ 121


What Is DDS?���������������������������������������������������������������������������������������������������������������������������� 122
Protocol Stack��������������������������������������������������������������������������������������������������������������������������� 123
Publish and Subscribe�������������������������������������������������������������������������������������������������������������� 125
Global Data Space��������������������������������������������������������������������������������������������������������������������� 128
Domains������������������������������������������������������������������������������������������������������������������������������ 128
Partitions����������������������������������������������������������������������������������������������������������������������������� 129
Quality of Service���������������������������������������������������������������������������������������������������������������������� 130
Data Availability������������������������������������������������������������������������������������������������������������������� 130
Data Delivery����������������������������������������������������������������������������������������������������������������������� 131

viii
Table of Contents

Data Timeliness������������������������������������������������������������������������������������������������������������������� 133


Resources���������������������������������������������������������������������������������������������������������������������������� 133
Configuration����������������������������������������������������������������������������������������������������������������������� 134
Topics���������������������������������������������������������������������������������������������������������������������������������������� 134
Topic Types�������������������������������������������������������������������������������������������������������������������������� 134
Topic Keys, Instances, and Samples������������������������������������������������������������������������������������ 137
Filtering������������������������������������������������������������������������������������������������������������������������������� 137
Reading and Writing Data��������������������������������������������������������������������������������������������������������� 138
Writing��������������������������������������������������������������������������������������������������������������������������������� 139
Reading������������������������������������������������������������������������������������������������������������������������������� 140
Security������������������������������������������������������������������������������������������������������������������������������������� 141
Eclipse Cyclone DDS����������������������������������������������������������������������������������������������������������������� 143
Installation��������������������������������������������������������������������������������������������������������������������������� 143
The Hello World! Sample����������������������������������������������������������������������������������������������������� 147
Cyclone DDS and Robotics�������������������������������������������������������������������������������������������������� 153

Chapter 7: zenoh��������������������������������������������������������������������������������������������������� 155


zenoh Basics����������������������������������������������������������������������������������������������������������������������������� 156
Key Abstractions������������������������������������������������������������������������������������������������������������������ 157
Primitives����������������������������������������������������������������������������������������������������������������������������� 159
Deployment Units���������������������������������������������������������������������������������������������������������������������� 160
Device Discovery����������������������������������������������������������������������������������������������������������������� 162
Example: Robots at the Factory������������������������������������������������������������������������������������������� 163
Plugins�������������������������������������������������������������������������������������������������������������������������������������� 165
Storages Plugin Deep Dive�������������������������������������������������������������������������������������������������� 166
Reliability and Congestion Control�������������������������������������������������������������������������������������������� 167
zenoh-flow�������������������������������������������������������������������������������������������������������������������������������� 168
zenoh Protocol Stack���������������������������������������������������������������������������������������������������������������� 170
Coding with Eclipse zenoh�������������������������������������������������������������������������������������������������������� 171
Installation��������������������������������������������������������������������������������������������������������������������������� 171
Scouting������������������������������������������������������������������������������������������������������������������������������ 178
Subscribing������������������������������������������������������������������������������������������������������������������������� 179

ix
Table of Contents

Publishing���������������������������������������������������������������������������������������������������������������������������� 180
zenoh on Constrained Devices�������������������������������������������������������������������������������������������������� 181
Installation��������������������������������������������������������������������������������������������������������������������������� 182
Zephyr Development Environment�������������������������������������������������������������������������������������� 182
Subscribing������������������������������������������������������������������������������������������������������������������������� 183
Publishing���������������������������������������������������������������������������������������������������������������������������� 184

Part 2: Constrained Devices����������������������������������������������������������������������� 187


Chapter 8: The Hardware�������������������������������������������������������������������������������������� 189
Selection Criteria���������������������������������������������������������������������������������������������������������������������� 189
Power Consumption������������������������������������������������������������������������������������������������������������ 190
Life Cycle����������������������������������������������������������������������������������������������������������������������������� 190
Use Case Requirements������������������������������������������������������������������������������������������������������ 191
Security������������������������������������������������������������������������������������������������������������������������������� 192
Cost������������������������������������������������������������������������������������������������������������������������������������� 193
Microcontrollers������������������������������������������������������������������������������������������������������������������������ 194
Arm: Cortex-M��������������������������������������������������������������������������������������������������������������������� 195
AVR: The Heart of Arduino���������������������������������������������������������������������������������������������������� 198
RISC-V: A Serious Challenger����������������������������������������������������������������������������������������������� 199
Choosing an MCU���������������������������������������������������������������������������������������������������������������������� 201
Sensors and Actuators�������������������������������������������������������������������������������������������������������������� 202
Sensor Characteristics�������������������������������������������������������������������������������������������������������� 202
Making the Connection�������������������������������������������������������������������������������������������������������� 204
Endpoints, Gateways, and Edge Nodes������������������������������������������������������������������������������������� 206
Arm Cortex-A����������������������������������������������������������������������������������������������������������������������� 207
x86-64��������������������������������������������������������������������������������������������������������������������������������� 211
Open Source Hardware������������������������������������������������������������������������������������������������������������� 212
Processor Cores: OpenHW CORE-V Family�������������������������������������������������������������������������� 213
Microcontroller: CORE-V MCU���������������������������������������������������������������������������������������������� 214
Single-Board Computers����������������������������������������������������������������������������������������������������� 214

x
Table of Contents

Chapter 9: Connectivity���������������������������������������������������������������������������������������� 217


Connectivity Options����������������������������������������������������������������������������������������������������������������� 218
Bluetooth����������������������������������������������������������������������������������������������������������������������������� 219
Cellular (LTE, 5G)������������������������������������������������������������������������������������������������������������������ 221
Ethernet������������������������������������������������������������������������������������������������������������������������������� 223
Narrowband������������������������������������������������������������������������������������������������������������������������� 224
Wi-Fi������������������������������������������������������������������������������������������������������������������������������������ 228
Z-Wave�������������������������������������������������������������������������������������������������������������������������������� 229
Zigbee���������������������������������������������������������������������������������������������������������������������������������� 230
Network Design Considerations������������������������������������������������������������������������������������������������ 232
Choice of Protocols�������������������������������������������������������������������������������������������������������������� 232
Confidentiality��������������������������������������������������������������������������������������������������������������������� 232
Resiliency���������������������������������������������������������������������������������������������������������������������������� 234
Redundant Connectivity������������������������������������������������������������������������������������������������������� 235
Out-of-Band Management��������������������������������������������������������������������������������������������������� 236
Connectivity and Constrained Devices�������������������������������������������������������������������������������������� 236
Wi-Fi������������������������������������������������������������������������������������������������������������������������������������ 237
Bluetooth����������������������������������������������������������������������������������������������������������������������������� 238

Chapter 10: Operating Systems���������������������������������������������������������������������������� 243


Are Operating Systems Necessary?������������������������������������������������������������������������������������������ 244
Real-Time Operating Systems�������������������������������������������������������������������������������������������������� 246
Arm Mbed OS���������������������������������������������������������������������������������������������������������������������� 246
FreeRTOS����������������������������������������������������������������������������������������������������������������������������� 250
Zephyr��������������������������������������������������������������������������������������������������������������������������������� 255
Bare Metal Options������������������������������������������������������������������������������������������������������������������� 258
Arduino�������������������������������������������������������������������������������������������������������������������������������� 258
Drogue IoT��������������������������������������������������������������������������������������������������������������������������� 259
Espressif IDF (ESP-IDF)�������������������������������������������������������������������������������������������������������� 261

xi
Table of Contents

Edge Nodes: The Realm of Linux����������������������������������������������������������������������������������������������� 262


Getting Started with Zephyr������������������������������������������������������������������������������������������������������ 263
Linux������������������������������������������������������������������������������������������������������������������������������������ 263
macOS��������������������������������������������������������������������������������������������������������������������������������� 265
Windows������������������������������������������������������������������������������������������������������������������������������ 266

Part 3: Edge Computing and IoT Platforms������������������������������������������������� 269


Chapter 11: Edge Computing�������������������������������������������������������������������������������� 271
What Is Edge Computing?��������������������������������������������������������������������������������������������������������� 272
Edge vs. Cloud��������������������������������������������������������������������������������������������������������������������� 273
The Edge-to-Cloud Continuum�������������������������������������������������������������������������������������������� 273
What Makes the Edge Different?����������������������������������������������������������������������������������������� 275
What Are Edge Native Applications?������������������������������������������������������������������������������������ 277
The Need for EdgeOps�������������������������������������������������������������������������������������������������������������� 278
Edge Computing Platforms������������������������������������������������������������������������������������������������������� 279
Eclipse ioFog����������������������������������������������������������������������������������������������������������������������� 281
Eclipse Kanto����������������������������������������������������������������������������������������������������������������������� 285
Eclipse Kura������������������������������������������������������������������������������������������������������������������������� 288
Kubernetes�������������������������������������������������������������������������������������������������������������������������� 292
Project EVE�������������������������������������������������������������������������������������������������������������������������� 294

Chapter 12: Applications�������������������������������������������������������������������������������������� 297


Application Runtimes���������������������������������������������������������������������������������������������������������������� 298
.NET������������������������������������������������������������������������������������������������������������������������������������� 298
Java SE and Jakarta EE������������������������������������������������������������������������������������������������������� 299
Node.js��������������������������������������������������������������������������������������������������������������������������������� 300
Python��������������������������������������������������������������������������������������������������������������������������������� 302
Rust������������������������������������������������������������������������������������������������������������������������������������� 303
WebAssembly���������������������������������������������������������������������������������������������������������������������� 304
How to Choose Your Runtime���������������������������������������������������������������������������������������������� 304

xii
Table of Contents

Web of Things��������������������������������������������������������������������������������������������������������������������������� 305


Eclipse EdiTDor�������������������������������������������������������������������������������������������������������������������� 306
Eclipse Thingweb���������������������������������������������������������������������������������������������������������������� 308
Digital Twins������������������������������������������������������������������������������������������������������������������������������ 310
Eclipse Ditto������������������������������������������������������������������������������������������������������������������������� 311
How It All Fits Together������������������������������������������������������������������������������������������������������������� 317
A Few Examples of Applications����������������������������������������������������������������������������������������������� 319
Eclipse 4diac����������������������������������������������������������������������������������������������������������������������� 319
Eclipse Keyple��������������������������������������������������������������������������������������������������������������������� 321
Eclipse VOLTTRON���������������������������������������������������������������������������������������������������������������� 322

Chapter 13: Integration and Data������������������������������������������������������������������������� 325


Device Connectivity������������������������������������������������������������������������������������������������������������������� 326
Eclipse Hono������������������������������������������������������������������������������������������������������������������������ 326
Getting Started with Hono��������������������������������������������������������������������������������������������������� 328
Device Management����������������������������������������������������������������������������������������������������������������� 333
Eclipse hawkBit������������������������������������������������������������������������������������������������������������������� 334
Eclipse Kapua���������������������������������������������������������������������������������������������������������������������� 338
Data������������������������������������������������������������������������������������������������������������������������������������������� 341
Eclipse Streamsheets���������������������������������������������������������������������������������������������������������� 342

Chapter 14: Conclusion����������������������������������������������������������������������������������������� 347

Index��������������������������������������������������������������������������������������������������������������������� 351

xiii
About the Author
Frédéric Desbiens manages IoT and edge computing
programs at the Eclipse Foundation. His job is to help the
community innovate by bringing devices and software
together. He is a strong supporter of open source. In the past,
he worked as a product manager, solutions architect, and
developer for companies as diverse as Pivotal, Cisco, and
Oracle. Frédéric holds an MBA in electronic commerce, a
BASc in computer science, and a BEd, all from Université
Laval. After hours, Frédéric will typically read a history book,
play video games, or watch anime.

xv
About the Technical Reviewers
Robert Andres is the Chief Strategy Officer at Eurotech
Group, where he is responsible for driving edge computing,
M2M, and IIoT initiatives within a wide range of markets
and applications. Robert is an active contributor to the
Eclipse IoT and Edge Native Working Groups at the Eclipse
Foundation.

Simon Bernard is a Software Engineer at Sierra Wireless. He is the project lead for the
Eclipse Leshan LwM2M implementation and the Eclipse Wakaama LwM2M client. He is
also a committer on Eclipse Californium and Eclipse tinydtls.

Erik Boasson is Head of Technology at ZettaScale Technology. He is the project lead for
Eclipse Cyclone DDS.

Angelo Corsaro is Chief Executive Officer (CEO) and


Chief Technology Officer (CTO) at ZettaScale Technology.
At ZettaScale, he is working with a world-class team to
change the landscape of distributed computing – working
hard to bring to every connected human and machine the
unconstrained freedom to communicate, compute, and
store – anywhere, at any scale, efficiently and securely.
Angelo is a world top expert in edge/fog computing and

xvii
About the Technical Reviewers

a well-known researcher in the area of high-performance and large-scale distributed


systems. Angelo has over 100 publications on referred journals, conferences, workshops,
and magazines. Angelo has coauthored over ten international standards.

Ian Craggs has been working with MQTT since the early
2000s. He has been involved with the Eclipse Paho open
source project since 2011, contributing an MQTT C client.
Later, he became Paho’s project lead. He worked on the
standardization of MQTT 5.0 and is currently co-chair of
the OASIS MQTT-­SN subcommittee and contributing to the
standardization of Eclipse Sparkplug.

Kilton Hopkins started programming computers when he


was eight years old. He started a software company a few
years later. The world is very different than it was back then,
but Kilton is still bringing new technologies to life. Kilton
is the co-founder and CEO of Edgeworx, a startup that
provides enterprise-scale edge computing. He is the creator
of the Eclipse ioFog open source fog and edge computing
technology. He is a former IoT advisor to the City of San
Francisco and recently served as IoT program director
for the Level program at Northeastern University. Kilton
lives in Berkeley, California. He received his MBA from the
University of Chicago Booth School of Business in 2010.

Kai Hudalla has been working at Bosch on solutions for the


Internet of Things in application domains like smart home,
energy management, e-mobility, and automotive long before
the term reached its recent popularity and ubiquity. He is
an active committer on several Eclipse IoT projects, one of
which is the Eclipse Hono project, aiming at providing an
integration platform for connecting millions of devices to the
cloud. Kai also enjoys speaking at conferences, cooking, and
golfing whenever weather conditions permit.

xviii
About the Technical Reviewers

Thomas Jäckle is a Software Developer holding a master’s


degree in application architecture from the Hochschule
Furtwangen University in Germany and has been working
with Bosch since 2010. Since 2015, he has the position of
Lead Software Developer of the Bosch IoT Things cloud
service, and since 2017, he is Committer and Project Lead of
the Eclipse Ditto project.

Wes Johnson specializes in embedded device software,


cloud computing, and the communication technologies
that connect them together (IIoT, IoT, M2M, SCADA). He
has over 15 years’ experience specializing in the industry.
After graduating from Portland State University with a BS
in computer engineering and physics, he began working at
Arcom Control Systems where he was the primary creator
of what is now the Eclipse Kura OSGi device framework. At
Eurotech, he was Director of Software Engineering and a key
contributor to what is now Eclipse Kapua. He is now VP of
Software for Cirrus Link Solutions where he co-created the
Sparkplug specification and is the project lead for Eclipse
Sparkplug and a co-project lead for Eclipse Tahu.

Achim Kraus is a Senior Software Developer and CoAP/


DTLS 1.2 CID Evangelist. He is the lead of the Eclipse
Californium project. In the past, he worked for Bosch.IO as
a Senior Software Developer. Achim obtained a master’s in
computer science from the University of Stuttgart in 1995.

xix
About the Technical Reviewers

Ulf Lilleengen is a Software Engineer in the Red Hat


Application Services organization, focusing on building
the next-generation services for the Internet of Things. Ulf
has a passion for open source and has participated in open
source communities building software for everything from
microcontrollers to servers for the past 15 years. Ulf lives in
Hamar, Norway, with his two kids, wife, and two dogs.

Rick O’Connor is President and CEO of the OpenHW


Group, a not-for-profit, global organization driven by its
members and individual contributors where HW and SW
designers collaborate in the development of open source
cores, related IP, tools, and SW such as the CORE-V family
of open source RISC-V cores. Previously Rick was Executive
Director of the RISC-V Foundation, which was launched by
him in 2015. Today, under RISC-­V International, the RISC-V
ecosystem consists of more than 400 members building an
open, collaborative community of software and hardware
innovators powering processor innovation. With many years
of executive-level management experience in semiconductor and systems companies,
Rick possesses a unique combination of business and technical skills, and over Rick’s
career, he was responsible for the development of dozens of products accounting for
over $750 million in revenue. Rick holds an Executive MBA degree from the University
of Ottawa, Canada, and is an honors graduate of the faculty of Electronics Engineering
Technology at Algonquin College, Canada.

xx
Acknowledgments
A tender thank you to Roxanne, my wife. She knew how much of my time this project
would require and yet supported me from beginning to end. You truly are the Kaguya to
my Miyuki.
Thank you to everyone at the Eclipse Foundation who supported this book. I am
grateful for the encouragement provided by Mike Milinkovich, our executive director,
and Paul Buck, our VP of ecosystem development and my manager.
Special thanks to Hassan Jaber, my partner in the Eclipse Foundation’s marketing
team. He was crazy enough to ask his wife to read an early draft of the introduction, and
their enthusiastic feedback gave me a much-needed confidence boost.
A round of applause for the technical reviewers who provided feedback on one or
several chapters of this book. Some of them even interrupted their vacations to perform
their review. Talk about dedication!
Thank you to Jill Balzano and Jonathan Gennick from Apress. Jonathan pitched me
the idea of writing this book, and I will forever be grateful for the opportunity.
Finally, how could I forget to mention my dear Ashitaka here? This project is
probably the last large one for my trusty Lenovo ThinkStation S30 from 2012.

xxi
Introduction
It is 1985. A few weeks ago, my father brought a computer from his office. It is an IBM
Portable Personal Computer, model 5155. Portable is relative here; the machine weighed
13.6 kg (30 pounds). My father set it up in the unfinished basement of our home, on an
old kitchen table. Even by the standards of the day, the machine is underpowered. The
simple BASIC programs I wrote barely kept busy its puny 4.77 MHz 8088 CPU. The built-­
in 256 KB of RAM was plenty. My IT career was over ten years in the future.
It is 2015. A few weeks ago, I bought my first Arduino and a few sensors. I set up the
board on my desk. Compared to my desktop computer, with its 3.2 GHz 6-core CPU and
128 gigabytes of RAM, the little Arduino is hopelessly outclassed. And yet, it is without
a doubt the most exciting of the two. The Python programs I write for it are simple. Its
16 MHz 8-bit processor is more capable than the 8088 in the old IBM but can access only
2 KB of RAM. The hardware constraints are severe, but the possibilities are endless.
Between those two moments in my life, the Internet happened. Or rather, it escaped
the realms of Defense and Academia to transform our lives completely. At first, its
impact was limited to our computers; then, it spread its influence on our phones.
Nowadays, it is everywhere. Wherever you go, you will find connected devices that gather
data and interact with the physical world. We call this the Internet of Things (IoT). This
trend is genuine; it is there to stay. This book aims to give you the tools and knowledge
your organization needs to capitalize on it.

Why IoT Is Relevant


No business is purely virtual. The Cloud itself is the aggregation of millions of servers
spread in data centers located worldwide. Those data centers are under constant
monitoring. Sensors for temperature, humidity, air quality, and vibrations ensure the
equipment operates in optimal conditions. Surveillance cameras and other security
systems keep intruders away. So even if your organization focuses strictly on delivering
digital services, it will still benefit from the IoT. The reason for this is simple: our world
now revolves around data.

xxiii
Introduction

Your organization needs data to make better decisions, whether the decider is
artificial intelligence or a human being. Your organization needs data to support the
automation of its processes and improve your quality of life at work. Finally, your
organization needs data to become more efficient and effective. IoT represents a tool to
reach that data. In the words of Marco Carrer, CTO at Eurotech, “There is a tremendous
amount of data that’s actually trapped in the field and why IoT matters is because it
enables the extraction of data.”1
This data, previously, was hard to reach or not reachable at all. What made it
accessible is the tremendous affordability and miniaturization of computing devices.
My little Arduino, which cost about $20 (Canadian!) in 2015, was an order of magnitude
cheaper than the computer I messed around with back in 1985. Moreover, the Arduino is
much more power efficient, making it suitable for all sorts of deployment scenarios.

IoT: For All Industries and Use Cases


The proliferation of low-power, affordable, and connected devices means that you can
build IoT solutions for a wide variety of industries and horizontal use cases.
From an industry perspective, the 2021 edition of the Eclipse IoT and Edge Developer
Survey2 found that Industrial Automation, Agriculture, Building Automation, Energy
Management, and Smart Cities were the respondents' top five industry focus areas.
These industries have in common the need for automation at a large scale and the
potential to benefit from machine learning and artificial intelligence. In a factory,
sensors placed on machines can gather the data needed to schedule preventive
maintenance and prevent equipment breakdowns, for example. On a farm, video
analytics can provide insights into the health of animals, while sensors can detect issues
affecting crop growth. The examples are endless.
There are also many IoT horizontal use cases. Edge AI, where developers deploy
models on servers as close to the source of the data as possible – if not on the IoT
devices themselves – is the most cited example. But control logic, data exchange, and
sensor fusion are other important ones. Event stream processing, which can serve in

1
www.youtube.com/watch?v=EiIIG-LUFUc
2
https://outreach.eclipse.foundation/iot-edge-developer-2021

xxiv
Introduction

algorithmic securities trading, fraud detection, location-based services, and many other
applications, is another generic use case that significantly benefits from the wealth of
data available through IoT devices.

How IoT Projects Are Unique


Most, if not all, IoT projects interact with Cloud-based components and platforms.
However, blindly deploying Cloud Native applications using a standard DevOps
approach outside the confines of the Cloud or the corporate data center is doomed to
fail. Why is that? The Edge environment where IoT devices and Edge infrastructure are
deployed is widely different from the Cloud at a high level.
The Cloud is homogeneous, centralized, and operates at a large scale; resources are
available on demand. On the other hand, the Edge is distributed, heterogeneous, and
operates at a small scale; resource availability is limited. In other words, the Edge is the
polar opposite of the Cloud, which makes IoT projects wildly different.
IoT projects differ from typical IT projects in other ways:
The timescale of IoT projects spans years and even decades. Replacing all of the
sensors in a digital building would be an expensive and lengthy endeavor. Ripping off the
machines from a factory floor is even less frequent.
IoT projects involve heterogeneous hardware and software components. There
is no "one-stop shop" in IoT. Many integrators serve the market, of course, but doing
business with them encapsulates the heterogeneity rather than suppressing it.
IoT components deal with unique constraints. IoT and edge computing nearly
always involve ruggedized hardware. When deploying compute, storage, and networking
resources outside the data center, they face temperature swings, humidity, dust, and
many other dangers. Moreover, many devices need to operate partly or exclusively
over battery power. This impacts the software side of things in many subtle ways. For
example, vibrations could influence sensor readings, and the IoT device needs to
account for that.
Connectivity is a given; stability and reliability are not. The "I" in IoT stands
for "Internet." Although not all IoT solutions operate over the public Internet, they all
leverage various connectivity technologies. IoT developers need to assume that the
network's performance and reliability will vary without warning, which has profound
implications on solution design.

xxv
Introduction

What Makes Enterprise IoT Different?


The gap between enterprise IoT and hobbyist IoT is as significant as the gap between IoT
projects and other IT projects, if not more.
The wealth of affordable hardware and sensors means that anyone can experiment
with IoT at home, especially since many of the software building blocks required are
open source. Arduinos and Raspberry Pis are ideal experimentation platforms, given
their cost and their rich connectivity. One could even make the case that such devices
have replaced yesterday's Commodore 64s and TRS-80 Color Computers as a gateway to
an IT career. However, enterprise IoT projects come with specific requirements. Several
of those requirements stem from the fact that enterprise IoT often deals with mission-­
critical and real-time applications.

• Reliability: The sensors and microcontrollers used need to face


adverse physical conditions over a prolonged period. The devices
themselves may be relatively affordable, but the labor costs involved
to repair or replace them can be onerous, especially in remote
locations. Additionally, some applications may tolerate a level of data
loss, but several do not.

• Sustainability: Hardware component availability and software


component supportability must be compatible with the timescale of
the solution.

• Security: Security is a growing concern for consumers and


organizations alike. The scale of enterprise IoT projects means
that security breaches have much more severe repercussions. They
can even be life-threatening in applications such as industrial
automation and autonomous vehicles.

Open Source: The Best Approach


Enterprise IoT projects must leverage production-grade, commercial-quality hardware
and software components, given the requirements involved. Some could see this as an
obstacle to the adoption of an open source approach. However, nothing could be further
from the truth. At its core, open source is the freedom to access, modify, and redistribute

xxvi
Introduction

source code.3 If you need to maintain a solution over years and decades, then the
possibility to access the source code is valuable. Wish to integrate components from
various vendors? Much more straightforward with the source. Need to tweak a solution's
stack for a particular type of application? The source enables you to do so freely. Open
source is truly the best approach for IoT.
Above everything else, open source is a business model – and a successful one
at that. Over time, any innovation becomes a commodity; the value line is slowly but
relentlessly moving up. The consequence is that organizations of all kinds can reduce
risk and preserve their capacity to innovate by collaborating and pooling resources to
build standard open source components. Such components provide them the proper
foundation to bring to market differentiated commercial solutions. In other words,
leveraging open source building blocks is a powerful way for organizations to focus their
limited resources on competitive endeavors. Open collaboration creates the conditions
for successful competition.

About This Book


This book aims to teach you how to build Enterprise IoT solutions using open source
components. Specifically, it centers on the many libraries and platforms found at the
Eclipse Foundation under the banner of its Eclipse IoT , Edge Native , and Sparkplug
working groups. Eclipse IoT, which celebrated its tenth anniversary in 2021, is the
industry's largest and most successful IoT open source community. Relevant non-­
Eclipse open source projects are discussed as well.
Although the book discusses hardware matters, its focus is on software and related
open standards. If you are an IoT hobbyist, you will learn to apply your skills in an
enterprise context. If you are new to IoT, you will learn about the pros and cons of many
established technologies. Both types of readers will understand how to work with the
Eclipse open source implementations of the most widespread IoT technologies.
Throughout the book, the concepts will be illustrated through examples of real-world
deployments. The examples provided cover a variety of use cases, such as industrial
automation, smart agriculture, digital buildings, connected vehicles, and others.

3
It is, of course, much more than that. See the Open Source Definition proposed by the Open
Source Initiative (OSI) for a thorough discussion.

xxvii
Introduction

This book contains three main parts:

• Fundamentals and Protocols: This part presents the reference


architecture used throughout the book as well as the technologies
common to constrained devices, edge devices, and IoT platforms.

• Constrained Devices: This part discusses picking the hardware and


software components you will deploy in the field.

• Edge Computing and IoT Platforms: This part explains edge


computing itself and why you should rely on it. It also covers edge
workload orchestration and gateways, before introducing several IoT
Cloud platforms based on microservices that expose a well-defined,
stable API. Those platforms are not tied to a specific Cloud provider
and are suited to private, hybrid, or public Cloud environments.

Most chapters contain code samples or step-by-step instructions to get you started
with the components and platforms discussed. I sincerely hope you will find them
helpful.
And now, let's get started!

xxviii
CHAPTER 1

What Is IoT?
Un tas de pierres cesse d'être un tas de pierres dès lors qu'un seul homme le
contemple avec, en lui, l'image d'une cathédrale.
A rock pile ceases to be a rock pile the moment a single man contemplates
it, bearing within him the image of a cathedral.
—Antoine de Saint-Exupéry, Pilote de Guerre (Flight to Arras)

IoT is the culmination of a centuries-long evolution. The origins of innovations like the
wheel and simple machines are today forgotten, lost in the mists of prehistory. Humans
have harnessed the power of water and wind early. Historians trace the origins of the
waterwheel back to ancient Greece, over 3000 years ago; as for the windmill, they started
appearing as we know them today around the 8th and 9th centuries in the Middle
East and Western Asia. In 1712, Thomas Newcomen developed the first commercially
successful steam engine. The 18th century was thus the century of mechanization. The
19th and 20th centuries saw two fundamental technology transitions: electrification and
computerization. By the 1980s, computers started to take over both factories and offices.
Although we can trace its roots back to the 1960s, the Internet took flight in the
early 1990s. It gradually transformed from a document-based platform into a dynamic
application platform. However, the advent of affordable wireless data connectivity at the
same time – mobile broadband Internet access appeared with the second generation
(2G) of mobile connectivity in 1991 – was the decisive advance that made the IoT
possible. 2G, along with Wi-Fi networks and Bluetooth, was a game changer. And while
the term “Internet of Things” was coined by Kevin Ashton in 1999,1 many are still unsure
about its meaning. My goal is to change that.

1
www.smithsonianmag.com/innovation/kevin-ashton-describes-the-internet-
of-things-180953749/

3
© Frédéric Desbiens 2023
F. Desbiens, Building Enterprise IoT Solutions with Eclipse IoT Technologies,
https://doi.org/10.1007/978-1-4842-8882-5_1
Chapter 1 What Is IoT?

To achieve this goal, I will first explain what IoT is and how it is different from other
current technology trends. Second, I will define edge computing and how IoT can
leverage it. I will then introduce an IoT reference architecture that spans constrained
devices, edge nodes, and IoT platforms. Finally, I will discuss IoT protocols, which play a
horizontal role in the architecture and bring the other components together.

IoT and Other Current Trends


Before going any further, let’s try to define IoT itself. Many different definitions are
floating around. Here are a few which I find meaningful:

• Gartner:2 The Internet of Things (IoT) is the network of physical


objects that contain embedded technology to communicate and sense
or interact with their internal states or the external environment.

• Wikipedia:3 The Internet of Things (IoT) describes physical objects


(or groups of such objects) that are embedded with sensors, processing
ability, software, and other technologies, and that connect and
exchange data with other devices and systems over the Internet or
other communications networks.

• Alexander S. Gillis:4 The Internet of Things, or IoT, is a system of


interrelated computing devices, mechanical and digital machines,
objects, animals, or people that are provided with unique identifiers
(UIDs) and the ability to transfer data over a network without
requiring human-to-human or human-to-computer interaction.

While they are a good starting point, the definitions reproduced before do not catch
some nuances I feel are essential. Here are the three main nuances missing from those
definitions:

• The I in IoT means “Network”: Connectivity is a given when working


with the IoT. However, not all deployments rely on carrier networks or the
public Internet. Many narrowband technologies can integrate directly to
a local wired or wireless network without Internet connectivity.

2
www.gartner.com/en/information-technology/glossary/internet-of-things
3
https://en.wikipedia.org/wiki/Internet_of_things
4
https://internetofthingsagenda.techtarget.com/definition/Internet-of-Things-IoT

4
Chapter 1 What Is IoT?

• This is not just about sensors: Most IoT devices can count on an
array of sensors to report the state of the physical world. They can do
much more than just gathering data, however. When equipped with
actuators, IoT devices can accept commands and interact with their
environment. They can turn on lights, adjust the position of a valve,
and increase the speed of a ventilator; the possibilities are endless.

• There is a human element: IoT devices exist in the physical world,


as humans do. There are several use cases where adding human user
interface controls to a device makes sense. In some instances, such
as autonomous forklifts and trucks used in warehouses or around
industrial sites, workers can even use the controls to take over the
vehicle. Orderly coexistence between humans and devices will
become increasingly important.

Given the points I make previously, I feel the following definition is probably the best
compromise:
The Internet of Things (IoT) is a system of networked physical objects that
contain embedded hardware and software to sense or interact with the
physical world, including human beings.
Now that we have a clear understanding of the IoT, let’s disambiguate it from a few
related concepts.

• M2M (machine to machine) communication: This term has been


in use for a while; in fact, Eclipse M2M was the initial name of the
Eclipse IoT working group. The rise of industrial computing saw
machines being connected through point-to-point connections
initially. Nowadays, industrial networks are commonplace in
factories. M2M is a concept rooted in industrial automation and
closely related to operational technology.

• Web of Things: The Web of Things (WoT) is a set of standards


from the World Wide Web Consortium (W3C) that aim to enable
“easy integration across IoT platforms and application domains.”
WoT is strictly focused on software and much narrower in scope
than IoT. The Eclipse Thingweb project is the official reference
implementation of the W3C WoT Working Group.

5
Chapter 1 What Is IoT?

• Industry 4.0: The ongoing digitalization of the industrial sector has


led some to consider that a fourth industrial revolution is underway.
The “Industry 4.0” moniker refers to that. M2M and IoT represent
technological approaches that make possible the automation of
traditional manufacturing and industrial processes. Ultimately,
Industry 4.0 will lead to the widespread adoption of intelligent
machines capable of making their own decisions through artificial
intelligence (AI).

• Industrial Internet of Things (IIoT): This one is relatively


straightforward. IIoT is the application of IoT technologies to
industrial applications, such as manufacturing, asset tracking, and
energy management. IIoT solutions usually replace legacy control
systems intending to improve productivity and efficiency.

Ultimately, IoT devices must send their data somewhere; the commands they
receive must have an origin. The Cloud is typically both the destination of the data
and the source of the commands; whether this Cloud is private, hybrid, or public is
irrelevant. However, connecting IoT devices directly to the Cloud is not always possible
or desirable. For this reason, contemporary IoT solutions often rely on edge computing.

Edge Computing and IoT


Edge computing is a form of distributed computing that brings compute, storage, and
networking resources closer to the physical location where the data is produced and
commands are executed. Its origins go back to the early days of computing. For example,
the consoles used by the mission controllers during the Apollo era were not displaying
live data streamed from the spacecraft. Three antennas in Australia, Spain, and the
United States captured the telemetry and crunched it locally on Univac 1230 mainframes
before forwarding it to the IBM S/360 driving the consoles in Houston. Figure 1-1
illustrates the architecture.

6
Chapter 1 What Is IoT?

Figure 1-1. IT architecture of the Apollo Moon Missions (Credit: Eclipse


Foundation)

What makes edge computing different nowadays is that it does not rely directly
on the Cloud Native and DevOps approaches but rather on adaptations to the Edge
environment such as Edge Native and EdgeOps.
For the time being, I would like to explain why edge computing technologies are so
crucial to successful IoT implementations. Out of the many possible reasons, I think the
following ones are the most compelling:

• Optimize bandwidth usage: The emergence of 5G and affordable


narrowband connectivity options – such as Dash7, LoRaWAN, and
Zigbee – makes the deployment of IoT devices where they are needed
simpler and more affordable. Many IoT use cases generate gigabytes
or even terabytes of data every day. Transmitting the integrality of
that data does not make sense from a cost perspective.

• Reduce latency: The latency on most corporate and industrial


networks is highly variable. Reaching to the Cloud over the public
Internet adds a level of unpredictable latency. Deterministic local

7
Chapter 1 What Is IoT?

area networks provide a way to make latency predictable in a specific


location, but Internet service providers cannot deliver that level of
predictability. Low latency is vital to mission-critical and real-time
uses cases. Suppose you are automating a power plant, a factory, or
a self-driving vehicle. In that case, you cannot afford to have time-­
sensitive decisions made in the far-away Cloud due to the latency
induced by the Internet.

• Support data sovereignty: Data is subject to several layers of laws


and regulations where it is collected, stored, and even processed.
Data sovereignty describes the efforts made by several national
or regional governments to protect the data of their citizens and
corporations. In highly regulated industries, such as healthcare, this
translates into encryption and data residency requirements; the
data must be encrypted on the move and at rest and stored inside
a specific geographical area. This area can be a building, a city, or
maybe a state or province in the case of countries with a federal
structure. Edge computing provides infrastructure that makes it
easier for solutions to implement data sovereignty and data residency
requirements.

• Implement reporting by exception: The value of the data gathered


by devices in IoT solutions is not always the same. It is essential
to process every reading or archive it in a historian database for
future reference for some use cases. For other use cases, the only
readings that matter are those outside the normal thresholds of
operation. In other words, only exceptions are reported. Developers
can implement reporting by exception directly on the device driving
the sensors. However, in scenarios involving complex data models,
machine learning, and video analytics, it is better to offload such
decisions to an edge node in the vicinity. Reporting by exception
is especially useful when devices operate on battery power since it
reduces the need to send data over the network, which is always a
power-hungry operation.

8
Chapter 1 What Is IoT?

The takeaway of this section is this: edge computing is highly beneficial to most IoT
solutions but the simplest one. This explains why the reference architecture places edge
computing front and center.

IoT Reference Architecture


A large part of my job at the Eclipse Foundation is introducing newcomers to our IoT and
edge computing technologies. At the time of writing, this represents over 50 open source
projects of all shapes and sizes. To help developers understand what is available, our
community put together an IoT reference architecture, reproduced in Figure 1-2.

Figure 1-2. IoT reference architecture (Credit: Eclipse Foundation)

One important fact about this diagram is that it does not represent a blueprint. The
Eclipse community is a code-first community where developers come together to build
components and platforms. The reference architecture is a map to the ecosystem they
built, not some grandiose architectural vision that our committers and contributors
followed. That said, let’s have a closer look at each of the significant parts of the
architecture and the related Eclipse open source projects.

9
Chapter 1 What Is IoT?

Common Layers
The reference architecture defines three types of environments: constrained devices,
edge, and IoT platforms. Most of the concepts exist in the scope of these three
environments. However, the architecture contains five concepts that apply across
the three environments. Those are hardware, security, connectivity, protocols, and
development tools.
Hardware strongly influences the design of IoT solutions, especially when
considering constrained devices and edge nodes. IoT developers optimize their code
for size most of the time and strive to keep power consumption to a minimum – at least
for devices operating on battery power. Device designers usually pick microcontrollers
based on power-efficient processor architectures such as Arm for the same reason.
The IoT and edge computing markets are thus much more diverse than the Cloud one,
where servers based on x86-64 still dominate. Additionally, open source hardware has
been growing in popularity recently. For example, the open source RISC-V architecture
saw significant adoption, with 9% of respondents of the 2021 Eclipse IoT and Edge
developer survey stating they are using it and an additional 8% mentioning CORE-V. The
CORE-V family of cores from the OpenHW Group is open source processor designs
based on RISC-V. The Eclipse Foundation and OpenHW Group work closely to build
a comprehensive IoT and Edge open source ecosystem encompassing hardware and
software.
Security is a fundamental concern for IoT developers. Constrained devices and edge
nodes are much more vulnerable than Cloud-based servers since they are deployed in
the physical world. Encrypted communications, data encryption at rest, and root of trust
are just a few of the techniques developers can leverage to protect data and the integrity
of the devices themselves. Many now consider that a zero-trust approach is more secure
since it implies that software never trusts devices by default. There are many aspects to
security, and no single platform or open source project can cover them all. Sticking to
active, well-maintained projects that keep their dependencies up to date will help you
mitigate some of the risks.
Connectivity refers to the wired or wireless networking technologies used by a
solution. The 2021 Eclipse IoT and Edge developer survey found that most developers
leverage mature connectivity options such as Ethernet, Wi-Fi, and Bluetooth. The
growing availability of 5G coverage will probably change things soon. Moreover, many
narrowband technologies such as Dash7, LoRa, and Sigfox are well suited to IoT projects
involving sensor data collection. Zigbee and Z-Wave are also worth mentioning since

10
Chapter 1 What Is IoT?

they use only a fraction of the power required by Wi-Fi. Support for most specialized
connectivity options is usually implemented in a gateway that connects to the Internet –
and thus the Cloud – through a more traditional connection.
Protocols play a critical role in most IoT architectures. Since there is much to say
about them, I will cover them in greater detail later. Always keep the dessert for last!
Finally, development tools are an essential concern for the Eclipse IoT and Edge
community. The traditional Eclipse Integrated Development Environment (IDE) is still
going strong with over six million users. It is widely popular for embedded development,
which makes it a strong choice for IoT developers. The Eclipse CDT and Eclipse
Embedded CDT projects are proof of that, as is the CORE-­V IDE built by the OpenHW
Group team. However, the global trend toward Cloud-based development environments
is also growing in the IoT and Edge market. Eclipse Che, a Kubernetes-Native browser-­
based IDE for developer teams, has seen significant adoption with IoT developers in the
last few years. Eclipse Theia, an extensible cloud and desktop IDE Platform based on
web technologies, is leveraged by Che and a growing set of products such as the Arduino
IDE. Developers can also use a generic version of Theia through Eclipse Theia Blueprint,
a template for building desktop-based products based on the Eclipse Theia platform. It
is worth mentioning that very few of the technologies hosted by the Eclipse IoT and Edge
Native working groups have ties to a specific IDE.

Note Do not confuse the Eclipse IDE and the Eclipse Foundation. IBM open-­
sourced the Eclipse IDE in 2001. The participants to the project created the Eclipse
Foundation in 2004 to be the vendor-neutral steward of the Eclipse IDE. Over time,
the Eclipse Foundation diversified and created several working groups covering
multiple technology areas. The Eclipse IoT working group, for example, celebrated
its 10th anniversary in 2021.
As of writing, the Eclipse Foundation hosted over 425 open source projects and
had four strategic areas: automotive, Cloud Native Java, IoT and edge computing,
and development tools.

11
Chapter 1 What Is IoT?

Constrained Devices
Constrained devices take us back, in a way, to the earlier stages of computing. 32-bit
processors are still typical in them, and they typically have little memory and storage. What
makes them unique is their capacity to operate on battery power for months or even years
and their rich input and output capabilities. Embedded developers have programmed
constrained devices for a very long time. What makes IoT constrained devices different is
that they can connect to the Internet or isolated networks using Internet-class technologies.
While some developers still deploy their constrained device code on the bare
hardware, most of them leverage an operating system (OS) or real-time operating
system (RTOS). There are several options available in the market, both commercial and
open source. The most popular open source options in the 2021 Eclipse IoT and Edge
developer survey were FreeRTOS, Mbed OS, and Zephyr. Linux is also widely adopted,
although it requires more powerful processors and more memory. For developers,
leveraging an OS or RTOS makes much sense since they implement generic low-level
features that their applications can leverage.

Note RTOSes are different from traditional operating systems in two ways: they
are predictable and deterministic. Predictable means that the system will respond
to a specific event within a strict time limit. Deterministic means that the behavior
of the RTOS scheduler can be predicted. In other words, we know how much time
an OS-level operation will take (predictable) and that the result will always be the
same (deterministic).

While operating systems provide developers with a standard application


programming interface (API), working with sensors and actuators often requires custom
code. Moreover, porting an application from one microcontroller to another – or even
just migrating to a different revision – can be cumbersome. This is where hardware
abstraction layers (HAL) come into play. HAL provide a hardware-independent and
OS-independent API that makes applications easier to port. Since the life cycle of
IoT solutions is long, the probability that you will need to port your code to different
hardware or a new version of the RTOS you use is high. Portability is thus a significant
concern. In the Eclipse IoT toolkit, the Eclipse MRAA project provides abstractions
for various boards’ I/O pins and buses (such as the Raspberry Pi), while Eclipse UPM
interfaces with sensors and actuators.

12
Chapter 1 What Is IoT?

Note Some operating systems are pushing abstraction layers to the next level
by enabling developers to pick the kernel that best fits their use case and by
providing uniform higher-level APIs to applications. An excellent example of this
approach is the Oniro project. Oniro can use the Linux, Zephyr, or LiteOS kernels.
It possesses a kernel abstraction layer that uniformizes process and thread
management, memory management, file system, network management, and
peripheral management. Oniro is a compatible implementation for the global
market of OpenHarmony, an open source operating system specified and hosted by
the OpenAtom Foundation.

A critical issue with IoT constrained devices is to keep them up to date. Over time,
vulnerabilities will appear in the code you wrote and the OS you use. Malicious actors
are ready to take advantage of those vulnerabilities to conduct cyberattacks.5 If you are
an IoT developer or aim to become one, it is essential to take security updates seriously.
Some RTOSes and protocols feature built-in update management that will integrate with
a variety of server-side platforms. Eclipse hawkBit is an example of such a platform. The
Eclipse Hara project provides a sample client implementation of the hawkBit APIs that
you could leverage – or at least take inspiration from – on your constrained device. Some
will say, and rightfully so, that a zero-trust approach will help mitigate the dangers posed
by compromised devices. However, malicious actors could use such devices to attack
others, not just your organization. Consequently, having a responsible security posture
is vital.6 This includes offering at least one channel for your customers and end users to
report security vulnerabilities and committing to act once the reports are in your hands.
Lastly are sensors and actuators. Picking the right components can be a complicated
task. In the case of sensors, their precision, durability, and sampling rates are all
critical considerations. As for actuators, they accept an electric signal and combine it
with a source of energy. There are several varieties, including electric, hydraulic, and
pneumatic, among others. Most of the boards featuring microcontrollers available in
the market offer an array of built-in sensors, plus I/O and buses to connect sensors and
actuators.

5
https://www.zdnet.com/article/your-insecure-internet-of-things-devices-are-
putting-everyone-at-risk-of-attack/
6
https://www.zdnet.com/article/the-iot-is-getting-a-lot-bigger-but-security-is-
still-getting-left-behind/

13
Chapter 1 What Is IoT?

Edge
I described edge computing earlier as a form of distributed computing. However, not
all distributed computing is edge computing – even in an industrial context. Modern
edge computing emphasizes the use of microservices deployed in containers or, less
frequently, virtual machines. It also relies on approaches and techniques inspired by
DevOps. Simply having software running on a computer connected to a programmable
logic controller (PLC) driving the machinery is not edge computing.
There are two main types of edge computing nodes: gateways and servers.
Edge servers can run multiple workloads and represent a way to perform workload
consolidation. They can be used to connect to constrained devices or other edge servers.
Gateways, on the other hand, are further classified into IoT gateways and pure edge
gateways. An IoT gateway acts as the focal point for a group of sensors and actuators.
It provides connectivity to these devices to each other and an external network. It
can be a physical piece of hardware or embedded in a network-connected device. An
edge gateway is the connection point between an edge server and the Cloud or a more
extensive network.
Independently of their type, edge nodes usually run an operating system. The 2021
Eclipse IoT and Edge developer survey found that Linux largely dominates on edge
nodes, with Microsoft Windows a strong second. Initiatives such as EVE-­OS, hosted at
LF Edge (Linux Foundation), aim to bring consistent system and orchestration services
to this space on the top of the Linux kernel. The Oniro project, which I previously
mentioned, is also suitable for edge nodes.
Since edge computing relies on microservices, it is necessary to configure, manage,
and coordinate them automatically. This is edge orchestration. While automation is
usually about a single task, orchestration focuses on processes that involve multiple
steps across several services. In the Cloud space, this need for orchestrating workloads
has increasingly been fulfilled by Kubernetes (also known as K8s). However, the
complexity and resource requirements of Kubernetes do not make it a good fit for
several edge use cases. Some open source projects address this issue. K3s is a lightweight
distribution of Kubernetes, packaged as a single binary, that minimizes external
dependencies. KubeEdge, on the other hand, provides a containerized edge computing
platform completed by a Cloud component that integrates with Kubernetes’ API server.
That said, a growing part of the edge developer community prefers to leverage edge
platforms that can integrate with Kubernetes when needed but can operate in stand-­
alone mode. This is the case of the two edge orchestration projects calling the Eclipse

14
Chapter 1 What Is IoT?

Edge Native working group home. Eclipse ioFog focuses on container orchestration
at the edge and represents a centralized take on edge computing since edge nodes
communicate with a central controller. Eclipse fog05 (pronounced fogOS; the 05 is for
5G) supports containers, virtual machines, and even binaries (executables); it manages
nodes in a decentralized fashion by incorporating resources in a unified fabric.

Note For a thorough discussion of whether Kubernetes is a good fit for your
project, you can watch a talk titled “Do We Really Need Kubernetes at the Edge?”
which I delivered in 2021 (https://youtu.be/u8BDtSP7Dfg).

Edge orchestration platforms aim to enable the deployment of edge applications.


Such applications come in all shapes and sizes, cover a wide variety of use cases, and
apply to nearly all industries. The Eclipse IoT working group hosts a few open source
edge applications. Eclipse 4diac provides development tools and a runtime environment
compatible with IEC 61499; in other words, it is a complete toolkit to build bespoke
programable logic controllers to drive industrial equipment. Eclipse Keyple is a widely
adopted solution to build complex contactless ticketing, transportation, and event
access systems. If you ever took the subway or the bus in Paris or bought an SNCF
train ticket from a terminal, you used Keyple without even knowing it. Finally, Eclipse
VOLTTRON is a distributed control and sensing software. VOLTTRON analyzes and
converts digital building data streams into actionable information to improve building
operations, manage energy consumption, and enable building integration with the
electrical grid.
IoT/edge gateways and edge servers have distinct feature sets given their respective
role in the architecture. Gateways are a bridge between constrained devices and
other resources found on the edge-to-cloud continuum. In addition to modern field
connectivity options, they often feature serial ports and other types of legacy interfaces,
enabling organizations to leverage existing assets in the context of the IoT. Because
gateways are a connection point for constrained devices, they frequently offer remote
device management features. One of the longest-running Eclipse IoT projects, named
Eclipse Kura, is a platform for building Linux-based gateways with the Java language and
the OSGi framework. Kura offers API access to the hardware and supports multiple field
protocols, including Modbus, MQTT, OPC UA, and S7. Kura can run edge applications
and orchestrate the workloads, making it a comprehensive solution for gateways.

15
Chapter 1 What Is IoT?

While gateways play a specific role in the architecture, edge servers provide the
resources required to execute workloads. The diagram identifies machine learning
and edge analytics as the two most critical. The whole story is slightly more nuanced,
however. The respondents of the 2021 Eclipse IoT and Edge developer survey identified
artificial intelligence, control logic, data analytics, and sensor fusion as their top edge
computing workloads – in that order. One way or another, edge servers are a powerful
tool to reduce latency for artificial intelligence and machine learning while improving
privacy, especially for solutions deployed in the public space.

IoT Platforms
If constrained devices gather data and edge nodes process it in physical locations close to its
source, one could say that IoT platforms manage and analyze data. However, this statement
expresses only a part of the scope of IoT platforms. They also provide the infrastructure to
run applications that leverage the data and integration features that link constrained devices
and edge nodes to the rest of the infrastructure managed by corporate IT.
The first group of concepts related to IoT platforms in our architecture pertains to
data. Data is integral to IoT. Sensors create it, and actuators execute commands that are
the consequence of data-driven decisions. In that context, machine learning (ML) is an
essential capability for IoT platforms since it aims to transform raw data into knowledge.
Developers can leverage many popular open source machine learning frameworks, such
as TensorFlow and scikit-­learn. Some ML frameworks have even been designed from the
ground up for deployment at the edge; this is the case with TensorFlow Lite and Apache
MXNet. There are several ML-related projects at the Eclipse Foundation. The most
mature and widely adopted is Eclipse Deeplearning4j. Deeplearning4j is a suite of tools
for running deep learning on the JVM. It allows developers to train their models using
the Java language and provides interoperability with the Python ecosystem.
Analytics is another word to describe the use of data analysis tools and procedures.
There is a thriving market of solutions in that space, both proprietary and open source.
Bruce Sinclair distinguishes three classes of analytics:7

• Real time: Analytics performed as soon as the data is acquired to


bring anomalies to light.

7
See this episode of the “The IoT Inc Business Show” podcast for more details. https://www.iot-
inc.com/three-main-classes-internet-of-things-data-analytics-podcast/

16
Chapter 1 What Is IoT?

• Predictive: Analytics looking at current and historical data to


produce a prediction and confidence level.

• Descriptive: Analytics that report on past, present, or future data and


are often the basis of visualizations.

Eclipse Streamsheets is a platform to access, create, and manage server-based


spreadsheets that consume, process, and produce real-time data streams. Those
spreadsheets can contain several types of graphs in addition to numerical data, enabling
users to create interactive dashboards. Streamsheets supports several IoT protocols out
of the box.
Data management considers data a valuable resource and provides governance,
tools, and methods to access, integrate, cleanse, and store it. Data management is a
vast functional domain covering database management systems, big data systems, data
warehouses, and data lakes. Data modeling is also a paramount concern since models
are helpful abstractions developers leverage when building software. The Eclipse Kapua
project provides a modular IoT platform with solid data management features. Kapua
users can also perform IoT analytics by building dynamic dashboards.
Let’s now focus on integration, the second group of concepts specific to IoT
platforms in our reference architecture. The three concepts in this group are data
integration, device connectivity, and device management. It is worth mentioning that
Eclipse Kapua implements all three concepts and offers streamlined integration with
gateways running Eclipse Kura.
Data integration is the process of creating unified sources of information from
multiple data sources. The wide variety of data management technologies and
approaches makes data integration a critical function in the architecture. Of course,
models and data sharing frameworks are also an essential part of data integration since
it is rather challenging to consolidate data if it is not expressed in a standardized and
consistent way. The Eclipse Dataspace Connector project provides an interoperable
framework for data sharing built on a common identity model. It will implement the
International Data Spaces standard (IDS) and the GAIA-­X European project’s protocols.
Another relevant project is Eclipse Thingweb, an implementation of the Web of Things
(WoT) model proposed by the World Wide Web Consortium (W3C). WoT aims to provide
standard metadata and APIs to make possible integration across IoT platforms and
application domains. If WoT is your thing, you may also want to look at Eclipse EdiTDor,
a tool to create and edit WoT artifacts that is available online.

17
Chapter 1 What Is IoT?

While networks and protocols provide a basic level of device connectivity, deploying
an IoT solution at scale typically requires connecting to many constrained devices.
Moreover, those devices will likely come from different providers and will not necessarily
use the same protocols – whether by constraint or because of a design decision. Eclipse
Hono provides remote service interfaces to interact with IoT devices in a protocol-­
agnostic way. Devices can send telemetry and event messages to Hono to report sensor
readings; applications can send command messages to the devices. Behind the scenes,
Hono supports the AMQP, CoAP, HTTP, and MQTT protocols, and developers can build
custom protocol adapters as needed.
At its core, device management covers the operation and maintenance of devices.
An IoT platform needs to maintain a device registry and record each device’s update
history to achieve this. Since IoT devices are so varied in their hardware, configurations,
and capabilities, many of the features of device management platforms used to
control computers and mobile devices are not needed in the context of IoT. However,
a robust software update delivery back end is a must. The most advanced solutions
support partial downloads and enable devices to resume interrupted file transfers.
Eclipse hawkBit, a domain-independent back-end framework for rolling out software
updates to constrained devices, provides that and much more. In particular, hawkBit’s
Device Management Federation (DMF) API makes it possible to leverage the device
management features in protocols that include them, such as Lightweight M2M
(LwM2M).
Ultimately, applications are the reason why IoT platforms need to gather data and
provide integration capabilities. Deploying constrained devices in the field is a means
to an end, providing the infrastructure required by applications. The Eclipse ecosystem
provides application runtimes and API management capabilities. Moreover, the ioFog
and fog05 edge computing platforms implement the core principles of EdgeOps, an
evolution of the DevOps approach specifically targeted at edge environments.
The 2021 Eclipse IoT and Edge developer survey found that for IoT platforms, the
top three languages favored by developers are Python (22%), Java (18%), and JavaScript
(16%). But what about runtimes? In the case of Python, the Python interpreter is the
runtime; for JavaScript, Node.js is the most popular one. But what about Java? In the
last few years, the Java ecosystem saw the Eclipse Foundation become its nexus. This
started with the creation of the Microprofile project, which is a platform definition that
optimizes Enterprise Java for a microservices architecture. The trend continued with
Oracle contributing Java Enterprise Edition and other technologies to Eclipse; they

18
Chapter 1 What Is IoT?

are now thriving under a new name: Jakarta EE. At the end of 2020, the OSGi Alliance
announced it would transition to the Eclipse Foundation. OSGi is a popular dynamic
module system for Java that has seen significant adoption in the IoT market, with Eclipse
Kura as one of the most prominent adopters. Then, in early 2021, the AdoptOpenJDK
initiative became the Adoptium working group at Eclipse. Eclipse Temurin is the name of
the OpenJDK distribution from Adoptium. The Eclipse Foundation is the home of Cloud
Native Java, and several of the IoT platforms I already discussed use the technology.

Note A common misconception about Eclipse open source projects is that the
Foundation mandates using the Java programming language and the Eclipse
Public License (EPL). There are no such restrictions. Projects are free to leverage
the languages of their choice. As for licensing, while using the EPL v2.0 is possible,
projects can also pick the Apache 2.0, MIT, and BSD licenses if they wish. Dual
licensing is also possible, and the EPL v2.0 even supports using the General Public
License (GPL) version 2.0 or later as a secondary license.

From a general perspective, API management is a way to create, publish, and


monitor the runtime performance of service interfaces. In most cases, API management
platforms enforce usage policies and access control. In the last few years, the concept
of digital twins has grown in popularity in the IoT market. A digital twin is simply a
virtual representation of a physical device or asset updated from real-time data. The
Eclipse Ditto project provides synchronous and asynchronous APIs to interact with
digital twins and performs resource-based access checks on each API call. Ditto is thus
an API management platform focused on digital twins. Moreover, it performs state
management; Ditto keeps track of the reported, desired, and current state of the devices
it monitors and takes care of publishing state changes.
Finally, there is EdgeOps. Maybe you are asking yourself why we needed such a thing
when DevOps transformed how we build, deploy, and monitor software. The answer
is simple. A pure DevOps approach will not work outside the Cloud or the corporate
data center. Of course, containerized microservices are essential at the edge, as is
infrastructure as code. The close collaboration between development and operations is
also a huge advantage, whether your organization merged the teams or not. However,
many IoT and Edge deployments have strict real-time requirements or assume a
mission-critical role. In that context, continuous integration and delivery (CI/CD) must
consider the environment’s constraints. This fact explains why I wrote that EdgeOps is
19
Chapter 1 What Is IoT?

an adaptation of DevOps to the edge earlier. What makes ioFog and fog05 so powerful as
edge computing platforms is that their contributors built them from the ground up for
the edge. They are an embodiment of EdgeOps.
There is one Eclipse project I didn’t mention yet that you should be aware of: Eclipse
Arrowhead. Arrowhead is a framework enabling developers to build, design, implement,
and deploy automation Systems of Systems. From an IoT point of view, you can use it to
orchestrate the various components of an IoT platform. It even provides several valuable
services, such as an event handler, a device registry, and a device manager.
Now that we have completed our tour of the reference architecture, let’s circle back
to protocols. They are what brings constrained devices, edge nodes, and IoT platforms
together.

Protocols: Foundational Building Blocks


Developers coming to IoT and Edge from the Cloud world sometimes assume that HTTP
and REST, those Swiss knives of the modern microservice builder, are all they need.
This is, of course, a mistake. IoT and Edge devices operate in an environment where
reducing battery drain and bandwidth usage is vital. Because of that, many solutions use
UDP as their transport rather than TCP (although many IoT-specific protocols support
both). There is also a greater variety of topologies and interaction models at the edge.
Device meshes are frequent in IoT projects, and the same is true of publish/subscribe
interactions. The consequence of this is that there are many IoT-specific protocols
available. Some of them, such as MQTT and OPC UA, have even been around for over
20 years. Compared to the protocols traditionally used in industrial automation, such as
Modbus and Profinet, modern IoT protocols are more secure and can be routed safely
over the public Internet. Consequently, most Cloud IoT middleware supports them.
Current IoT protocols leverage one of two main interaction models: request/
response or publish/subscribe. In the request/response model, a client establishes
a connection to a specific server, sends a request, and eventually gets a response –
synchronous or not. HTTP is a typical example of the request/response model. In the
publish/subscribe model, senders (publishers) are entirely decoupled from receivers
(subscribers). Publishers send messages to a specific location, and subscribers
will receive messages sent to that location if they register to get them. As a result,
publishers are not aware if there are subscribers or not. MQTT is the most widely used
implementation of the publish/subscribe model.

20
Chapter 1 What Is IoT?

At the time of writing, there were 11 IoT and edge protocol implementation projects
at the Eclipse Foundation. Eight of them implement standards under the jurisdiction of
external standards bodies. They are listed in Table 1-1.

Table 1-1. Implementations of protocols under external jurisdiction


Protocol Organization Model Eclipse Projects

Constrained Application Internet Engineering Request/Response Eclipse Californium


Protocol (CoAP) Task Force (IETF)
Data Distribution DDS Foundation (Object Publish/Subscribe Eclipse Cyclone DDS
Service (DDS) Management Group)
Lightweight M2M OMA SpecWorks Request/Response Eclipse Leshan
(LwM2M) Eclipse Wakaama
OPC UA OPC Foundation Request/Response Eclipse Milo
Publish/Subscribe
MQTT OASIS Open Publish/Subscribe Eclipse Amlen
Eclipse Mosquitto
Eclipse Paho

In addition, there are three protocol implementations completely under the


governance of the Eclipse Foundation. Those are detailed in Table 1-2.

Table 1-2. Protocols under the governance of the Eclipse Foundation


Protocol Model Eclipse Projects

Production Performance Data format only Eclipse Unide


Management Protocol (PPMP)
Sparkplug Publish/Subscribe Eclipse Sparkplug Specification
Eclipse Tahu
zenoh Publish/Subscribe Eclipse zenoh

21
Chapter 1 What Is IoT?

Of those three, only Sparkplug is managed under the Eclipse Foundation


Specification Process for the time being. This process, which complements the Eclipse
Development Process, defines the open source rules of engagement, the organizational
framework, and the workflow for specification projects at the Eclipse Foundation. Eclipse
specification projects are working in the open in a transparent, vendor-neutral fashion.
Anyone can propose changes to the specifications by opening an issue or submitting a
pull request on the specifications’ public repository. Whether those proposals will be
considered or not is up to the committers of the specification project.
With so many options to choose from, picking the most suitable protocol for your
solution could look like a daunting task. Here are a few questions to ask yourself to guide
your choice:

• What am I trying to achieve? If you are simply gathering sensor


data, a publish/subscribe protocol is probably the best option.
Request/response protocols are a better fit for commands – at least if
you have real-time requirements.

• What are my constraints? Some protocols are a better fit to optimize


throughput; others help in reducing latency or power consumption.
Do not blindly trust the assertions of others and test yourself!

• What is my ecosystem? You could pick sensors, actuators, or other


hardware and then use the protocols they support. Conversely, you
could pick a protocol and then shop for suitable products. Either way,
you will define the boundaries of your ecosystem.

An Extensive IoT and Edge Toolkit


Our tour of the reference architecture and the Eclipse Foundation’s IoT and Edge
ecosystem ends here. As you can see, the toolkit at your disposal is quite extensive.
Arnold Vogt, Lead IoT and Digital Transformation Analyst at Pierre Aucoin Consultants,
wrote about it in a report: “From our point of view, the Eclipse Foundation’s IoT Working
Group is undoubtedly the leading open source IoT community. It’s no surprise to us that
our two best-in-class vendors are part of that community.”8

8
You can download the report, titled Open Digital Platforms for the Industrial World in Europe
2021, here: https://outreach.eclipse.foundation/pac-radar-research-iot-open-source

22
Another random document with
no related content on Scribd:
“Get it yourself,” the hobo flung back.
The right fist of the ranchman lifted swiftly. It did not move far, but it
carried great power back of it. The tramp’s head snapped backward.
His shoulders hit the sand. He had been caught on the point of the
jaw by a knock-out punch.
Tug came back to consciousness under the impression that he was
drowning in deep waters. Cig was dipping a can in the creek and
sousing its contents over his head. He sat up dizzily. His uncertain
gaze fell on some one who had arrived since his exit from activity.
She was a young woman on horseback. He noticed that she was
slender and had a good seat. Her dark eyes watched him.
Who was she? What the dickens was she doing here? Where was
he anyhow?
His glance swept the scene. York was stamping out the last embers
of the fire. There was a bruise on Cig’s cheek and one of his eyes
was rapidly closing. From the fact that Forbes was examining
abraded knuckles it was an easy guess that he had been in action.
The rancher, hands in coat pockets, relieved his mind in regard to
the youth he had knocked out. “You’re a good-for-nothing loafer, not
fit to live in a country that treats you too well. If I had charge of
wastrels like you, I’d put you on the rock-pile and work you to a
frazzle. What use are you, to yourself or any one else? When you
were needed to fill a uniform, I’ll bet a dollar you were a slacker. You
still are. A worthless, rotten-to-the-core hobo. Now get up and get off
my land or I’ll give you that thrashing you need.”
Tug got up, swayed unsteadily on his feet, and lurched forward. In
his eyes, still dull and glazed from the shock his nervous system had
endured, a gleam of anger came to life. He was a slacker, was he?
All right. He would show this arrogant slave-driver that he could
stand up and take all he had to give.
His rush was a poor leaden-footed shuffle, for he was shaky at the
knees and weights dragged at his feet. The blow he aimed at Reed
missed the brown face half a foot. It was badly timed and placed.
The ranchman’s counter caught him flush on the cheekbone and
flung him back.
Again he gathered himself and plunged forward. Clinton Reed
belonged to the old fighting West. He had passed through the rip-
roaring days of Leadville’s prime and later had been a part of Cripple
Creek’s turbid life. Always he had been a man of his hands. He
punished his dazed opponent with clean hard blows, most of them
started at short range to save his own fists from the chance of
broken or dislocated bones.
The tramp fell into a clinch to get time for recovery. Reed jolted him
out of it with a short arm left below the chin and followed with two
slashing rights to the face.
The hobo was in a bad way. In ring parlance, he was what is known
as groggy. His arms moved slowly and without force back of the
blows. His knees sagged. There was a ringing in his head. He did
not seem able to think clearly.
But the will in him functioned to push him to more punishment. He
attacked feebly. Through a weak defense the ranchman’s driving
arms tore cruelly.
Tug went down again. He tried to rise, but in spite of the best he
could do was unable to get up. The muscles of the legs would not
coöperate with the will.
Some one in khaki riding-breeches flashed past him. “That’s enough,
Dad. I don’t care if he was impudent. You’ve hurt him enough. Let
him go now.”
The figure was the boyish one of the equestrienne, but the high
indignant voice was feminine enough.
“S’pose you try minding your own business, Bess,” her father said
quietly.
“Now, Dad,” she expostulated. “We don’t want any trouble, do we?
Make ’em move on, and that’s enough.”
“Tha’s what we’re doin’, Betty,” explained the foreman. “It ain’t our
fault if there’s a rookus. We told ’em to light out, an’ they got sassy.”
Tug rose with difficulty. He was a badly hammered hobo. Out of
swollen and discolored eyes he looked at the ranchman.
“You quite through with me?” he snarled.
It was a last growl of defiance. His companions were already
clambering with their packs out of the wash to the bank above.
“Not quite.” Clint Reed took his daughter by the shoulders and spun
her out of the way when she tried to stop him. “Be fresh if you want
to, my young wobbly. I reckon I can stand it if you can.” He whirled
the tramp round and kicked him away.
“Oh, Dad! Fighting with a tramp,” the girl wailed.
Tug swung round unsteadily, eyes blazing. He took a step toward the
rancher. His glance fell on the girl who had just called him a tramp,
and in saying it had chosen the last word of scorn. Her troubled,
disdainful gaze met his fully. The effect on him was odd. It paralyzed
action. He stopped, breathing hard.
She had called him a tramp, as one who belongs to another world
might do—a world that holds to self-respect and decency. He had
read in her voice utter and complete contempt for the thing he was. It
was a bitter moment. For him it stamped the low-water mark of his
degradation. He felt beneath her eyes a thing unclean.
What she had said was true. He was a tramp. He had ridden the
rods, asked for hand-outs, rough-housed with hoboes, slept with
them. He had just been thoroughly thrashed and kicked before her.
What was the use of resenting it? He had become declassed. Why
should he not be kicked and beaten? That was the customary way to
treat his kind of cattle.
Tug swung heavily on a heel and followed his companions into the
willows.
CHAPTER III
ONE OF THE LOST LEGION

Among the lost legion are two kinds of men. There are those who
have killed or buried so deep the divine fire of their manhood that for
them there seems no chance of recovery in this world. There are
those in whom still burns somewhere a faint candle that may yet
flame to a dynamic glow of self-respect.
The young tramp slouching along the bank of Willow Creek drank
deep of the waters of despair. The rancher had called him a slacker,
rotten to the core. It was a true bill. He was a man spoiled and
ruined. He had thrown away his life in handfuls. Down and dragging,
that’s what he was, with this damned vice a ball and chain on his
feet.
There was in him some strain of ignoble weakness. There must be,
he reasoned. Otherwise he would have fought and conquered the
cursed thing. Instead, he had fought and lost. He could make
excuses. Oh, plenty of them. The pain—the horrible, intolerable pain!
The way the craving had fastened on him before he knew it while he
was still in the hospital! But that was piffling twaddle, rank self-
deception. A man had to fight, to stand the gaff, to flog his evil
yearnings back to kennel like yelping dogs.
His declension had been swift. It was in his temperament to go fast,
to be heady. Once he let go of himself, it had been a matter of
months rather than of years. Of late he had dulled the edge of his
despair. The opiates were doing their work. He had found it easier to
live in the squalid present, to forget the pleasant past and the
purposeful future he had planned.
But now this girl, slim, clean, high-headed, with that searing
contempt for him in her clear eyes, had stirred up again the devils of
remorse. What business had he to companion with these
offscourings of the earth? Why had he given up like a quitter the
effort to beat back?
In the cold waters of the creek he washed his swollen and
bloodstained face. The cold water, fresh from the mountain snows,
was soothing to the hot bruised flesh even though it made the
wounds smart. He looked down into the pool and saw reflected there
the image of himself. Beneath the eyes pouches were beginning to
form. Soon now he would be a typical dope fiend.
He was still weak from the manhandling that had been given him.
Into an inside coat pocket his fingers groped. They brought out with
them a small package wrapped in cotton cloth. With trembling hands
he made his preparations, bared an arm, and plunged the
hypodermic needle into the flesh.
When he took the trail again after his companions, Tug’s eyes were
large and luminous. He walked with a firmer step. New life seemed
to be flowing into his arteries.
Where the dusty road cut the creek he found the other tramps
waiting for him. Their heads had been together in whispered talk.
They drew apart as he approached.
Taking note of Cig’s purple eye and bruised face, Tug asked a
question. “Was it the big foreman beat you up?”
“You done said it, ’bo,” the crook answered out of the side of his
mouth.
“I reckon you got off easy at that,” Tug said bitterly. “The boss bully
didn’t do a thing to me but chew me up and spit me out.”
“Wotcha gonna do about it?” Cig growled significantly.
The young fellow’s glance was as much a question as his words.
“What can I do but take it?” he asked sullenly.
Cig’s eyes narrowed venomously. He lifted his upper lip in an ugly
sneer. “Watch my smoke. No roughneck can abuse me an’ get away
with it. I’ll say he can’t.”
“Meaning?”
“I’m gonna fix him.”
Tug’s laughter barked. “Did you fix him when you had a chance?” he
asked ironically.
“Call that a chance? An’ the big stiff wide as a door. ’F I’d had a gun
I’d ’a’ croaked him.”
“Oh, if!”
“De bulls frisked me gun in Denver. But I’ll get me a gat
somewheres. An’ when I do—” The sentence choked out in a snarl
more threatening than words.
“Sounds reasonable,” Tug jeered.
“Listen, ’bo.” Cig laid a hand on the sleeve of the young fellow’s coat.
“Listen. Are youse game to take a chance?”
Eyes filled with an expression of sullen distaste of Cig looked at him
from a bruised and livid face. “Maybe I am. Maybe I ain’t. What’s on
your mind?”
“I’m gonna get that bird. See?”
“How?”
“Stick around an’ gun him. Then hop a freight for ’Frisco.”
There was in the lopsided face a certain dreadful eagerness that was
appalling. Was this mere idle boasting? Or would the gangster go as
far as murder for his revenge? Tug did not know. But his gorge rose
at the fellow’s assumption that he would join him as a partner in
crime.
“Kill him without giving him a chance?” he asked.
Again there was a sound like the growl of a wild beast in the throat of
the Bowery tough. “Wotcha givin’ me! A heluva chance them guys
give us when they jumped us. I’ll learn ’em to keep their hands off
Cig.” He added, with a crackle of oaths, “The big stiffs!”
“No!” exploded Tug with a surge of anger. “I’ll have nothing to do with
it—or with you. I’m through. You go one way. I’ll go another. Right
here I quit.”
The former convict’s eyes narrowed. “I getcha. Streak of yellow a
foot wide. No more nerve than a rabbit. All right. Beat it. I can’t lose
you none too soon to suit me.”
The two glared at each other angrily.
York the peacemaker threw oil on the ruffled waters. “’S all right,
’boes. No use gettin’ sore. Tug he goes one way, we hit the grit
another. Ev’rybody satisfied.”
Tug swung his roll of blankets across a shoulder and turned away.
CHAPTER IV
BETTY RIDES

Betty Reed had watched unhappily the young tramp shuffle into the
willows and disappear. She felt depressed by a complex she could
not analyze. In part it was shame, for her father, for this tramp who
looked as though he were made for better things, for the whole
squalid episode; in part pity, not wholly divorced from admiration at
the boy’s insolence and courage. He might be a wastrel, as her
father had said. He might be a ne’er-do-well. But by some sure
instinct she knew that there had been a time when he fronted with
high hope to the future. That momentary meeting of the eyes had
told her as much.
Something had killed him as surely as a bullet fired through the
heart. The boy he had been was dead.
Lon Forbes chuckled. “They’ll keep going, I reckon, now they’ve
found out this ain’t no Hotel de Gink. You certainly handed that
youngest bum his hat, Clint. I’ll say you did.”
Now that it was over Reed was not very well satisfied with his
conduct. The hobo had brought the punishment on himself. Still—
there was something morally degrading about such an affray. One
can’t touch pitch without paying the penalty.
“We’ll begin cutting this field to-morrow, Lon,” he said shortly. “Hustle
the boys up so’s to finish the mesa to-day.” Across his shoulder he
flung a question at the girl. “You going to town, Bess?”
“In an hour or so. Want me to do something?” she asked.
“Call at Farrell’s and see if he’s got in those bolts I ordered.”
The ranchman strode to the car followed by Forbes. The foreman
was troubled by no doubts. His mind functioned elementally. If
hoboes camped on the Diamond Bar K and made themselves a
danger to the crops, they had to be hustled on their way. When they
became insolent, it was necessary to treat them rough. That was all
there was to it.
Betty swung to the saddle and rode back to the house. She was
returning from an inspection of a bunch of two-year-olds that were
her own private property. She was rather well off in her own right, as
the ranch country counts wealth. The death of her uncle a year
before had left her financially independent.
As Betty cantered into the open square in front of the house, her
father and the foreman were getting out of the car. A chubby, flaxen-
haired little lass came flying down the porch steps a-quiver with
excited delight.
“Oh, Daddy, Daddy, what d’you fink? I went out to the barn an’—
an’—an’ I fink Fifi’s got puppies, ’cause she—she—”
“Thought I told you to stay away from the barn,” the ranchman
chided.
His harsh voice dried up the springs of the child’s enthusiasm. She
drew back as though she had been struck. From the winsome, wee
face the eager, bubbling delight vanished, the enchanting dimples
fled. The blue eyes became wells of woe. A small finger found the
corner of the Cupid’s-bow mouth.
Clint Reed, ashamed and angry at himself, turned away abruptly.
Little Ruth was the sunshine of his life, the last pledge of his dead
wife’s love, and he had deliberately and cruelly wounded her.
Swinging from the saddle, Betty ran to the porch. Her arms enfolded
the child and drew her tenderly close. “Ruthie, tell big sister all about
it,” she whispered gently.
“D-d-d-daddy—” the sobbing little girl began, and choked up.
“Daddy’s worried, dear. He didn’t mean to hurt your precious little
feelings. Tell Betty about Fifi’s puppies, darling.”
Through her tears and between sobs Ruth told her great news.
Presently she forgot to weep and was led to the scene of Fifi’s
amazing and unique triumph. She gave little squeals of delight when
Betty handed her a blind little creature to cuddle in spite of the
indignant mother’s protesting growls. The child held the warm white-
and-brown puppy close to her bosom and adored it with her eyes.
With reluctance she returned it at last.
Ruth’s happiness was quite restored after her sister had given her a
glass of milk and a cookie and sent her out to play.
The young woman waved her a smiling good-bye and went to work.
She had some business letters to write and she went to the room
that served her as a library and office. The sound of the typewriter
keys drifted out of the open window for an hour or more.
The girl worked swiftly. She had a direct mind that found fluent
expression through the finger-tips. When she knew what she wanted
to say, it was never any trouble for Betty Reed to say it. A small pile
of addressed and sealed letters lay in the rack on the desk before
she covered the machine.
These she took with her.
Clint Reed she found tinkering with a reaper that had gone
temporarily out of service.
“Want anything more, Dad? I’m going now,” she said.
“You’ve got that list I left on the desk. That’s all, except the bolts.”
The sky was a vault of blue. Not even a thin, long-drawn skein of
cloud floated above. A hot sun baked down on the dusty road over
which Betty traveled. Heat waves danced in front of her. There was
no faintest breath of breeze stirring.
The gold of autumn was creeping over the hills. Here and there was
a crimson splash of sumac or of maple against the almost universal
yellow toning. It seemed that the whole landscape had drunk in the
summer sunshine and was giving it out now in a glow of warm
wealth.
The girl took a short cut over the hills. The trail led by way of draw,
gulch, and open slope to the valley in which Wild Horse lay. She
rode through the small business street of the village to the post-
office. Here she bought supplies of the storekeeper, who was also
post-master.
Battell was his name. He was an amiable and harmless gossip. Wild
Horse did not need a newspaper as long as he was there to hand
tobacco and local information across the counter. An old maid in
breeches, Lon Forbes had once called him, and the description
serves well enough. He was a whole village sewing circle in himself.
At a hint of slander his small bright eyes would twinkle and his
shrunken little body seem to wriggle like that of a pleased pup. Any
news was good news to him.
“Mo’ning, Miss Betty. Right hot, I’ll tell the world. Ninety-nine in the
shade this very minute. Bart Logan was in to get Doc Caldwell for his
boy Tom. He done bust his laig fallin’ from the roof of the root house.
Well, Bart was sayin’ your paw needs help right bad to harvest his
wheat. Seems like if the gov’ment would send out some of these
here unemployed to work on the ranches it would be a good idee.
Sometimes Congress acts like it ain’t got a lick o’ sense.”
Betty ordered coffee, sugar, tobacco, and other supplies. While he
waited upon her Battell made comment pertinent and impertinent.
“That Mecca brand o’ coffee seems to be right popular. Three
pounds for a dollar. O’ course, if it’s for the bunkhouse— Oh, want it
sent out to the Quarter Circle D E. How’re you makin’ it on your own
ranch, Miss Betty? Some one was sayin’ you would clean up quite a
bit from your beef herd this year, mebbe twelve or fifteen thousand. I
reckon it was Bart Logan.”
“Is Bart keeping my books for me?” the girl asked dryly.
The storekeeper cackled. “Folks will gossip.”
“Yes,” she agreed. “How much is that corn meal a hundred?”
“Cost you ten cents more’n the last. Folks talk about cost of livin’
coming down. Well, mebbe ’tis an’ mebbe ’tain’t. I told Bart I wouldn’t
believe you’d cleared any twelve or fifteen thousand till I heard you
say so. That’s a lot of money, if any one asks you.”
Apparently Betty misunderstood him. “Yes, you’re high, but I’ll take
two sacks. Send it to the Quarter Circle and charge it to me.”
Betty stopped at the railroad station to ask the agent about a
shipment of goods her father was expecting, and from there went to
Farrell’s to find out about the bolts.
It was well on toward noon when she took the road for home. At
Four-Mile Crossing it intersected the railroad track. A man with a
pack on his back was plodding along the ties in the direction of Wild
Horse. The instant her eyes fell on him, the girl recognized the tramp
her father had beaten. The pallid face was covered with wheals and
bruises. Both of the sullen eyes were ringed with purple and black.
They met face to face. Full into hers his dogged gaze challenged.
Without a word they passed.
Betty crossed the grade and followed a descent to a small grove of
pines close to the road. The sun was so hot that she decided to
dismount and give the pony a breathing spell.
From the saddle she swung, then trailed the reins and loosened the
cinch.
A sound brought her head round sharply. Two men had come over
the brow of a little hill silently. One of them was almost at her elbow.
A twisted, malevolent grin was on his lips. He was the hobo Lon
Forbes had thrashed two or three hours ago.
“Welcome to our city, goil,” he jeered in choice Boweryese. “Honest
to Gawd, you knock me dead. Surest thing you know. We’ll treat you
fine, not like your dad an’ that other big stiff did us. We’ll not tell
youse to move on, m’ dearie. Nothin’ like that.”
The girl’s heart felt as though drenched in ice-cold water. She had
not brought with her the small revolver she sometimes carried for
rattlesnakes. Both instinct and observation told her this man was vile
and dangerous. She was in his power and he would make her pay
for what her father had done.
She trod down the fear that surged up in her bosom. Not for nothing
had she been all her life a daughter of the sun and the wind and
wide outdoor spaces.
“I stopped to rest my pony from the heat of the sun,” she explained.
“You stopped to see old Cig,” he corrected. “An’ now you’re here it’ll
be him an’ you for a while. The hop-nut don’t belong to de same
push as us no longer. I shook him. An’ York don’t count. He’s no
lady’s man, York ain’t.”
The slim girl in the riding-suit could not quite keep the panic out of
her eyes. None of the motives that swayed the men she knew would
have weight with him. He was both base and bold, and he had lived
among those who had small respect for a woman.
Betty’s glance moved to York. It found no comfort there. The gross
hobo was soft as putty. He did not count, as his companion had
openly sneered.
“No. I won’t stop,” she said, and made as though to tighten the
loosened cinch.
“Won’cha? Think again, miss. Old Cig ain’t seen a skirt since he left
li’l’ old New York. Sure as youse is a foot high he’s hungry for a
sweetie of his own.”
He put his hand on her arm. At the touch her self-control vanished.
She screamed.
The man’s fingers slid down to the wrist and tightened. His other
hand clamped over her mouth and cut off the cry.
She writhed, twisting to free herself. In spite of her slenderness she
was strong. From her lips she tore his hand and again called for help
in an ecstasy of terror.
The crook of his arm garroted her throat and cut off the air from her
lungs. He bent her body back across his hip. Still struggling, she
strangled helplessly.
“Youse would, eh?” His voice, his narrowed eyes, exulted. “Forget it,
miss. Cig’s an A1 tamer of Janes. That’s de li’l’ old thing he’s de
champeen of de world at.”
He drew her closer to him.
There came a soft sound of feet thudding across the grass. The arm
about Betty’s throat relaxed. She heard a startled oath, found herself
flung aside. Her eyes opened.
Instantly she knew why Cig had released her. The man stood
crouched, snarling, his eyes fixed on an approaching runner, one
who moved with the swift precision of a half-back carrying a ball
down a whitewashed gridiron.
The runner was the tramp whose face her father had battered to a
pulp. He asked for no explanations and made no comment. Straight
for the released convict he drove.
Cig had not a chance. The bad air and food of the slums, late hours,
dissipation, had robbed him of both strength and endurance. He held
up his fists and squared off, for he was game enough. But Tug’s fist
smashed through the defense as though it had been built of paper.
The second-story man staggered back, presently went down before
a rain of blows against which he could find no protection.
Tug dragged him to his feet, cuffed him hard with his half-closed fist
again and again, then flung him a second time to the ground. He
stood over the fellow, his eyes blazing, his face colorless.
“Get up, you hound!” he ordered in a low voice trembling with anger.
“Get up and take it! I’ll teach you to lay hands on a woman!”
Cig did not accept this invitation. He rolled away, caught up York’s
heavy tramping stick, and stood like a wolf at bay, the lips lifted from
his stained yellow teeth.
“Touch me again an’ I’ll knock your block off,” he growled,
interlarding the threat with oaths and foul language.
“Don’t!” the girl begged of her champion. “Please don’t. Let’s go.
Right away.”
“Yes,” agreed the young fellow, white to the lips.
York flat-footed forward a step or two. “No use havin’ no trouble. Cig
he didn’t mean nothin’ but a bit of fun, Tug. Old Cig wouldn’t do no
lady any harm.” The tramp’s voice had taken on the professional
whine.
Tug fastened the girth, his fingers trembling so that he could hardly
slip the leather through to make the cinch. Even in the reaction from
fear Betty found time to wonder at this. He was not afraid. He had
turned his back squarely on the furious gangster from the slums to
tighten the surcingle. Why should he be shaking like a man in a chill?
The girl watched Cig while the saddle was being made ready. The
eyes in the twisted face of the convict were venomous. If thoughts
could have killed, Tug would have been a dead man. She had been
brought up in a clean world, and she did not know people could hate
in such a soul-and-body blasting way. It chilled the blood only to look
at him.
The girl’s rescuer turned to help her into the saddle. He gave her the
lift as one does who is used to helping a woman mount.
From the seat she stooped and said in a low voice, “I want you to go
with me.”
He nodded. Beside the horse he walked as far as the road. “My
pack’s back there on the track,” he said, and stopped, waiting for her
to ride away.
Betty looked down at him, a troubled frown on her face. “Where are
you going?”
A bitter, sardonic smile twitched the muscles of the bruised face. He
shrugged his shoulders.
“Looking for work?” she asked.
“Maybe I am,” he answered sullenly.
“We need men on the Diamond Bar K to help with the harvest.”
“The ranch where I was kicked off?”
“Father’s quick-tempered, but he’s square. I’ll talk with him about you
—”
“Why waste your time?” he mocked mordantly. “I’ll not impose on
him a good-for-nothing loafer, a worthless rotten-to-the-core hobo, a
slacker, a wastrel who ought to be on a rock-pile.”
“Dad didn’t mean all that. He was angry. But if you don’t want to work
for him, perhaps you’d work for me. I own a ranch, too.”
He looked up the road into the dancing heat waves. She was
wasting pity on him, was she? No doubt she would like to reform
him. A dull resentment burned in him. His sulky eyes looked into
hers.
“No,” he said shortly.
“But if you’re looking for work,” she persisted.
“I’m particular about who I work for,” he told her brutally.
She winced, but the soft dark eyes were still maternally tender for
him. He had fought for her, had saved her from a situation that held
at least degradation and perhaps horrible despair. Moreover, young
though he was, she knew that life had mauled him fearfully.
“I need men. I thought perhaps—”
“You thought wrong.”
“I’m sorry—about Father. You wouldn’t need to see him if you didn’t
want to. The Quarter Circle D E is four miles from the Diamond Bar
K.”
“I don’t care if it’s forty,” he said bluntly.
Her good intentions were at an impasse. The road was blocked. But
she could not find it in her heart to give up yet, to let him turn himself
adrift again upon a callous world. He needed help—needed it
desperately, if she were any judge. It was written on his face that he
was sailing stormy seas and that his life barque was drifting toward
the rocks. What help she could give she must press upon him.
“I’m asking you to be generous and forget what—what we did to
you,” she pleaded, leaning down impulsively and putting a hand on
his shoulder. “You saved me from that awful creature. Isn’t it your
turn now to let me help you if I can?”
“You can’t help me.”
“But why not? You’re looking for work. I need men. Wouldn’t it be
reasonable for us to get together on terms?” Her smile was very
sweet and just a little wistful, her voice vivid as the sudden song of a
meadow-lark.
Under the warmth of her kindness his churlishness melted.
“Good of you,” he said. “I’m much obliged. But it’s no use. Your
father had the right of it. I’m not any good.”
“I don’t believe it. Your life’s got twisted somehow. But you can
straighten it. Let me help. Won’t you? Because of what you did for
me just now.”
Her hand moved toward him in a tentative offer of friendship.
Automatically his eyes recorded that she wore a diamond ring on the
third finger. Some lucky fellow, probably some clean young man who
had given no hostages to vice, had won her sweet and gallant heart.
She was all eager desire and sympathy. For a moment, as he looked
into the dusky, mobile face that expressed a fine and gallant
personality, it seemed possible for him to trample down the vice that
was destroying him. But he pushed this aside as idle sentiment. His
way was chosen for him and he could not go back.
He shook his head and turned away. The bitter, sardonic smile again
rested like a shadow of evil on his good-looking face.
CHAPTER V
TUG IS “COLLECTED”

Tug followed the rails toward Wild Horse.


He groped in an abyss of humiliation and self-disgust. Slacker! The
cattleman’s scornful word had cut to the quick. The taste of it was
bitter. For he had not always been one. In war days he had done his
share.
How was it McCrae’s poem ran?

“We are the Dead. Short days ago


We lived, felt dawn, saw sunset glow,
Loved and were loved, and now we lie
In Flanders fields.

“Take up our quarrel with the foe:


To you from failing hands we throw
The torch; be yours to hold it high.
If ye break faith with us who die
We shall not sleep, though poppies grow
In Flanders fields.”

Yes, he had kept the faith in France, but he was not keeping it now.
The obligation was as binding on him in peace as on the battle-field.
He knew that. He recognized it fully. But when the pain in his head
began, his mind always flew to the only relief he knew. The drug had
become a necessity to him. If the doctors had only let him fight it out
from the beginning without help, he would not have become
accustomed to the accursed stuff.
But what was the use of going over that again and again? He was
done for. Why send his thoughts forever over the same treadmill?
The flaming sun poured down into the bowl of the valley and baked
its contents. He moved from the track to the shade of a cottonwood
and lay down. His racing thoughts grew more vague, for the hot sun
had made him sleepy. Presently his eyes closed drowsily. They
flickered open and slowly shut a second time. He began to breathe
deeply and regularly.
The sun passed the zenith and began to slide down toward the
western hills. Still Tug slept.
He dreamed. The colonel was talking to him. “Over the top, Hollister,
at three o’clock. Ten minutes now.” He shook himself out of sleep. It
was time to get busy.
Slowly he came back blinking to a world of sunshine. Two men stood
over him, both armed.
“Must be one of ’em,” the shorter of the two said.
“Sure thing. See his outfit. All rags. We’ll collect him an’ take him
back to the ranch.”
They were cowboys or farmhands, Tug was not sure which. He knew
at once, however, that their intentions were not friendly.
“What do you want?” he asked.
“You,” the short, stocky one answered curtly. He wore a big broad-
rimmed hat that was both ancient and dusty.
“Interesting. You a sheriff? Got a warrant for me?”
The little man raised the point of his thirty-eight significantly. “Ain’t
this warrant enough?”
“What’s the trouble? What d’you want me for?”
“Tell him, Dusty,” the lank cowboy said.
“All right, Burt.” To the tramp he said roughly: “We’ll learn you how to
treat a lady. Get up. You’re gonna trail back to the Diamond Bar K
with us.”
“You’ve got the wrong man,” explained Tug.
“Sure. You’re jus’ travelin’ through the country lookin’ for work,”
Dusty jeered. “We’ve heard that li’l’ spiel before. Why, you chump,
the ol’ man’s autograph is writ on yore face right now.”
Tug opened his mouth to expostulate, but changed his mind. What
was the use? He had no evidence. They would not let him go.
“I guess you hold the aces.” He rose, stiffly, remarking to the world at
large, “I’ve read about those three-gallon hats with a half-pint of
brains in them.”
Dusty bridled. “Don’t get gay with me, young feller. I’ll not stand for
it.”
“No?” murmured the hobo, and he somehow contrived to make of
the monosyllable a taunt.
“Just for that I’ll drag you back with a rope.”
Dusty handed his weapon to the other cowboy, stepped to his horse,
and brought back a rope. He uncoiled it and dropped the noose over
the tramp’s head, tightening it around his waist.
The riders swung to their saddles.
“Get a move on you,” Dusty ordered, giving the rope a tug. The other
end of it he had fastened to the horn of the saddle.
Tug walked ahead of the horses through the sand. It was a long hot
tramp, and Dusty took pains to make it as unpleasant as possible. If
the prisoner lagged, he dragged him on the ground, gibing at him,
and asking him whether he would insult another woman next time he
got a chance.
The cowpuncher found small satisfaction in the behavior of the man
at the other end of the rope. The ragged tramp neither answered his
sneers nor begged for mercy. He took what was coming to him
silently, teeth clamped tight.
At last Burt interfered. “That’ll be about enough, Dusty. The old
man’s gonna settle with him. It’s his say-so about what he wants
done to this guy.” He added, a moment later: “I ain’t so darned sure

You might also like