0%

Use a low-code programming approach to create event-driven applications from scratch by wiring together hardware devices, APIs, and online services

Key Features

  • Discover how you can automate the Internet of Things (IoT) without writing huge blocks of code
  • Learn how to wire together flows using a browser-based visual editor
  • Handle IoT data with little to no coding knowledge

Book Description

Node-RED is a free and open source flow-based programming tool used to handle IoT data that allows programmers of any level to interconnect physical I/O, cloud-based systems, databases, and APIs to build web applications without code.

Practical Node-RED Programming is a comprehensive introduction for anyone looking to get up to speed with the Node-RED ecosystem in no time. Complete with hands-on tutorials, projects, and self-assessment questions, this easy-to-follow guide will help you to become well versed in the foundations of Node-RED. You'll learn how to use Node-RED to handle IoT data and build web applications without having to write complex code. Once you've covered the basics, you'll explore various visual programming techniques and find out how to make sample flows as you cover web development, IoT development, and cloud service connections, and finally build useful real-world applications.

By the end of this book, you'll have learned how to use Node-RED to develop a real-world application from scratch, which can then be implemented in your business.

What you will learn

  • Understand the history of Node-RED and why you need to learn a flow-based programming tool
  • Use Node-RED to build Node.js-based applications
  • Handle data for IoT devices using Node-RED flows
  • Explore advanced Node-RED features such as connecting repositories and customizing the flow editor
  • Find out what the MQTT protocol is and how it relates to Node-RED
  • Create and publish your own nodes and flows using the Node-RED library

Who this book is for

This Node-RED book is for web developers and IoT engineers with some background in JavaScript and Node.js. Although not necessary, familiarity with the concepts of electronics will help you to make the most out of this book.

