SlideShare a Scribd company logo
Building your own IoT Agent
1
Building your own IoT Agent: overview
§ Frameworks: Node.js and C++
• https://github.com/Fiware/iot.IoTagent-node-lib
• https://github.com/telefonicaid/fiware-IoTAgent-Cplusplus
§ North bound features provided by the platform:
• NGSI Context Provision server
• NGSI Client
• Device Provisioning API
• Configuration API
§ All South bound features are protocol specific
• External library
• Ad-hoc development
2
Building your own IoT Agent: Node.js
§ Module provided in NPM Registry:
• Add iotagent-node-lib to your package.json
• Require it as any other module
§ https://github.com/telefonicaid/iotagent-node-lib/blob/master/doc/howto.md
§ Possible in few days/weeks:
• Current agents: ~ 1000 lines of source code (supporting several transport protocols)
3
Context Server
NGSI Client
Device
Protocol
Device
Registry
Group
Registry
Provision Server
IoT Agent
Building your own IoT Agent: CoAP + JSON
4
§ CoAP: Constrained Application Protocol
• RESTful protocol designed from scratch
• Transparent mapping to HTTP
• Binary protocol
□ Low parsing complexity
□ Small message size
• Security based on DTLS (TLS/SSL for Datagrams)
• IETF Standard: https://tools.ietf.org/search/rfc7252
GET	/status/power
PUT	/control/color	#00FF00
Building your own IoT Agent: CoAP + JSON
5
APPLICATION
TRANSPORT
SIMPLIFIED OSI
NETWORK
LINK
PHYSICAL
CoAP
UDP
IoT Device
JSON
IoT Agent
UDP
IPv4
TCP
CoAP
JSON
HTTP
NGSI/REST
TCP
CONTEXT BROKER
IPv4
HTTP
NGSI /REST
§ Protocol translation
Building your own IoT Agent: CoAP + JSON
§ Active attributes reporting
• POST coap://{iot_agent_ip}/iot/coap
{
“deviceId": " #00FF00",
“apiKey": “0.42",
“Luminosity”:”20”,
“ActivePower”:”0.42”
}
§ Southbound API: Rely on well-know libraries
• coap package: https://www.npmjs.com/package/coap
• coap-cli package: https://www.npmjs.com/package/coap-cli
6
Building your own IoT Agent: CoAP + JSON
1. Create a new node project
• npm init
2. Add iotagent-node-lib dependency
• npm install --save https://github.com/Fiware/iot.IoTagent-node-lib
3. Add your Southbound library
• npm install –save coap
4. Add some usefull packages:
• npm install –save async
• npm install –save logops
• npm install coap-cli -g
7
Building your own IoT Agent: CoAP + JSON
§ Start agent
8
Building your own IoT Agent: CoAP + JSON
§ Start south bound API:
9
Building your own IoT Agent: CoAP + JSON
§ Handle South Bound API requests:
10
Building your own IoT Agent: CoAP + JSON
§ Update attributes in IoT Agent and CB:
11
Building your own IoT Agent: CoAP + JSON
§ From JSON to NGSI:
12
Building your own IoT Agent: CoAP + JSON
§ Starting is quite easy and fast
§ IoT Agent supporting active attributes with CoAP and JSON data model
• 1 single file
• 147 lines of code
• Less than two hours of coding
• https://github.com/dcalvoalonso/iot.IoTagent-CoAP
• https://hub.docker.com/r/danielcalvo/iotagent-coap/
13
Thank you!
http://fiware.org
Follow @FIWARE on Twitter
Jose	Gato	/	Daniel	Calvo
IoE	Lab.	ATOS	Research	&	
Innovation
jose.gato@atos.net	/	
daniel.calvo@atos.net

More Related Content

PDF
FIWARE Tech Summit - FIWARE IoT Agents
PPTX
Io t basic-exercises
PDF
Icinga Camp New York 2018 - Icinga2 and Elastic
PPTX
Improve App Performance & Reliability with NGINX Amplify
PDF
Icinga Web 2 is more
PDF
Icinga 2 - Apify them all at Icinga Camp Amsterdam 2016
PDF
Icinga Camp San Francisco 2017 - Icinga Director - Managing your configuration
PPTX
Using an API Gateway for Microservices
FIWARE Tech Summit - FIWARE IoT Agents
Io t basic-exercises
Icinga Camp New York 2018 - Icinga2 and Elastic
Improve App Performance & Reliability with NGINX Amplify
Icinga Web 2 is more
Icinga 2 - Apify them all at Icinga Camp Amsterdam 2016
Icinga Camp San Francisco 2017 - Icinga Director - Managing your configuration
Using an API Gateway for Microservices

What's hot (20)

