Programming with Node-RED : design IoT projects with Raspberry Pi, Arduino and ESP32 🔍
Dogan Ibrahim Elektor Publication, Learn, design, share, London, cop. 2020
英语 [en] · PDF · 12.9MB · 2020 · 📘 非小说类图书 · 🚀/lgli/lgrs/upload · Save
描述
The Internet of Things (IoT) is becoming a major application area for embedded systems. As a result, more and more people are becoming interested in learning about embedded design and programming. Technical colleges and universities are moving away from legacy 8 and 16-bit microcontrollers and are introducing 32-bit embedded microcontrollers to their curriculums. Many IoT applications demand precision, high processing power, and low power consumption.
Produced by IBM, Node-RED is an open-source visual editor for wiring the Internet of Things. Node-RED comes with a large number of nodes to handle a multitude of tasks. The required nodes are selected and joined together to perform a particular task. Node-RED is based on flow type programming where nodes are configured and joined together to form an application program. There are nodes for performing complex tasks, including web access, Twitter, E-mail, HTTP, Bluetooth, MQTT, controlling GPIO ports, etc. One particularly nice aspect of Node-RED is that the programmer does not need to learn how to write complex programs. For example, an email can be sent by simply joining nodes together and writing only a few lines of code.
The aim of this book is to teach how Node-RED can be used in projects. The main hardware platform used with most of the projects in this book is Raspberry Pi 4. Chapters are included to show how Node-RED can be also be used with Arduino Uno, ESP32 DevKitC, and the ESP8266 NodeMCU microcontroller development boards.
Many example projects are given in the book. All projects have been fully tested and were working at the time of writing this book. Users can select flow programs of the projects from the book website and configure them to suit their own applications. The operation of each flow program is fully described in the book.
Raspberry Pi is based on ARM architecture and it is currently one of the most commonly used single-board computers used by students, engineers, and hobbyists. There are hundreds of Raspberry Pi based projects available on the internet.
Arduino is also a very popular microcontroller development board. Although it is based on 8-bit architecture, it is widely used as it is supported by large numbers of software libraries, making it easy to develop projects in relatively short times.
Another popular microcontroller is ESP32. It is widely sold as a development board known as the ESP32 DevKitC. The reason why ESP32 is very popular is that it has onboard Wi-Fi and Bluetooth capability, many digital and analog input ports, and built-in timers. Additionally, its power consumption is very low and it has a processor that can be put into sleep mode, which consumes extremely low current.
备用文件名
lgli/Programming with Node-RED_ Design IoT Projects with Raspberry Pi, Arduino and ESP32.pdf
备用文件名
lgrsnf/Programming with Node-RED_ Design IoT Projects with Raspberry Pi, Arduino and ESP32.pdf
备选作者
Ibrahim, Dogan
备用出版商
Elektor International Media BV
备用出版商
Elektor Electronics Publishing
备用出版商
Elektor Verlag GmbH
备用版本
United Kingdom and Ireland, United Kingdom
备用版本
Germany, Germany
备用版本
1, 2020-06-12
备用版本
1st, 2020
元数据中的注释
producers:
Adobe PDF Library 15.0
备用描述
Contents 4
Preface 12
Chapter 1 • Raspberry Pi 4 14
1.1 Overview 14
1.2 Parts of the Raspberry Pi 4 14
1.3.1 Setup option 1 17
1.3.2 Setup option 2 18
Summary 18
Chapter 2 • Installing the Raspberry Pi operating system 19
2.1 Overview 19
2.2 Raspbian Buster installation steps on Raspberry Pi 4 19
2.3 Remote access 21
2.4 Using Putty 22
2.4.1 Configuring Putty 23
2.5 Remote access of the desktop 24
2.6 Summary 25
Chapter 3 • Using the command line 26
3.1 Overview 26
3.2 The Raspberry Pi directory structure 26
3.3 File permissions 27
3.4 Help 31
3.5 Date, time, and calendar 32
3.6 File operations 32
3.7 System and user information 34
3.8 Resource monitoring on Raspberry Pi 36
3.9 Shutting down 38
3.10 Summary 39
Chapter 4 • Installing Node-RED software on Raspberry Pi 40
4.1 Overview 40
4.2 Raspberry Pi Node-RED installation 40
4.3 Node-RED interface to external world 42
4.4 Node-RED screen layout 43
4.5 Project 1 – Hello World! 43
4.6 Project 2 – Date and time 46
4.7 Project 3 – Temperature conversion 51
4.8 Importing and exporting flow programs 53
4.8.1 Exporting flows 53
4.8.2 Importing aflow 54
4.9 Copying nodes in the same workspace 54
4.10 Core nodes 54
4.10.1 Input nodes 54
4.10.2 Output nodes 55
4.10.3 Function nodes 56
4.10.4 Social nodes 57
4.10.5 Storage nodes 57
4.10.6 Analysis nodes 57
4.10.7 Advanced nodes 57
4.10.8 Raspberry Pi nodes 57
4.11 Project 4 – Dice number 58
4.12 Project 5 – Double dice numbers 59
4.13 Project 6 – Unit conversions - Multiple inputs to a function 61
4.14 Multiple inputs and multiple outputs from a function 64
4.15 Project 7 – Mean of numbers - Using the smooth node 66
4.16 Project 8 – Squares of numbers 67
4.17 Project 9 – Getting the weather reports –
Display the local weather report 69
4.18 Project 10 – Display the current temperature 72
4.19 Project 11 – Sending the current temperature to an email 73
4.20 Project 12 – Sending the current temperature and atmospheric pressure to your twitter account 75
4.21 Node-RED configuration 77
4.22 Summary 78
Chapter 5 • Node-RED based Raspberry Pi projects using Gpio 79
5.1 Overview 79
5.2 GPIO – Parallel interface 79
5.3 Project 13 – LED control 81
5.4 Project 14 – Flashing LED 84
5.4.1 Using a context variable to flash the LED 86
5.5 Project 15 – Alternately flashing LEDs 87
5.5.1 Using context variables to flash the LEDs alternately 88
5.6 Project 16 – Temperature alarm with buzzer 89
5.7 Project 17 – Controlling a GPIO port remotely using email 92
5.8 Project 18 – Confirmation of the buzzer state 94
5.9 Project 19 – Controlling multiple GPIO ports remotely using email 97
5.10 Project 20 – Traffic lights simulator 101
5.11 Project 21 – Push-Button switch input 105
5.12 Project 22 – Changing LED brightness – The PWM output 109
5.13 Summary 111
6.1 Overview 112
6.2 Raspberry Pi I2C ports 113
6.3 I2C LCD 114
6.4 Installing the I2C LCD software on Node-RED 114
6.5 Project 23 – Displaying current time on the LCD 117
6.6 Project 24 – Displaying local temperature and humidity on the LCD 119
6.7 Project 25 – Displaying dice numbers 119
6.8 Project 26 – Event counter with LCD 121
6.9 Project 27 – DHT11 temperature and humidity sensor with LCD Display 123
6.10 Project 28 – Ultrasonic distance sensor with LCD display 128
6.11 Project 29 – Ultrasonic distance alarm with buzzer 133
6.12 Project 30 – Ultrasonic car parking system with buzzer 134
6.13 Using a parallel LCD 136
6.14 Project 31 – Displaying message on a parallel LCD 138
6.15 Summary 140
Chapter 7 • Using ADC in Raspberry Pi Node-RED projects 141
7.1 Overview 141
7.2 The MCP3002 ADC 141
7.3 Project 32 – Voltmeter with LCD output 143
7.4 Project 33 – Temperature measurement using analog sensor 145
7.5 Project 34 – ON/OFF temperature control 147
7.6 Summary 151
Chapter 8 • The dashboard palette 152
8.1 Overview 152
8.2 Installing the dashboard 152
8.3 Project 35 – Using a gauge to display the temperature 153
8.4 Using a Line Chart to display the temperature 155
8.5 Using a Bar Chart to display the temperature 156
8.6 Project 36 – Using gauges to display the temperature and humidity 157
8.7 Project 37 – Using multiple gauges 159
8.8 Project 38 – Using a slider to change LED brightness 160
8.9 Project 39 – Using button nodes to control an LED 162
8.10 Project 40 – Using switch and text nodes to control an LED 164
8.11 Project 41 – Talking weather forecast 165
8.12 Configuring the dashboard 168
8.13 Summary 168
Chapter 9 • Wi-Fi UDP/TCP Network-Based projects 169
9.1 Overview 169
9.2 Project 42 – Controlling an LED from a mobile phone –
UDP based communication 169
9.3 Project 43 – Controlling multiple LEDs from a mobile phone –
UDP based communication 172
9.5 Project 45 – Controlling an LED from a mobile phone –
TCP based communication 177
9.6 Project 46 – Controlling Multiple LEDs From a Mobile Phone –
TCP Based Communication 180
9.7 Project 47 – Sending the temperature and humidity to the mobile phone – TCP based communication 181
9.8 Project 48 – Chat program – Mobile phone to Raspberry Pi chat 183
9.9 Project 49 – Using the ping 186
9.10 Summary 188
Chapter 10 • Storage Nodes 189
10.1 Overview 189
10.2 Project 50 – Storing timestamped temperature and
humidity data in a file 189
10.3 Project 51 – Reading contents of a file 191
10.4 Project 52 – Reading a file line by line 194
10.5 Summary 196
Chapter 11 • Serial communication 197
11.1 Overview 197
11.2 Project 53 – Communicating with Arduino over serial line 198
11.3 Project 54 – Receiving serial data – Receiving GPS data 203
11.4 Project 55 – Receiving GPS data – Extracting the latitude and longitude 207
11.5 Project 56 – Displaying our location on a map 211
11.6 Project 57 – Sending out serial data to arduino 215
11.7 Project 58 – Connecting Raspberry Pi and Arduino Uno using USB ports 219
11.8 Project 59 – Sending serial data from Raspberry Pi to Arduino over RF Radio 221
11.9 Summary 223
Chapter 12 • Using Sense HAT 224
12.1 Overview 224
12.2 The Sense HAT board 224
12.3 Node-RED Sense HAT nodes 225
12.4 Project 60 - Displaying the temperature, humidity,
and pressure (environmental events) 226
12.5 Project 61 - Displaying the compass heading (motion events) 228
12.6 Project 62 - Displaying the acceleration (motion events) 229
12.7 Project 63 - Displaying the orientation (motion events) 230
12.8 Using the joystick 232
12.9 Using the LED matrix 233
12.10 Project 64 – Random flashing LED lights having random colours 237
12.11 Project 65 – Display of temperature by LED count 238
12.12 Displaying and scrolling data on LED Matrix 241
12.13 Project 66 – Scrolling the pressure readings on the LED matrix 241
12.14 Summary 243
Chapter 13 • Node-RED with Arduino Uno 244
13.1 Overview 244
13.2 Installing Node-RED For Arduino Uno 244
13.3 Project 67 – Flashing LED 246
13.4 Project 68 – Displaying the ambient temperature in the debug window 247
13.5 Project 69 – Displaying the ambient temperature in the dashboard 249
13.6 Project 70 – Displaying the ambient temperature as gauge and chart 250
13.7 Using the Arduino Uno serial port 252
13.7.1 Project 71 – Using the DHT11 with the Arduino 252
13.8 Summary 255
Chapter 14 • Using the ESP32 DevkitC with Node-RED 256
14.1 Overview 256
14.2 ESP32 DevKitC and Node-RED 258
14.3 Project 72 – Controlling an LED connected to ESP32 DevKitC 258
14.4 Summary 261
Chapter 15 • Using Amazon Alexa in Node-RED projects 262
15.1 Overview 262
15.2 Project 73 – Controlling a LED Using Alexa 262
15.3 Project 74 – Controlling a LED and a Buzzer using Alexa 264
15.4 Summary 267
Chapter 16 • Accessing Raspberry Pi Node-RED from anywhere 268
16.1 Overview 268
16.2 The ngrok 268
16.3 Starting Node-RED automatically at reboot time 270
16.4 Summary 270
Chapter 17 • Using Bluetooth with Node-RED 271
17.1 Overview 271
17.2 Project 75 – Controlling a LED and a buzzer using Bluetooth 271
17.3 Summary 275
Chapter 18 • Node-RED and MQTT 277
18.1 Overview 277
18.2 How MQTT works 277
18.3 The Mosquitto broker 279
18.4 Using MQTT in home automation and in IoT projects 280
18.5 Project 76 – Controlling a LED using MQTT 281
18.6 The ESP8266 processor 282
18.7 Project 77 – Flashing an LED using ESP8266 NodeMCU 284
18.8 Using the ESP8266 NodeMCU with MQTT 286
18.9 Project 78 – Controlling an LED using ESP8266 NodeMCU with MQTT –
LED connected to Raspberry Pi 287
18.10 Project 79 – Controlling an LED using ESP8266 NodeMCU with MQTT – LED connected to ESP8266 NodeMCU 292
18.11 Summary 298
Chapter 19 • Using HTTP in Node-RED projects 299
19.1 Overview 299
19.2 Using HTTP GET 299
19.3 Web server 300
19.4 Project 80 – Controlling 4 Relays using web server 301
19.5 Summary 307
Appendix A • The function node 308
A.1 Overview 308
A.2 Variables 308
A.3 Multiple outputs 309
A.4 String manipulation 309
A.5 Mathematical functions 312
A.6 Number conversions and checking numbers 313
A.7 Date 314
A.8 Arrays 314
A.9 Conditional statements 315
A.10 Repetition (Loops) 316
A.12 Examples 318
Appendix B • Flow programs used in the book 320
A.1 Overview 320
A.2 Using the flow programs 320
Appendix C • Components used in the book 321
Index 322
备用描述
<p>The Internet of Things (IoT) is becoming a major application area for embedded systems. As a result, more and more people are becoming interested in learning about embedded design and programming. Technical colleges and universities are moving away from legacy 8 and 16-bit microcontrollers and are introducing 32-bit embedded microcontrollers to their curriculums. Many IoT applications demand precision, high processing power, and low power consumption.Produced by IBM, Node-RED is an open-source visual editor for wiring the Internet of Things. Node-RED comes with a large number of nodes to handle a multitude of tasks. The required nodes are selected and joined together to perform a particular task. Node-RED is based on flow type programming where nodes are configured and joined together to form an application program. There are nodes for performing complex tasks, including web access, Twitter, E-mail, HTTP, Bluetooth, MQTT, controlling GPIO ports, etc. One particularly nice aspect of Node-RED is that the programmer does not need to learn how to write complex programs. For example, an email can be sent by simply joining nodes together and writing only a few lines of code.The aim of this book is to teach how Node-RED can be used in projects. The main hardware platform used with most of the projects in this book is Raspberry Pi 4. Chapters are included to show how Node-RED can be also be used with Arduino Uno, ESP32 DevKitC, and the ESP8266 NodeMCU microcontroller development boards.<br></p>
开源日期
2024-06-27
更多信息……

