Building Arduino Projects for the Internet of Things
CHAPTER 4 ■ COMPLEX FLOWS: NODE-RED Set the URL property to /lightSensorTweet. This URL will be prepended by the Node-RED server ...
CHAPTER 4 ■ COMPLEX FLOWS: NODE-RED Listing 4-1. Code for Converting a String to a Number msg.payload.requestVar = parseInt(msg. ...
CHAPTER 4 ■ COMPLEX FLOWS: NODE-RED You can add this threshold check within Arduino code as well, but consider a real- life impl ...
CHAPTER 4 ■ COMPLEX FLOWS: NODE-RED Change the name to Check Threshold. By default, there will be only one path, so click on the ...
CHAPTER 4 ■ COMPLEX FLOWS: NODE-RED Double-click the function node to open the properties dialog box, as shown in Figure 4-18. ...
CHAPTER 4 ■ COMPLEX FLOWS: NODE-RED Listing 4-2. Code for Creating the Tweet msg.payload = "Sunny Outside! " + msg.payload.reque ...
CHAPTER 4 ■ COMPLEX FLOWS: NODE-RED On the next screen , shown in Figure 4-22 , enter your Twitter username and password and cl ...
CHAPTER 4 ■ COMPLEX FLOWS: NODE-RED Once the authorization process is complete, click on the Add button in the dialog box shown ...
CHAPTER 4 ■ COMPLEX FLOWS: NODE-RED The HTTP response node will simply send msg.payload back to the client in the JSON format. C ...
CHAPTER 4 ■ COMPLEX FLOWS: NODE-RED Internet Connectivity (Wireless) The second section of the code defines variables, constants ...
CHAPTER 4 ■ COMPLEX FLOWS: NODE-RED void doHttpGet() { // Read all incoming data (if any) while (client.available()) { char c = ...
CHAPTER 4 ■ COMPLEX FLOWS: NODE-RED Standard Functions Finally, the code in the fifth and last section is provided in Listing 4- ...
CHAPTER 4 ■ COMPLEX FLOWS: NODE-RED Figure 4-27. Log messages from the light sensor tweet system Figure 4-28. Tweet from the lig ...
© Adeel Javed 2016 75 A. Javed, Building Arduino Projects for the Internet of Things, DOI 10.1007/978-1-4842-1940-9_5 CHAPTER 5 ...
CHAPTER 5 ■ IOT PATTERNS: REALTIME CLIENTS Learning Objectives At the end of this chapter, you will be able to: Read motion sen ...
CHAPTER 5 ■ IOT PATTERNS: REALTIME CLIENTS Software Required In order to develop the intrusion detection system, you need the fo ...
CHAPTER 5 ■ IOT PATTERNS: REALTIME CLIENTS Figure 5-3. Circuit diagram of the intrusion detection system Figure 5-4. Actual circ ...
CHAPTER 5 ■ IOT PATTERNS: REALTIME CLIENTS Code (Arduino) Next you are going to write code for connecting Arduino to the Interne ...
CHAPTER 5 ■ IOT PATTERNS: REALTIME CLIENTS Listing 5-3 provides the code for the calibrateSensor() function , which waits for th ...
CHAPTER 5 ■ IOT PATTERNS: REALTIME CLIENTS 81 // Publish sensor data to MQTT broker publishSensorData(); delay(50); } takeLowTim ...
«
1
2
3
4
5
6
7
8
9
10
»
Free download pdf