PPTX
3 Ways to Automate App Deployments with NGINX
PPTX
Fiware, the future internet
PDF
Manage your APIs and Microservices with an API Gateway
PPTX
How to Adopt Infrastructure as Code
PPTX
Code lifecycle on the Acquia Cloud Platform
PPTX
Scylla Summit 2018: Kong & Cassandra/Scylla for distributed APIs and Microser...
PDF
Continuous Delivery - Voxxed Days Bucharest 2017
PDF
OSMC 2017 | Current State of Icinga by Erk Bernd
PPTX
NGINX Controller: Configuration, Management, and Troubleshooting at Scale
PDF
Microservices with NGINX pdf
PDF
Kuberntes Ingress with Kong
PPTX
Log Monitoring Simplified - Get the best out of Graylog2 & Icinga 2
PPTX
Microservice: starting point
PDF
NGINX Amplify: Monitoring NGINX with Advanced Filters and Custom Dashboards
PDF
Kubernetes and the NGINX Plus Ingress Controller
PDF
NGINX Controller: Configuration, Management, and Troubleshooting at Scale – EMEA
PDF
OSMC 2018 | Integrating Check_MK agent into Thruk – Windows monitoring made e...
PPTX
Simplify Microservices with the NGINX Application Platform
PPTX
Fiware Developers Week IoT Agents (Advanced)
PDF
Icinga Camp Berlin 2018 - Dev and Ops Stories - Integrations++
3 Ways to Automate App Deployments with NGINX
Fiware, the future internet
Manage your APIs and Microservices with an API Gateway
How to Adopt Infrastructure as Code
Code lifecycle on the Acquia Cloud Platform
Scylla Summit 2018: Kong & Cassandra/Scylla for distributed APIs and Microser...
Continuous Delivery - Voxxed Days Bucharest 2017
OSMC 2017 | Current State of Icinga by Erk Bernd
NGINX Controller: Configuration, Management, and Troubleshooting at Scale
Microservices with NGINX pdf
Kuberntes Ingress with Kong
Log Monitoring Simplified - Get the best out of Graylog2 & Icinga 2
Microservice: starting point
NGINX Amplify: Monitoring NGINX with Advanced Filters and Custom Dashboards
Kubernetes and the NGINX Plus Ingress Controller
NGINX Controller: Configuration, Management, and Troubleshooting at Scale – EMEA
OSMC 2018 | Integrating Check_MK agent into Thruk – Windows monitoring made e...
Simplify Microservices with the NGINX Application Platform
Fiware Developers Week IoT Agents (Advanced)
Icinga Camp Berlin 2018 - Dev and Ops Stories - Integrations++
Ad

Similar to FIWARE Tech Summit - Building Your Own IoT Agent (20)

PDF
FIWARE Global Summit - Building Your Own IoT Agent
PPTX
IoT Agents (With Lightweight M2M)
PDF
Session 7 - Connecting to Legacy Systems, IoT and other Systems | Train the T...
PDF
FIWARE Global Summit - Developing New IoT Agents
PDF
How to debug IoT Agents
PDF
FIWARE Global Summit - Connecting Sensors to FIWARE with IDAS: An Overview
PPTX
Connecting Heterogeneus IoT Technologies & Products
PDF
FIWARE Training: IoT and Legacy
PPTX
FIWARE IoT Introduction 1
PPTX
FIWARE Wednesday Webinars - How to Debug IoT Agents
PPTX
Introduction to FIWARE IoT
PPTX
FIWARE Wednesday Webinars - IoT Agents
PDF
FIWARE Training: Connecting to Legacy Systems, IoT and other Systems
PDF
What is an IoT Agent
PDF
IRJET- Artificial Intelligence Based Iot Automation: Controlling Devices with...
PPTX
IoT Agents (Introduction)
PPT
Fiware io t_ul20_cpbr8
PDF
Developing IoT Solutions in Saudi Arabia with Node.js and MQTT
PDF
Programming IoT Gateways in JavaScript with macchina.io
PDF
15CS81 Module1 IoT
FIWARE Global Summit - Building Your Own IoT Agent
IoT Agents (With Lightweight M2M)
Session 7 - Connecting to Legacy Systems, IoT and other Systems | Train the T...
FIWARE Global Summit - Developing New IoT Agents
How to debug IoT Agents
FIWARE Global Summit - Connecting Sensors to FIWARE with IDAS: An Overview
Connecting Heterogeneus IoT Technologies & Products
FIWARE Training: IoT and Legacy
FIWARE IoT Introduction 1
FIWARE Wednesday Webinars - How to Debug IoT Agents
Introduction to FIWARE IoT
FIWARE Wednesday Webinars - IoT Agents
FIWARE Training: Connecting to Legacy Systems, IoT and other Systems
What is an IoT Agent
IRJET- Artificial Intelligence Based Iot Automation: Controlling Devices with...
IoT Agents (Introduction)
Fiware io t_ul20_cpbr8
Developing IoT Solutions in Saudi Arabia with Node.js and MQTT
Programming IoT Gateways in JavaScript with macchina.io
15CS81 Module1 IoT
Ad

