2020年12月12日 星期六

Nod-Red MQTT 測試程式

Nod-Red MQTT 測試程式

利用亂數產生器 產生溫度濕度送給MQTT Broker








[{"id":"5a45b8da.52b0d8","type":"mqtt in","z":"a14ac84e.f72398","name":"","topic":"alex9ufo/esp32/dht/temperature","qos":"1","datatype":"auto","broker":"e4d9b72d.d14398","x":190,"y":120,"wires":[["3042e15e.80a4ee"]]},{"id":"3042e15e.80a4ee","type":"ui_gauge","z":"a14ac84e.f72398","name":"","group":"37de8fe8.46846","order":2,"width":0,"height":0,"gtype":"gage","title":"Temperature","label":"ºC","format":"{{value}}","min":0,"max":"40","colors":["#00b500","#f7df09","#ca3838"],"seg1":"","seg2":"","x":450,"y":120,"wires":[]},{"id":"8ff168f0.0c74a8","type":"mqtt in","z":"a14ac84e.f72398","name":"","topic":"alex9ufo/esp32/dht/humidity","qos":"1","datatype":"auto","broker":"e4d9b72d.d14398","x":180,"y":200,"wires":[["29251f29.6687c"]]},{"id":"29251f29.6687c","type":"ui_gauge","z":"a14ac84e.f72398","name":"","group":"37de8fe8.46846","order":2,"width":0,"height":0,"gtype":"gage","title":"Humidity","label":"%","format":"{{value}}","min":"30","max":"100","colors":["#53a4e6","#1d78a9","#4e38c9"],"seg1":"","seg2":"","x":440,"y":200,"wires":[]},{"id":"76ff0708.6cfb98","type":"mqtt out","z":"a14ac84e.f72398","name":"","topic":"alex9ufo/esp32/dht/humidity","qos":"1","retain":"","broker":"e4d9b72d.d14398","x":520,"y":300,"wires":[]},{"id":"5595d22f.f517bc","type":"mqtt out","z":"a14ac84e.f72398","name":"","topic":"alex9ufo/esp32/dht/temperature","qos":"1","retain":"","broker":"e4d9b72d.d14398","x":530,"y":360,"wires":[]},{"id":"c7d10b69.439238","type":"function","z":"a14ac84e.f72398","name":"亂數10-100","func":"var min= 30;\nvar max= 100 ;\n\nmsg.payload = Math.floor(Math.random()*(max-min+1))+min;\nreturn msg;","outputs":1,"noerr":0,"initialize":"","finalize":"","x":290,"y":300,"wires":[["76ff0708.6cfb98"]]},{"id":"209f02c1.6c6a5e","type":"function","z":"a14ac84e.f72398","name":"10-40亂數","func":"var min= 10;\nvar max= 40 ;\n\nmsg.payload = Math.floor(Math.random()*(max-min+1))+min;\nreturn msg;\n","outputs":1,"noerr":0,"initialize":"","finalize":"","x":290,"y":360,"wires":[["5595d22f.f517bc"]]},{"id":"93cb2ee9.76dea","type":"inject","z":"a14ac84e.f72398","name":"","props":[{"p":"payload"},{"p":"topic","vt":"str"}],"repeat":"6","crontab":"","once":false,"onceDelay":0.1,"topic":"","payload":"","payloadType":"date","x":121,"y":300,"wires":[["c7d10b69.439238"]]},{"id":"4b88a9f2.6e2ff8","type":"inject","z":"a14ac84e.f72398","name":"","props":[{"p":"payload"},{"p":"topic","vt":"str"}],"repeat":"6","crontab":"","once":false,"onceDelay":0.1,"topic":"","payload":"","payloadType":"date","x":120,"y":360,"wires":[["209f02c1.6c6a5e"]]},{"id":"e4d9b72d.d14398","type":"mqtt-broker","name":"","broker":"broker.mqtt-dashboard.com","port":"1883","clientid":"","usetls":false,"compatmode":true,"keepalive":"15","cleansession":true,"birthTopic":"","birthQos":"0","birthPayload":"","closeTopic":"","closePayload":"","willTopic":"","willQos":"0","willPayload":""},{"id":"37de8fe8.46846","type":"ui_group","name":"DHT","tab":"53b8c8f9.cfbe48","order":1,"disp":true,"width":"6","collapse":false},{"id":"53b8c8f9.cfbe48","type":"ui_tab","name":"Home","icon":"dashboard","order":2,"disabled":false,"hidden":false}]

沒有留言:

張貼留言

113 學年度第 1 學期 RFID應用課程 Arduino程式

113 學年度第 1 學期 RFID應用課程 Arduino程式 https://www.mediafire.com/file/zr0h0p3iosq12jw/MFRC522+(2).7z/file 內含修改過後的 MFRC522 程式庫 (原程式有錯誤) //定義MFRC522...