Skip to content

Commit cf39ae6

Browse files
chore: add nodes to save serials name
1 parent 38cf5b5 commit cf39ae6

File tree

1 file changed

+151
-24
lines changed

1 file changed

+151
-24
lines changed

flows.json

Lines changed: 151 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,25 @@
2323
"info": "",
2424
"env": []
2525
},
26+
{
27+
"id": "94b8abb47e4cb1f2",
28+
"type": "serial-port",
29+
"serialport": "",
30+
"serialbaud": "115200",
31+
"databits": "8",
32+
"parity": "none",
33+
"stopbits": "1",
34+
"waitfor": "",
35+
"dtr": "none",
36+
"rts": "none",
37+
"cts": "none",
38+
"dsr": "none",
39+
"newline": "\\n",
40+
"bin": "false",
41+
"out": "char",
42+
"addchar": "",
43+
"responsetimeout": "10000"
44+
},
2645
{
2746
"id": "32174867b86c7b03",
2847
"type": "function",
@@ -47,7 +66,7 @@
4766
"type": "function",
4867
"z": "09012e75c72a4968",
4968
"name": "processSerialData",
50-
"func": "//var parts = msg.serialData.split(\"-\");\nlet parts = JSON.parse(msg.serialData); \n\n//dato il protocollo creo delle variabili globali per gestire il messaggio\n//msg.roomID = parts[1].trim()\n//msg.valueChanged = parts[2].trim()\n//msg.value = parts[3].trim()\n\nmsg.room_id = parts[\"room_id\"]\nmsg.temperature_value = parts[\"temperature_value\"]\nmsg.temperature_unit = parts[\"temperature_unit\"]\n\n\n\n\nreturn msg;",
69+
"func": "let parts = JSON.parse(msg.serialData); \n\nmsg.room_id = parts[\"room_id\"]\nmsg.temperature_value = parts[\"temperature_value\"]\nmsg.temperature_unit = parts[\"temperature_unit\"]\n\nreturn msg;",
5170
"outputs": 1,
5271
"noerr": 0,
5372
"initialize": "",
@@ -533,7 +552,7 @@
533552
"upload": false,
534553
"swaggerDoc": "",
535554
"x": 130,
536-
"y": 980,
555+
"y": 1300,
537556
"wires": [
538557
[
539558
"d95b89b933ecab60"
@@ -613,16 +632,6 @@
613632
]
614633
]
615634
},
616-
{
617-
"id": "5ff43b84fbe92a30",
618-
"type": "comment",
619-
"z": "09012e75c72a4968",
620-
"name": "",
621-
"info": "da arduino ricevo attuatore, tipo di attuatore e room corrispondente",
622-
"x": 1160,
623-
"y": 880,
624-
"wires": []
625-
},
626635
{
627636
"id": "8b23d4b6fc9ad1ef",
628637
"type": "file in",
@@ -636,7 +645,7 @@
636645
"encoding": "utf8",
637646
"allProps": false,
638647
"x": 670,
639-
"y": 980,
648+
"y": 1300,
640649
"wires": [
641650
[
642651
"1107f97b9aa49722"
@@ -655,7 +664,7 @@
655664
"finalize": "",
656665
"libs": [],
657666
"x": 370,
658-
"y": 980,
667+
"y": 1300,
659668
"wires": [
660669
[
661670
"8b23d4b6fc9ad1ef"
@@ -674,7 +683,7 @@
674683
"finalize": "",
675684
"libs": [],
676685
"x": 980,
677-
"y": 980,
686+
"y": 1300,
678687
"wires": [
679688
[
680689
"19b43e1a0fb43f50"
@@ -694,7 +703,7 @@
694703
"encoding": "utf8",
695704
"allProps": false,
696705
"x": 1270,
697-
"y": 980,
706+
"y": 1300,
698707
"wires": [
699708
[
700709
"0bcfc84520ddafb2"
@@ -713,7 +722,7 @@
713722
"finalize": "",
714723
"libs": [],
715724
"x": 1520,
716-
"y": 980,
725+
"y": 1300,
717726
"wires": [
718727
[
719728
"c38d2690eac04451"
@@ -753,7 +762,7 @@
753762
"repair": false,
754763
"outputs": 4,
755764
"x": 1710,
756-
"y": 980,
765+
"y": 1300,
757766
"wires": [
758767
[
759768
"3153f241b098b8da"
@@ -783,7 +792,7 @@
783792
"statusVal": "",
784793
"statusType": "auto",
785794
"x": 1900,
786-
"y": 920,
795+
"y": 1240,
787796
"wires": []
788797
},
789798
{
@@ -799,7 +808,7 @@
799808
"statusVal": "",
800809
"statusType": "auto",
801810
"x": 1900,
802-
"y": 1040,
811+
"y": 1360,
803812
"wires": []
804813
},
805814
{
@@ -815,7 +824,7 @@
815824
"statusVal": "",
816825
"statusType": "auto",
817826
"x": 1900,
818-
"y": 1000,
827+
"y": 1320,
819828
"wires": []
820829
},
821830
{
@@ -831,7 +840,7 @@
831840
"statusVal": "",
832841
"statusType": "auto",
833842
"x": 1900,
834-
"y": 960,
843+
"y": 1280,
835844
"wires": []
836845
},
837846
{
@@ -1024,9 +1033,127 @@
10241033
"type": "serial in",
10251034
"z": "09012e75c72a4968",
10261035
"name": "",
1036+
"serial": "94b8abb47e4cb1f2",
1037+
"x": 90,
1038+
"y": 180,
1039+
"wires": [
1040+
[
1041+
"ead8458e27835fd5"
1042+
]
1043+
]
1044+
},
1045+
{
1046+
"id": "d86ee55246645576",
1047+
"type": "serial in",
1048+
"z": "09012e75c72a4968",
1049+
"name": "",
10271050
"serial": "",
1028-
"x": 230,
1029-
"y": 240,
1051+
"x": 90,
1052+
"y": 220,
1053+
"wires": [
1054+
[
1055+
"f5d4b6da7502dcc5"
1056+
]
1057+
]
1058+
},
1059+
{
1060+
"id": "f58ad2d2abbb5940",
1061+
"type": "serial in",
1062+
"z": "09012e75c72a4968",
1063+
"name": "",
1064+
"serial": "",
1065+
"x": 90,
1066+
"y": 260,
1067+
"wires": [
1068+
[
1069+
"95a015623724305b"
1070+
]
1071+
]
1072+
},
1073+
{
1074+
"id": "31a34bfbb86c9ddc",
1075+
"type": "serial in",
1076+
"z": "09012e75c72a4968",
1077+
"name": "",
1078+
"serial": "",
1079+
"x": 90,
1080+
"y": 300,
1081+
"wires": [
1082+
[
1083+
"490f2072cd94d40a"
1084+
]
1085+
]
1086+
},
1087+
{
1088+
"id": "ead8458e27835fd5",
1089+
"type": "function",
1090+
"z": "09012e75c72a4968",
1091+
"name": "setSerial",
1092+
"func": "msg.serialID = \"/dev/tty/USB0\"\nreturn msg;",
1093+
"outputs": 1,
1094+
"noerr": 0,
1095+
"initialize": "",
1096+
"finalize": "",
1097+
"libs": [],
1098+
"x": 240,
1099+
"y": 180,
1100+
"wires": [
1101+
[
1102+
"272e66b82d47e0e4"
1103+
]
1104+
]
1105+
},
1106+
{
1107+
"id": "f5d4b6da7502dcc5",
1108+
"type": "function",
1109+
"z": "09012e75c72a4968",
1110+
"name": "setSerial",
1111+
"func": "msg.serialID = \"/dev/tty/USB1\"\n\nreturn msg;",
1112+
"outputs": 1,
1113+
"noerr": 0,
1114+
"initialize": "",
1115+
"finalize": "",
1116+
"libs": [],
1117+
"x": 240,
1118+
"y": 220,
1119+
"wires": [
1120+
[
1121+
"272e66b82d47e0e4"
1122+
]
1123+
]
1124+
},
1125+
{
1126+
"id": "95a015623724305b",
1127+
"type": "function",
1128+
"z": "09012e75c72a4968",
1129+
"name": "setSerial",
1130+
"func": "msg.serialID = \"/dev/tty/USB2\"\n\nreturn msg;",
1131+
"outputs": 1,
1132+
"noerr": 0,
1133+
"initialize": "",
1134+
"finalize": "",
1135+
"libs": [],
1136+
"x": 240,
1137+
"y": 260,
1138+
"wires": [
1139+
[
1140+
"272e66b82d47e0e4"
1141+
]
1142+
]
1143+
},
1144+
{
1145+
"id": "490f2072cd94d40a",
1146+
"type": "function",
1147+
"z": "09012e75c72a4968",
1148+
"name": "setSerial",
1149+
"func": "msg.serialID = \"/dev/tty/USB3\"\n\nreturn msg;",
1150+
"outputs": 1,
1151+
"noerr": 0,
1152+
"initialize": "",
1153+
"finalize": "",
1154+
"libs": [],
1155+
"x": 240,
1156+
"y": 300,
10301157
"wires": [
10311158
[
10321159
"272e66b82d47e0e4"

0 commit comments

Comments
 (0)