More from FIWARE (20)

PPTX
Behm_Herne_NeMo_akt.pptx
PDF
Katharina Hogrebe Herne Digital Days.pdf
PPTX
Christoph Mertens_IDSA_Introduction to Data Spaces.pptx
PPTX
Behm_Herne_NeMo.pptx
PPTX
Evangelists + iHubs Promo Slides.pptx
PPTX
Lukas Künzel Smart City Operating System.pptx
PPTX
Pierre Golz Der Transformationsprozess im Konzern Stadt.pptx
PPTX
Dennis Wendland_The i4Trust Collaboration Programme.pptx
PPTX
Ulrich Ahle_FIWARE.pptx
PPTX
Aleksandar Vrglevski _FIWARE DACH_OSIH.pptx
PDF
Water Quality - Lukas Kuenzel.pdf
PPTX
Cameron Brooks_FGS23_FIWARE Summit_Keynote_Cameron.pptx
PPTX
FiWareSummit.msGIS-Data-to-Value.2023.06.12.pptx
PPTX
Boris Otto_FGS2023_Opening- EU Innovations from Data_PUB_V1_BOt.pptx
PPTX
Bjoern de Vidts_FGS23_Opening_athumi - bjord de vidts - personal data spaces....
PDF
Abdulrahman Ibrahim_FGS23 Opening - Abdulrahman Ibrahim.pdf
PDF
FGS2023_Opening_Red Hat Keynote Andrea Battaglia.pdf
PPTX
HTAG_Skalierung_Plattform_lokal_final_versand.pptx
PPTX
WE_LoRaWAN _ IoT.pptx
PPTX
EU Opp_Clara Pezuela - German chapter.pptx
Behm_Herne_NeMo_akt.pptx
Katharina Hogrebe Herne Digital Days.pdf
Christoph Mertens_IDSA_Introduction to Data Spaces.pptx
Behm_Herne_NeMo.pptx
Evangelists + iHubs Promo Slides.pptx
Lukas Künzel Smart City Operating System.pptx
Pierre Golz Der Transformationsprozess im Konzern Stadt.pptx
Dennis Wendland_The i4Trust Collaboration Programme.pptx
Ulrich Ahle_FIWARE.pptx
Aleksandar Vrglevski _FIWARE DACH_OSIH.pptx
Water Quality - Lukas Kuenzel.pdf
Cameron Brooks_FGS23_FIWARE Summit_Keynote_Cameron.pptx
FiWareSummit.msGIS-Data-to-Value.2023.06.12.pptx
Boris Otto_FGS2023_Opening- EU Innovations from Data_PUB_V1_BOt.pptx
Bjoern de Vidts_FGS23_Opening_athumi - bjord de vidts - personal data spaces....
Abdulrahman Ibrahim_FGS23 Opening - Abdulrahman Ibrahim.pdf
FGS2023_Opening_Red Hat Keynote Andrea Battaglia.pdf
HTAG_Skalierung_Plattform_lokal_final_versand.pptx
WE_LoRaWAN _ IoT.pptx
EU Opp_Clara Pezuela - German chapter.pptx

Recently uploaded (20)

PDF
Video forgery: An extensive analysis of inter-and intra-frame manipulation al...
PDF
Building Integrated photovoltaic BIPV_UPV.pdf
PDF
NewMind AI Weekly Chronicles - August'25-Week II
PDF
cuic standard and advanced reporting.pdf
PDF
Encapsulation theory and applications.pdf
PDF
Optimiser vos workloads AI/ML sur Amazon EC2 et AWS Graviton
PDF
Network Security Unit 5.pdf for BCA BBA.
PDF
Unlocking AI with Model Context Protocol (MCP)
PDF
Approach and Philosophy of On baking technology
PPTX
1. Introduction to Computer Programming.pptx
PPTX
Big Data Technologies - Introduction.pptx
PDF
A comparative analysis of optical character recognition models for extracting...
PPTX
Spectroscopy.pptx food analysis technology
PDF
Mobile App Security Testing_ A Comprehensive Guide.pdf
PPTX
MYSQL Presentation for SQL database connectivity
PDF
Reach Out and Touch Someone: Haptics and Empathic Computing
PDF
Spectral efficient network and resource selection model in 5G networks
PPTX
KOM of Painting work and Equipment Insulation REV00 update 25-dec.pptx
PDF
Build a system with the filesystem maintained by OSTree @ COSCUP 2025
PDF
Diabetes mellitus diagnosis method based random forest with bat algorithm
Video forgery: An extensive analysis of inter-and intra-frame manipulation al...
Building Integrated photovoltaic BIPV_UPV.pdf
NewMind AI Weekly Chronicles - August'25-Week II
cuic standard and advanced reporting.pdf
Encapsulation theory and applications.pdf
Optimiser vos workloads AI/ML sur Amazon EC2 et AWS Graviton
Network Security Unit 5.pdf for BCA BBA.
Unlocking AI with Model Context Protocol (MCP)
Approach and Philosophy of On baking technology
1. Introduction to Computer Programming.pptx
Big Data Technologies - Introduction.pptx
A comparative analysis of optical character recognition models for extracting...
Spectroscopy.pptx food analysis technology
Mobile App Security Testing_ A Comprehensive Guide.pdf
MYSQL Presentation for SQL database connectivity
Reach Out and Touch Someone: Haptics and Empathic Computing
Spectral efficient network and resource selection model in 5G networks
KOM of Painting work and Equipment Insulation REV00 update 25-dec.pptx
Build a system with the filesystem maintained by OSTree @ COSCUP 2025
Diabetes mellitus diagnosis method based random forest with bat algorithm

