Da6 3
Da6 3
IOT Task 6
Task: Create a function node that collects multiple string inputs and perform
string operation. (Inputs may be from inject node. Operation can be
concatenation)
Aim: To get sensor data from an android device, concatenate the values and
save them to csv.
Procedure:
1. Get the data from phone using UDP Block in Node-Red
The data will be received as an XML String, as given below
<?xml version='1.0' encoding='UTF-8' standalone='yes'
?><NodeId>1</NodeId><Accelerometer><Accelerometer1>-
0.5187225341796875</Accelerometer1><Accelerometer2>0.656402587890
625</Accelerometer2><Accelerometer3>9.570663452148438</Accelerome
ter3></Accelerometer><TimeStamp>1603001641648</TimeStamp>
5. The values received are than concatenated using function node and
saved in a CSV file.
2. Convert to Angles
𝑎𝑐𝑐𝑒𝑙
The node implements the following function ((𝑠𝑖𝑛−1 ( )) × 180)/𝜋
9.8
3. Convert to CSV
This node concatenates the values received and converts them to CSV
format which is then stored in a Data_Values.csv file.
Complete Flow Diagram
Results:
1. Dashboard Output
2. CSV File Screenshot
The symbols at the end are a result of bad encoding of degree symbol.
Working Video:
https://drive.google.com/file/d/1cNVBxeS9A4L0VAZmAgcbZ_jSj-
2XN1qe/view?usp=sharing
Conclusion:
The values sent by the phone were successfully received, displayed on
dashboard and saved as a csv file.