🚀 快速下载

成为会员以支持书籍、论文等的长期保存。为了感谢您对我们的支持,您将获得高速下载权益。❤️
如果您在本月捐款,您将获得双倍的快速下载次数。

🐢 低速下载

由可信的合作方提供。 更多信息请参见常见问题解答。 (可能需要验证浏览器——无限次下载!)

所有选项下载的文件都相同,应该可以安全使用。即使这样,从互联网下载文件时始终要小心。例如,确保您的设备更新及时。
  • 对于大文件,我们建议使用下载管理器以防止中断。
    推荐的下载管理器:JDownloader
  • 您将需要一个电子书或 PDF 阅读器来打开文件,具体取决于文件格式。
    推荐的电子书阅读器:Anna的档案在线查看器ReadEraCalibre
  • 使用在线工具进行格式转换。
    推荐的转换工具:CloudConvertPrintFriendly
  • 您可以将 PDF 和 EPUB 文件发送到您的 Kindle 或 Kobo 电子阅读器。
    推荐的工具:亚马逊的“发送到 Kindle”djazz 的“发送到 Kobo/Kindle”
  • 支持作者和图书馆
    ✍️ 如果您喜欢这个并且能够负担得起,请考虑购买原版,或直接支持作者。
    📚 如果您当地的图书馆有这本书,请考虑在那里免费借阅。