2019年11月24日 星期日

Windwos 使用 SQLite於Node-RED中 (2)

Windwos 使用 SQLite於Node-RED中 (2)






[{"id":"c0ba6dfa.a85dd","type":"inject","z":"72a12cfc.f771e4","name":"CREATE","topic":"CREATE TABLE dhtreadings(id INTEGER PRIMARY KEY AUTOINCREMENT, temperature NUMERIC, humidity NUMERIC, currentdate DATE, currenttime TIME, device TEXT)","payload":"","payloadType":"date","repeat":"","crontab":"","once":false,"onceDelay":0.1,"x":125,"y":48,"wires":[["1a34e68f.e39ff9"]]},{"id":"2e776df3.a57812","type":"inject","z":"72a12cfc.f771e4","name":"INSERT","topic":"INSERT INTO dhtreadings(temperature, humidity, currentdate, currenttime, device) values(22.4, 48, date('now'), time('now'), \"manual\")","payload":"","payloadType":"date","repeat":"","crontab":"","once":false,"onceDelay":0.1,"x":125,"y":108,"wires":[["1a34e68f.e39ff9"]]},{"id":"c068385d.8a3638","type":"inject","z":"72a12cfc.f771e4","name":"SELECT","topic":"SELECT * FROM dhtreadings","payload":"","payloadType":"date","repeat":"","crontab":"","once":false,"onceDelay":0.1,"x":125,"y":168,"wires":[["1a34e68f.e39ff9"]]},{"id":"5ccaf966.4eece8","type":"inject","z":"72a12cfc.f771e4","name":"DELETE","topic":"DELETE from dhtreadings","payload":"","payloadType":"date","repeat":"","crontab":"","once":false,"onceDelay":0.1,"x":125,"y":228,"wires":[["1a34e68f.e39ff9"]]},{"id":"180db3b.4327a4c","type":"inject","z":"72a12cfc.f771e4","name":"DROP TABLE","topic":"DROP TABLE dhtreadings","payload":"","payloadType":"date","repeat":"","crontab":"","once":false,"onceDelay":0.1,"x":135,"y":288,"wires":[["1a34e68f.e39ff9"]]},{"id":"1a34e68f.e39ff9","type":"sqlite","z":"72a12cfc.f771e4","mydb":"17a5d028.036f8","sqlquery":"msg.topic","sql":"","name":"SQLite","x":305,"y":168,"wires":[["5a91c882.f16008"]]},{"id":"5a91c882.f16008","type":"debug","z":"72a12cfc.f771e4","name":"","active":true,"tosidebar":true,"console":false,"tostatus":false,"complete":"false","x":468,"y":168,"wires":[]},{"id":"b16cf7e3.e28658","type":"sqlite","z":"72a12cfc.f771e4","mydb":"17a5d028.036f8","sqlquery":"msg.topic","sql":"","name":"SQLite","x":310,"y":360,"wires":[["b7961e1d.eb831"]]},{"id":"82b39c8.a4bba6","type":"inject","z":"72a12cfc.f771e4","name":"View Records","topic":"SELECT * FROM dhtreadings","payload":"","payloadType":"date","repeat":"","crontab":"","once":false,"onceDelay":0.1,"x":130,"y":360,"wires":[["b16cf7e3.e28658"]]},{"id":"b7961e1d.eb831","type":"ui_template","z":"72a12cfc.f771e4","group":"2a2a636f.57fcfc","name":"UI Table","order":2,"width":"6","height":"3","format":"<table style=\"width:100%\">\n  <tr>\n    <th>Time</th> \n    <th>Temp</th> \n    <th>Hum</th>\n  </tr>\n  <tr ng-repeat=\"x in msg.payload | limitTo:120\">\n    <td>{{msg.payload[$index].currenttime}}</td>\n    <td>{{msg.payload[$index].temperature}}</td> \n    <td>{{msg.payload[$index].humidity}}</td>\n  </tr>\n</table>","storeOutMessages":true,"fwdInMessages":true,"templateScope":"local","x":480,"y":360,"wires":[[]]},{"id":"17a5d028.036f8","type":"sqlitedb","z":"","db":"C:\\Users\\User\\AppData\\Roaming\\SPB_16.6\\.node-red\\db\\mydb.db","mode":"RWC"},{"id":"2a2a636f.57fcfc","type":"ui_group","z":"","name":"Data","tab":"17a49c76.7ad054","order":3,"disp":true,"width":"6","collapse":false},{"id":"17a49c76.7ad054","type":"ui_tab","z":"","name":"Sqlit3","icon":"photo_camera"}]

沒有留言:

張貼留言

2024_09 作業3 以Node-Red 為主

 2024_09 作業3  (以Node-Red 為主  Arduino 可能需要配合修改 ) Arduino 可能需要修改的部分 1)mqtt broker  2) 主題Topic (發行 接收) 3) WIFI ssid , password const char br...