FIWARE Tech Summit - Building Your Own IoT Agent

  • 1. Building your own IoT Agent 1
  • 2. Building your own IoT Agent: overview § Frameworks: Node.js and C++ • https://github.com/Fiware/iot.IoTagent-node-lib • https://github.com/telefonicaid/fiware-IoTAgent-Cplusplus § North bound features provided by the platform: • NGSI Context Provision server • NGSI Client • Device Provisioning API • Configuration API § All South bound features are protocol specific • External library • Ad-hoc development 2
  • 3. Building your own IoT Agent: Node.js § Module provided in NPM Registry: • Add iotagent-node-lib to your package.json • Require it as any other module § https://github.com/telefonicaid/iotagent-node-lib/blob/master/doc/howto.md § Possible in few days/weeks: • Current agents: ~ 1000 lines of source code (supporting several transport protocols) 3 Context Server NGSI Client Device Protocol Device Registry Group Registry Provision Server IoT Agent
  • 4. Building your own IoT Agent: CoAP + JSON 4 § CoAP: Constrained Application Protocol • RESTful protocol designed from scratch • Transparent mapping to HTTP • Binary protocol □ Low parsing complexity □ Small message size • Security based on DTLS (TLS/SSL for Datagrams) • IETF Standard: https://tools.ietf.org/search/rfc7252 GET /status/power PUT /control/color #00FF00
  • 5. Building your own IoT Agent: CoAP + JSON 5 APPLICATION TRANSPORT SIMPLIFIED OSI NETWORK LINK PHYSICAL CoAP UDP IoT Device JSON IoT Agent UDP IPv4 TCP CoAP JSON HTTP NGSI/REST TCP CONTEXT BROKER IPv4 HTTP NGSI /REST § Protocol translation
  • 6. Building your own IoT Agent: CoAP + JSON § Active attributes reporting • POST coap://{iot_agent_ip}/iot/coap { “deviceId": " #00FF00", “apiKey": “0.42", “Luminosity”:”20”, “ActivePower”:”0.42” } § Southbound API: Rely on well-know libraries • coap package: https://www.npmjs.com/package/coap • coap-cli package: https://www.npmjs.com/package/coap-cli 6
  • 7. Building your own IoT Agent: CoAP + JSON 1. Create a new node project • npm init 2. Add iotagent-node-lib dependency • npm install --save https://github.com/Fiware/iot.IoTagent-node-lib 3. Add your Southbound library • npm install –save coap 4. Add some usefull packages: • npm install –save async • npm install –save logops • npm install coap-cli -g 7
  • 8. Building your own IoT Agent: CoAP + JSON § Start agent 8
  • 9. Building your own IoT Agent: CoAP + JSON § Start south bound API: 9
  • 10. Building your own IoT Agent: CoAP + JSON § Handle South Bound API requests: 10
  • 11. Building your own IoT Agent: CoAP + JSON § Update attributes in IoT Agent and CB: 11
  • 12. Building your own IoT Agent: CoAP + JSON § From JSON to NGSI: 12
  • 13. Building your own IoT Agent: CoAP + JSON § Starting is quite easy and fast § IoT Agent supporting active attributes with CoAP and JSON data model • 1 single file • 147 lines of code • Less than two hours of coding • https://github.com/dcalvoalonso/iot.IoTagent-CoAP • https://hub.docker.com/r/danielcalvo/iotagent-coap/ 13
  • 14. Thank you! http://fiware.org Follow @FIWARE on Twitter Jose Gato / Daniel Calvo IoE Lab. ATOS Research & Innovation jose.gato@atos.net / daniel.calvo@atos.net