實驗 ESP32 + RFID (Create Mode 建立資料模式/ Query Mode查詢資料模式)
[{"id":"fc2bc05aaeb53a69","type":"ui_button","z":"7aebcf1d53039222","name":"","group":"fe68da70e8d7a3c8","order":21,"width":"4","height":"1","passthru":false,"label":"建立資料庫","tooltip":"","color":"","bgcolor":"","className":"","icon":"","payload":"建立資料庫","payloadType":"str","topic":"topic","topicType":"msg","x":90,"y":60,"wires":[["829a7127d56826ac","14eacaf6ab54d79d"]]},{"id":"4438df7c6a76e928","type":"ui_button","z":"7aebcf1d53039222","name":"","group":"fe68da70e8d7a3c8","order":45,"width":"4","height":"1","passthru":false,"label":"檢視資料","tooltip":"","color":"","bgcolor":"","className":"","icon":"","payload":"檢視資料","payloadType":"str","topic":"topic","topicType":"msg","x":80,"y":400,"wires":[["494b685c1733dc8f","9e276d6d151de3a9"]]},{"id":"36c87a2c69aedce2","type":"ui_button","z":"7aebcf1d53039222","name":"","group":"fe68da70e8d7a3c8","order":47,"width":"4","height":"1","passthru":false,"label":"刪除所有資料","tooltip":"","color":"","bgcolor":"","className":"","icon":"","payload":"刪除所有資料","payloadType":"str","topic":"topic","topicType":"msg","x":100,"y":520,"wires":[["f6ae9a1ac227ccf2","9e276d6d151de3a9"]]},{"id":"8252e64dda450261","type":"sqlite","z":"7aebcf1d53039222","mydb":"dd7f8134e015a1cb","sqlquery":"msg.topic","sql":"","name":"My_RFID_database","x":540,"y":60,"wires":[["168b6d52dfb43542"]]},{"id":"829a7127d56826ac","type":"function","z":"7aebcf1d53039222","name":"CREATE DATABASE","func":"\n\n//CREATE TABLE \"RFIDtable\" (\n//\t\"id\"\tINT NOT NULL,\n// \"uidname\" TEXT,\n// \"currentdate\" DATE, \n// \"currenttime\" TIME\n//\tPRIMARY KEY(\"id\")\n//);\nmsg.topic = \"CREATE TABLE RFIDtable(id INTEGER PRIMARY KEY AUTOINCREMENT, uidname TEXT, currentdate DATE, currenttime TIME)\";\nreturn msg;\n","outputs":1,"noerr":0,"initialize":"","finalize":"","libs":[],"x":300,"y":60,"wires":[["8252e64dda450261"]]},{"id":"168b6d52dfb43542","type":"debug","z":"7aebcf1d53039222","name":"debug 97","active":true,"tosidebar":true,"console":false,"tostatus":false,"complete":"false","statusVal":"","statusType":"auto","x":740,"y":60,"wires":[]},{"id":"c0527e21b1adaf97","type":"function","z":"7aebcf1d53039222","name":"INSERT","func":"var Today = new Date();\nvar yyyy = Today.getFullYear(); //年\nvar MM = Today.getMonth()+1; //月\nvar dd = Today.getDate(); //日\nvar h = Today.getHours(); //時\nvar m = Today.getMinutes(); //分\nvar s = Today.getSeconds(); //秒\nif(MM<10)\n{\n MM = '0'+MM;\n}\n\nif(dd<10)\n{\n dd = '0'+dd;\n}\n\nif(h<10)\n{\n h = '0'+h;\n}\n\nif(m<10)\n{\n m = '0' + m;\n}\n\nif(s<10)\n{\n s = '0' + s;\n}\nvar var_date = yyyy+'/'+MM+'/'+dd;\nvar var_time = h+':'+m+':'+s;\n\nvar myRFID = flow.get('uid_temp');\n\n\nmsg.topic = \"INSERT INTO RFIDtable ( uidname , currentdate, currenttime ) VALUES ($myRFID, $var_date , $var_time ) \" ;\nmsg.payload = [myRFID, var_date , var_time ]\nreturn msg;\n\n//CREATE TABLE \"RFIDtable\" (\n//\t\"id\"\tINT NOT NULL,\n// \"uidname\" TEXT,\n// \"currentdate\" DATE, \n// \"currenttime\" TIME\n//\tPRIMARY KEY(\"id\")\n//);","outputs":1,"noerr":0,"initialize":"","finalize":"","libs":[],"x":320,"y":100,"wires":[["4717378946fa2f42","8252e64dda450261"]]},{"id":"f6ae9a1ac227ccf2","type":"function","z":"7aebcf1d53039222","name":"刪除所有資料","func":"//DELETE from RFIDtable\nmsg.topic = \"DELETE from RFIDtable\";\nreturn msg;\n","outputs":1,"noerr":0,"initialize":"","finalize":"","libs":[],"x":320,"y":520,"wires":[["b8a824f5153c6fd8"]]},{"id":"b8a824f5153c6fd8","type":"sqlite","z":"7aebcf1d53039222","mydb":"dd7f8134e015a1cb","sqlquery":"msg.topic","sql":"","name":"My_RFID_database","x":540,"y":540,"wires":[["9339112b5f11b666"]]},{"id":"22d6aa6b9b59b1ef","type":"ui_button","z":"7aebcf1d53039222","name":"","group":"fe68da70e8d7a3c8","order":47,"width":"4","height":"1","passthru":false,"label":"刪除資料庫","tooltip":"","color":"","bgcolor":"","className":"","icon":"","payload":"刪除資料庫","payloadType":"str","topic":"topic","topicType":"msg","x":90,"y":560,"wires":[["a19483da5e58cbf4","9e276d6d151de3a9"]]},{"id":"a19483da5e58cbf4","type":"function","z":"7aebcf1d53039222","name":"刪除資料庫","func":"//DROP TABLE RFIDtable\nmsg.topic = \"DROP TABLE RFIDtable\";\nreturn msg;\n","outputs":1,"noerr":0,"initialize":"","finalize":"","libs":[],"x":310,"y":560,"wires":[["b8a824f5153c6fd8"]]},{"id":"47110d4be5ce7045","type":"ui_template","z":"7aebcf1d53039222","group":"fe68da70e8d7a3c8","name":"","order":0,"width":"12","height":"10","format":"<table style=\"width:100%\">\n <tr>\n <th>idex</th> \n <th>database_id</th>\n <th>UID </th>\n <th>Date</th>\n <th>Times</th>\n </tr>\n \n <tr ng-repeat=\"x in msg.payload | limitTo:50\">\n <td>{{$index}}</td>\n <td>{{msg.payload[$index].id}}</td>\n <td>{{msg.payload[$index].uidname}}</td>\n <td>{{msg.payload[$index].currentdate}}</td>\n <td>{{msg.payload[$index].currenttime}}</td>\n </tr>\n</table>","storeOutMessages":true,"fwdInMessages":true,"resendOnRefresh":true,"templateScope":"local","className":"","x":780,"y":600,"wires":[[]]},{"id":"9339112b5f11b666","type":"debug","z":"7aebcf1d53039222","name":"","active":true,"tosidebar":true,"console":false,"tostatus":false,"complete":"false","x":770,"y":540,"wires":[]},{"id":"494b685c1733dc8f","type":"function","z":"7aebcf1d53039222","name":"檢視資料","func":"\n//CREATE TABLE \"RFIDtable\" (\n//\t\"id\"\tINT NOT NULL,\n// \"uidname\" TEXT,\n// \"currentdate\" DATE, \n// \"currenttime\" TIME\n//\tPRIMARY KEY(\"id\")\n//);\n\n//SELECT * FROM RFIDtable ORDER BY id DESC LIMIT 50;\n\nmsg.topic = \"SELECT * FROM RFIDtable ORDER BY id DESC LIMIT 50\";\nreturn msg;","outputs":1,"noerr":0,"initialize":"","finalize":"","libs":[],"x":300,"y":360,"wires":[["313ed708cbe77e86"]]},{"id":"313ed708cbe77e86","type":"sqlite","z":"7aebcf1d53039222","mydb":"dd7f8134e015a1cb","sqlquery":"msg.topic","sql":"","name":"My_RFID_database","x":540,"y":360,"wires":[["47110d4be5ce7045"]]},{"id":"95fbcdf86ed8fbcb","type":"function","z":"7aebcf1d53039222","name":"SELECT ALL","func":"var del_idtemp=msg.payload;\nflow.set(\"idtemp\", del_idtemp);\n\nmsg.topic = \"SELECT * FROM RFIDtable \";\nreturn msg;","outputs":1,"noerr":0,"initialize":"","finalize":"","libs":[],"x":310,"y":480,"wires":[["b8a824f5153c6fd8","f9cbb712b6ee61a0"]]},{"id":"a1677f0f8fd20351","type":"function","z":"7aebcf1d53039222","name":"確認 刪除","func":"var del_id = flow.get(\"idtemp\");\n\n\nmsg.topic = \"DELETE FROM RFIDtable WHERE id= ($del_id) \" ;\nmsg.payload = [del_id]\nreturn msg;\n","outputs":1,"noerr":0,"initialize":"","finalize":"","libs":[],"x":300,"y":440,"wires":[["a696ffa0a72fbd77"]]},{"id":"6395bc41a36b7b4f","type":"ui_numeric","z":"7aebcf1d53039222","name":"","label":"刪除的database_id","tooltip":"","group":"fe68da70e8d7a3c8","order":30,"width":"4","height":"1","wrap":false,"passthru":true,"topic":"topic","topicType":"msg","format":"{{value}}","min":"1","max":"100","step":1,"className":"","x":110,"y":480,"wires":[["95fbcdf86ed8fbcb","9e276d6d151de3a9"]]},{"id":"a696ffa0a72fbd77","type":"sqlite","z":"7aebcf1d53039222","mydb":"dd7f8134e015a1cb","sqlquery":"msg.topic","sql":"DELETE FROM dhtreadings WHERE id = VALUES ($theid)","name":"My_RFID_database","x":540,"y":440,"wires":[["494b685c1733dc8f"]]},{"id":"dd7e69860ea9730d","type":"ui_button","z":"7aebcf1d53039222","name":"","group":"fe68da70e8d7a3c8","order":44,"width":"4","height":"1","passthru":false,"label":"刪除一筆資料","tooltip":"","color":"","bgcolor":"","className":"","icon":"","payload":"刪除一筆資料","payloadType":"str","topic":"topic","topicType":"msg","x":100,"y":440,"wires":[["a1677f0f8fd20351","9e276d6d151de3a9"]]},{"id":"f9cbb712b6ee61a0","type":"debug","z":"7aebcf1d53039222","name":"debug 98","active":true,"tosidebar":true,"console":false,"tostatus":false,"complete":"false","statusVal":"","statusType":"auto","x":500,"y":480,"wires":[]},{"id":"caa123a28d1ba978","type":"mqtt in","z":"7aebcf1d53039222","name":"新增 RFID","topic":"alex9ufo/esp32/RFID","qos":"2","datatype":"auto-detect","broker":"841df58d.ee5e98","nl":false,"rap":true,"rh":0,"inputs":0,"x":80,"y":100,"wires":[["9a20eee86e8ad641"]]},{"id":"4717378946fa2f42","type":"debug","z":"7aebcf1d53039222","name":"debug 100","active":true,"tosidebar":true,"console":false,"tostatus":false,"complete":"false","statusVal":"","statusType":"auto","x":510,"y":100,"wires":[]},{"id":"2dddad4e20242887","type":"ui_text_input","z":"7aebcf1d53039222","name":"","label":"新增一筆資料","tooltip":"","group":"fe68da70e8d7a3c8","order":7,"width":"4","height":"1","passthru":true,"mode":"text","delay":300,"topic":"topic","sendOnBlur":true,"className":"","topicType":"msg","x":320,"y":180,"wires":[[]]},{"id":"db8cbbfbf7372391","type":"ui_audio","z":"7aebcf1d53039222","name":"","group":"fe68da70e8d7a3c8","voice":"Microsoft Hanhan - Chinese (Traditional, Taiwan)","always":true,"x":520,"y":220,"wires":[]},{"id":"b59d1f7d9c7476ae","type":"function","z":"7aebcf1d53039222","name":"function ","func":"var temp= msg.payload;\nmsg.payload= \"新增一筆資料\" + temp;\nreturn msg;","outputs":1,"noerr":0,"initialize":"","finalize":"","libs":[],"x":300,"y":220,"wires":[["db8cbbfbf7372391"]]},{"id":"9e276d6d151de3a9","type":"ui_audio","z":"7aebcf1d53039222","name":"","group":"fe68da70e8d7a3c8","voice":"Microsoft Hanhan - Chinese (Traditional, Taiwan)","always":true,"x":300,"y":400,"wires":[]},{"id":"14eacaf6ab54d79d","type":"ui_audio","z":"7aebcf1d53039222","name":"","group":"fe68da70e8d7a3c8","voice":"Microsoft Hanhan - Chinese (Traditional, Taiwan)","always":true,"x":260,"y":20,"wires":[]},{"id":"4fe73a3f32e32aae","type":"function","z":"7aebcf1d53039222","name":"function 28","func":"//SELECT trackid,name FROM \ttracks WHERE name LIKE 'Wild%'\n//Query\n//CREATE TABLE \"RFIDtable\" (\n//\t\"id\"\tINT NOT NULL,\n// \"uidname\" TEXT,\n// \"currentdate\" DATE, \n// \"currenttime\" TIME\n//\tPRIMARY KEY(\"id\")\n//);\n//msg.topic = \"DELETE FROM RFIDtable WHERE id= ($del_id) \" ;\n\nvar query_uid = flow.get(\"uidtemp\");\nmsg.topic = \"SELECT id,uidname , currentdate,currenttime FROM RFIDtable WHERE uidname LIKE ($query_uid) \";\nmsg.payload = [query_uid]\nreturn msg;\n","outputs":1,"noerr":0,"initialize":"","finalize":"","libs":[],"x":310,"y":620,"wires":[["11db58eea02242d6","8cc3b2d4a2e0c2ad"]]},{"id":"dff10ddc84b7725b","type":"ui_button","z":"7aebcf1d53039222","name":"","group":"fe68da70e8d7a3c8","order":47,"width":"4","height":"1","passthru":false,"label":"比對資料庫","tooltip":"","color":"","bgcolor":"","className":"","icon":"","payload":"比對資料庫","payloadType":"str","topic":"topic","topicType":"msg","x":90,"y":620,"wires":[["4fe73a3f32e32aae","9e276d6d151de3a9"]]},{"id":"11db58eea02242d6","type":"sqlite","z":"7aebcf1d53039222","mydb":"dd7f8134e015a1cb","sqlquery":"msg.topic","sql":"","name":"My_RFID_database","x":520,"y":600,"wires":[["47110d4be5ce7045"]]},{"id":"a83116faa47d545b","type":"function","z":"7aebcf1d53039222","name":"SELECT ALL","func":"var query_uidtemp=msg.payload;\nflow.set(\"uidtemp\", query_uidtemp);\nreturn msg;","outputs":1,"noerr":0,"initialize":"","finalize":"","libs":[],"x":450,"y":300,"wires":[["e1bd2312d9d75c33","1f6cab4a3faa5a34","849285c6d862a825"]]},{"id":"0dcfe7e23ec3c8c6","type":"ui_text_input","z":"7aebcf1d53039222","name":"","label":"手動查詢資料的uidname","tooltip":"","group":"fe68da70e8d7a3c8","order":7,"width":"3","height":"1","passthru":true,"mode":"text","delay":300,"topic":"topic","sendOnBlur":true,"className":"","topicType":"msg","x":130,"y":320,"wires":[["a83116faa47d545b"]]},{"id":"76d47afb96854c79","type":"function","z":"7aebcf1d53039222","name":"function 29","func":"var query=msg.payload;\n\nif (query===true)\n msg.payload='Query';\nelse\n msg.payload='NotQuery';\n\nflow.set(\"query_temp\", msg.payload);\nreturn msg;","outputs":1,"noerr":0,"initialize":"","finalize":"","libs":[],"x":270,"y":720,"wires":[["ec89465107e38418","947c484be235b8d6"]]},{"id":"59050f8131bad219","type":"ui_switch","z":"7aebcf1d53039222","name":"","label":"比對模式","tooltip":"","group":"fe68da70e8d7a3c8","order":13,"width":"4","height":"1","passthru":true,"decouple":"false","topic":"topic","topicType":"msg","style":"","onvalue":"true","onvalueType":"bool","onicon":"","oncolor":"","offvalue":"false","offvalueType":"bool","officon":"","offcolor":"","animate":false,"className":"","x":120,"y":720,"wires":[["76d47afb96854c79"]]},{"id":"ec89465107e38418","type":"debug","z":"7aebcf1d53039222","name":"debug 101","active":true,"tosidebar":true,"console":false,"tostatus":false,"complete":"false","statusVal":"","statusType":"auto","x":450,"y":680,"wires":[]},{"id":"ee77739695d43996","type":"switch","z":"7aebcf1d53039222","name":"","property":"payload","propertyType":"msg","rules":[{"t":"eq","v":"Create","vt":"str"},{"t":"eq","v":"Query","vt":"str"}],"checkall":"true","repair":false,"outputs":2,"x":110,"y":240,"wires":[["c0527e21b1adaf97","2dddad4e20242887","b59d1f7d9c7476ae","d460ec040d8dfba3"],["128f986570836ed5","2dddad4e20242887","dc12c41266f3357e"]]},{"id":"9a20eee86e8ad641","type":"function","z":"7aebcf1d53039222","name":"function ","func":"var query = flow.get(\"query_temp\");\n\nflow.set(\"uid_temp\", msg.payload);\n\nif (query==='NotQuery')\n msg.payload='Create'\nelse\n msg.payload='Query'\n \nreturn msg;","outputs":1,"noerr":0,"initialize":"","finalize":"","libs":[],"x":100,"y":160,"wires":[["ee77739695d43996"]]},{"id":"d460ec040d8dfba3","type":"debug","z":"7aebcf1d53039222","name":"debug 102","active":true,"tosidebar":true,"console":false,"tostatus":false,"complete":"false","statusVal":"","statusType":"auto","x":310,"y":140,"wires":[]},{"id":"947c484be235b8d6","type":"ui_audio","z":"7aebcf1d53039222","name":"","group":"fe68da70e8d7a3c8","voice":"Microsoft Hanhan - Chinese (Traditional, Taiwan)","always":true,"x":440,"y":720,"wires":[]},{"id":"8cc3b2d4a2e0c2ad","type":"debug","z":"7aebcf1d53039222","name":"debug 103","active":true,"tosidebar":true,"console":false,"tostatus":false,"complete":"false","statusVal":"","statusType":"auto","x":490,"y":640,"wires":[]},{"id":"e1bd2312d9d75c33","type":"debug","z":"7aebcf1d53039222","name":"debug 104","active":true,"tosidebar":true,"console":false,"tostatus":false,"complete":"false","statusVal":"","statusType":"auto","x":650,"y":300,"wires":[]},{"id":"128f986570836ed5","type":"function","z":"7aebcf1d53039222","name":"function","func":"\nvar a= flow.get(\"uid_temp\");\nmsg.payload=a;\nreturn msg;","outputs":1,"noerr":0,"initialize":"","finalize":"","libs":[],"x":300,"y":260,"wires":[["a83116faa47d545b","db8cbbfbf7372391"]]},{"id":"1f6cab4a3faa5a34","type":"ui_text","z":"7aebcf1d53039222","group":"fe68da70e8d7a3c8","order":15,"width":"6","height":"1","name":"","label":"自動感應RFID查詢的uid","format":"{{msg.payload}}","layout":"row-left","className":"","x":690,"y":260,"wires":[]},{"id":"849285c6d862a825","type":"link out","z":"7aebcf1d53039222","name":"link out 6","mode":"link","links":[],"x":555,"y":320,"wires":[]},{"id":"ff0de732e7d26279","type":"link in","z":"7aebcf1d53039222","name":"link in 8","links":["dc12c41266f3357e"],"x":195,"y":660,"wires":[["4fe73a3f32e32aae"]]},{"id":"80fbdfa158d7bc38","type":"function","z":"7aebcf1d53039222","name":"function 30","func":"//CREATE TABLE \"RFIDtable\" (\n//\t\"id\"\tINT NOT NULL,\n// \"uidname\" TEXT,\n// \"currentdate\" DATE, \n// \"currenttime\" TIME\n//\tPRIMARY KEY(\"id\")\n//);\n\n//msg.topic = \"INSERT INTO RFIDtable ( uidname , currentdate, currenttime ) VALUES ($myRFID, $var_date , $var_time ) \" ;\n//msg.payload = [myRFID, var_date , var_time ]\n//return msg;\n\n\nvar tmp=msg.payload;\nmsg.topic = \"select count( * ) as 總共有幾筆資料 from RFIDtable where uidname=($tmp)\";\nmsg.payload=[tmp];\nreturn msg;\n\n// select count( * ) as 總共有幾筆資料 from Customers where address='Japan'","outputs":1,"noerr":0,"initialize":"","finalize":"","libs":[],"x":450,"y":800,"wires":[["ac8bdacba184f913","44ad8d06ee76a719"]]},{"id":"ac8bdacba184f913","type":"sqlite","z":"7aebcf1d53039222","mydb":"dd7f8134e015a1cb","sqlquery":"msg.topic","sql":"","name":"My_RFID_database","x":660,"y":820,"wires":[["6f50e1c744ecda81"]]},{"id":"499a0d6a5fb36a58","type":"ui_button","z":"7aebcf1d53039222","name":"","group":"fe68da70e8d7a3c8","order":47,"width":"4","height":"1","passthru":false,"label":"查詢資料庫筆數","tooltip":"","color":"","bgcolor":"","className":"","icon":"","payload":"查詢資料庫筆數","payloadType":"str","topic":"topic","topicType":"msg","x":100,"y":800,"wires":[["2fe6c9d03dc59da1","e6e485ec7f2a200b"]]},{"id":"2fe6c9d03dc59da1","type":"ui_audio","z":"7aebcf1d53039222","name":"","group":"fe68da70e8d7a3c8","voice":"Microsoft Hanhan - Chinese (Traditional, Taiwan)","always":true,"x":260,"y":840,"wires":[]},{"id":"6f50e1c744ecda81","type":"function","z":"7aebcf1d53039222","name":"function 32","func":"var num=msg.payload[0].總共有幾筆資料;\nmsg.payload=num;\nreturn msg; \n","outputs":1,"noerr":0,"initialize":"","finalize":"","libs":[],"x":730,"y":860,"wires":[["9c04fa31529ec812","54d5490f22326093"]]},{"id":"f741e97ad96ae0ba","type":"ui_text","z":"7aebcf1d53039222","group":"fe68da70e8d7a3c8","order":18,"width":"4","height":"1","name":"","label":"查詢結果","format":"<font face='arial'><font size=3><font color={{fcolor}}>{{msg.payload}}","layout":"row-left","className":"","x":1100,"y":920,"wires":[]},{"id":"faa59de5d672528c","type":"ui_text","z":"7aebcf1d53039222","group":"fe68da70e8d7a3c8","order":18,"width":"4","height":"1","name":"","label":"查詢結果","format":"<font face='arial'><font size=6><font color={{fcolor}}>{{msg.payload}}","layout":"row-left","className":"","x":1100,"y":800,"wires":[]},{"id":"6375700e7c087c21","type":"mqtt in","z":"7aebcf1d53039222","name":"","topic":"alex9ufo/esp32/Starting","qos":"2","datatype":"auto-detect","broker":"841df58d.ee5e98","nl":false,"rap":true,"rh":0,"inputs":0,"x":120,"y":880,"wires":[["19ae5b4724b21220","5cbe733362b0a2c1","c7750dce80132922"]]},{"id":"19ae5b4724b21220","type":"ui_audio","z":"7aebcf1d53039222","name":"","group":"fe68da70e8d7a3c8","voice":"Microsoft Hanhan - Chinese (Traditional, Taiwan)","always":true,"x":340,"y":920,"wires":[]},{"id":"5cbe733362b0a2c1","type":"debug","z":"7aebcf1d53039222","name":"debug 105","active":true,"tosidebar":true,"console":false,"tostatus":false,"complete":"false","statusVal":"","statusType":"auto","x":350,"y":960,"wires":[]},{"id":"c7750dce80132922","type":"change","z":"7aebcf1d53039222","name":"","rules":[{"t":"set","p":"fcolor","pt":"msg","to":"red","tot":"str"}],"action":"","property":"","from":"","to":"","reg":false,"x":360,"y":880,"wires":[["037e07e24e48cbf2"]]},{"id":"037e07e24e48cbf2","type":"ui_text","z":"7aebcf1d53039222","group":"fe68da70e8d7a3c8","order":7,"width":"3","height":"1","name":"","label":"","format":"<font face='arial'><font size=4><font color={{fcolor}}>{{msg.payload}}","layout":"row-left","className":"","x":530,"y":900,"wires":[]},{"id":"44ad8d06ee76a719","type":"debug","z":"7aebcf1d53039222","name":"debug 106","active":true,"tosidebar":true,"console":false,"tostatus":false,"complete":"false","statusVal":"","statusType":"auto","x":650,"y":780,"wires":[]},{"id":"9c04fa31529ec812","type":"change","z":"7aebcf1d53039222","name":"","rules":[{"t":"set","p":"fcolor","pt":"msg","to":"red","tot":"str"}],"action":"","property":"","from":"","to":"","reg":false,"x":920,"y":840,"wires":[["faa59de5d672528c","7ffccaea91f35248"]]},{"id":"cfea639fc377d148","type":"change","z":"7aebcf1d53039222","name":"","rules":[{"t":"set","p":"fcolor","pt":"msg","to":"red","tot":"str"}],"action":"","property":"","from":"","to":"","reg":false,"x":940,"y":920,"wires":[["f741e97ad96ae0ba"]]},{"id":"e6e485ec7f2a200b","type":"function","z":"7aebcf1d53039222","name":"function","func":"\nvar a= flow.get(\"uid_temp\");\nmsg.payload=a;\nreturn msg;","outputs":1,"noerr":0,"initialize":"","finalize":"","libs":[],"x":280,"y":800,"wires":[["80fbdfa158d7bc38"]]},{"id":"dc12c41266f3357e","type":"link out","z":"7aebcf1d53039222","name":"link out 7","mode":"link","links":["65ab9064522e3976","ff0de732e7d26279"],"x":195,"y":280,"wires":[]},{"id":"65ab9064522e3976","type":"link in","z":"7aebcf1d53039222","name":"link in 9","links":["dc12c41266f3357e"],"x":165,"y":760,"wires":[["e6e485ec7f2a200b"]]},{"id":"f2f92a741a2661bf","type":"inject","z":"7aebcf1d53039222","name":"","props":[{"p":"payload"},{"p":"topic","vt":"str"}],"repeat":"","crontab":"","once":true,"onceDelay":"2","topic":"true","payload":"true","payloadType":"str","x":80,"y":680,"wires":[["59050f8131bad219"]]},{"id":"7deca06e980ec3c7","type":"ui_audio","z":"7aebcf1d53039222","name":"","group":"fe68da70e8d7a3c8","voice":"Microsoft Hanhan - Chinese (Traditional, Taiwan)","always":true,"x":1060,"y":980,"wires":[]},{"id":"7ffccaea91f35248","type":"debug","z":"7aebcf1d53039222","name":"debug 107","active":true,"tosidebar":true,"console":false,"tostatus":false,"complete":"false","statusVal":"","statusType":"auto","x":1110,"y":840,"wires":[]},{"id":"6ba9d7a1d8dc4696","type":"delay","z":"7aebcf1d53039222","name":"","pauseType":"delay","timeout":"3","timeoutUnits":"seconds","rate":"1","nbRateUnits":"1","rateUnits":"second","randomFirst":"1","randomLast":"5","randomUnits":"seconds","drop":false,"allowrate":false,"outputs":1,"x":920,"y":980,"wires":[["7deca06e980ec3c7"]]},{"id":"54d5490f22326093","type":"function","z":"7aebcf1d53039222","name":"function 34","func":"var n=msg.payload;\nif (n>0)\n msg.payload='RFID符合';\nelse\n msg.payload='RFID錯誤';\nreturn msg;","outputs":1,"noerr":0,"initialize":"","finalize":"","libs":[],"x":750,"y":940,"wires":[["6ba9d7a1d8dc4696","cfea639fc377d148"]]},{"id":"fe68da70e8d7a3c8","type":"ui_group","name":"2023 RFID","tab":"eeb8e179.a47a4","order":3,"disp":true,"width":"14","collapse":false,"className":""},{"id":"dd7f8134e015a1cb","type":"sqlitedb","db":"C:\\Users\\User\\.node-red\\my_2023rfid.db","mode":"RWC"},{"id":"841df58d.ee5e98","type":"mqtt-broker","name":"","broker":"broker.mqtt-dashboard.com","port":"1883","clientid":"","usetls":false,"compatmode":false,"keepalive":"15","cleansession":true,"birthTopic":"","birthQos":"0","birthPayload":"","closeTopic":"","closePayload":"","willTopic":"","willQos":"0","willPayload":""},{"id":"eeb8e179.a47a4","type":"ui_tab","name":"RFID Database","icon":"dashboard","disabled":false,"hidden":false}]
沒有留言:
張貼留言