Table of Contents

  1. Practical Node-RED Programming
  2. Foreword
  3. Contributors
  4. About the author
  5. About the reviewers
  6. Preface
    1. Who this book is for
    2. What this book covers
    3. To get the most out of this book
    4. Download the example code files
    5. Download the color images
    6. Conventions used
    7. Get in touch
    8. Reviews
  7. Section 1: Node-RED Basics
  8. Chapter 1: Introducing Node-RED and Flow-Based Programming
    1. What is FBP?
    2. Workflows
    3. Flow-based programming (FBP)
    4. What is Node-RED?
    5. Overview
    6. Flow editor and runtime
    7. History and origin of Node-RED
    8. Node-RED benefits
    9. Simplification
    10. Efficiency
    11. Common
    12. High quality
    13. Open source
    14. Node-RED library
    15. Various platforms
    16. Node-RED and IoT
    17. Node-RED and IoT
    18. Summary
  9. Chapter 2: Setting Up the Development Environment
    1. Technical requirements
    2. Installing npm and Node.js for Windows
    3. Installing npm and Node.js for Mac
    4. Installing npm and Node.js for Raspberry Pi
    5. Installing Node-RED for Windows
    6. Installing Node-RED for Mac
    7. Installing Node-RED for Raspberry Pi
    8. Summary
  10. Chapter 3: Understanding Node-RED Characteristics by Creating Basic Flows
    1. Technical requirements
    2. Node-RED Flow Editor mechanisms
    3. Using the Flow Editor
    4. Making a flow for a data handling application
    5. Importing and exporting a flow definition
    6. Summary
  11. Chapter 4: Learning the Major Nodes
    1. Technical requirements
    2. What is a node?
    3. How to use nodes
    4. Common category
    5. Function category
    6. Getting several nodes from the library
    7. Summary
  12. Section 2: Mastering Node-RED
  13. Chapter 5: Implementing Node-RED Locally
    1. Technical requirements
    2. Running Node-RED on a local machine
    3. Using the standalone version of Node-RED
    4. Using IoT on edge devices
    5. Making a sample flow
    6. Use case 1 – light sensor
    7. Use case 2 – temperature/humidity sensor
    8. Making a flow for use case 1 – light sensor
    9. Making a flow for use case 2 – temperature/humidity sensor
    10. Summary
  14. Chapter 6: Implementing Node-RED in the Cloud
    1. Technical requirements
    2. Running Node-RED on the cloud
    3. What is the specific situation for using Node-RED in the cloud?
    4. IoT case study spot on the server side
    5. Use case 1 – Storing data
    6. Use case 2 – Temperature/humidity sensor
    7. Making a sample flow
    8. Making a flow for use case 1 – storing data
    9. Making a flow for use case 2 – visualizing data
    10. Summary
  15. Chapter 7: Calling a Web API from Node-RED
    1. Technical requirements
    2. Learning about the RESTful API
    3. Learning about the input/output parameters of a node
    4. How to call the web API on a node
    5. Creating an account
    6. Creating an API key
    7. Checking the API endpoint URL
    8. Checking that the API can run
    9. Creating the flow calling the API
    10. How to use the IBM Watson API
    11. Logging in to IBM Cloud
    12. Starting Node-RED on IBM Cloud
    13. Creating the Watson API
    14. Connecting Node-RED and the Tone Analyzer service
    15. Creating the flow by calling the Tone Analyzer API
    16. Testing the flow
    17. Summary
  16. Chapter 8: Using the Project Feature with Git
    1. Technical requirements
    2. Enabling the project feature
    3. Using the Git repository
    4. Accessing project settings
    5. Connecting a remote repository
    6. Summary
  17. Section 3: Practical Matters
  18. Chapter 9: Creating a ToDo Application with Node-RED
    1. Technical requirements
    2. Why you should use Node-RED for web applications
    3. Creating a database
    4. How to connect to the database
    5. Configuring Node-RED
    6. Cloning the Node-RED Project
    7. Configuring the Node-RED and CouchDB connection
    8. Running the application
    9. Summary
  19. Chapter 10: Handling Sensor Data on the Raspberry Pi
    1. Technical requirements
    2. Getting sensor data from the sensor module on the Raspberry Pi
    3. Preparing the devices
    4. Checking Node-RED to get data from the sensor device
    5. Learning the MQTT protocol and using an MQTT node
    6. Connecting to an MQTT broker
    7. Mosquitto
    8. Preparing Mosquitto on your Raspberry Pi
    9. Making a flow to get sensor data and send it to the MQTT broker
    10. Checking the status of data on the localhost
    11. Summary
  20. Chapter 11: Visualize Data by Creating a Server-Side Application in the IBM Cloud
    1. Technical requirements
    2. Preparing a public MQTT broker service
    3. Publishing the data from Node-RED on an edge device
    4. Subscribing and visualizing data on the cloud-side Node-RED
    5. Preparing Node-RED on the IBM Cloud
    6. Visualization of the data on the IBM Cloud
    7. Summary
  21. Chapter 12: Developing a Chatbot Application Using Slack and IBM Watson
    1. Technical requirements
    2. Creating a Slack workspace
    3. Creating a Watson Assistant API
    4. Enabling the connection to Slack from Node-RED
    5. Building a chatbot application
    6. Summary
  22. Chapter 13: Creating and Publishing Your Own Node on the Node-RED Library
    1. Technical requirements
    2. Creating your own node
    3. Node program development
    4. Node packaging
    5. Testing your own node in a local environment
    6. Node installation
    7. Node customization
    8. Publishing your own node as a module in the Node-RED Library
    9. Publishing the node you created
    10. Deleting the node you published
    11. Installing the node you published
    12. Summary
  23. Appendix: Node-RED User Community
    1. Node-RED Community Slack
    2. Node-RED Forum
    3. Japan User Group
    4. Why subscribe?
  24. Other Books You May Enjoy
    1. Packt is searching for authors like you
    2. Leave a review - let other readers know what you think
3.239.97.34