Using ESP8266 running frankenstein firmware for reading DS18B20

This flow makes a TCP connection to a frankenstein equipped ESP8266 and runs the ds18b20 command with a pin # specified in the flow. The hostname of the ESP8266 and the pin will probably need to be changed for your environment. You will absolutely need to put in your thinkspeak API key

This pumps the result to thingspeak and an mqtt publish.

Prototype of using the raw frankenstein in Node-Red.

[{"id":"e8835a.512c7ca8","type":"mqtt-broker","broker":"localhost","port":"1883","clientid":""},{"id":"54e75a26.ab18a4","type":"tcp request","server":"192.168.1.101","port":"23","out":"char","splitc":"10","name":"get temperature","x":464,"y":87,"z":"406c2328.bf93dc","wires":[["51d563e.fae2a9c"]]},{"id":"b6fb6d6b.49049","type":"inject","name":"pump","topic":"","payload":"LHZ\\r\\n","payloadType":"date","repeat":"300","crontab":"","once":true,"x":81,"y":80,"z":"406c2328.bf93dc","wires":[["593543bd.a6cabc"]]},{"id":"593543bd.a6cabc","type":"function","name":"construct ds18b20 cmd","func":"msg.payload = \"\\n\\r\\n\\r\\n\\rds18b20 2\\n\\r\"\nreturn msg;","outputs":1,"valid":true,"x":259,"y":88,"z":"406c2328.bf93dc","wires":[["54e75a26.ab18a4"]]},{"id":"51d563e.fae2a9c","type":"function","name":"stringify","func":"msg.payload = msg.payload.toString()\nreturn msg;","outputs":1,"valid":true,"x":627,"y":89,"z":"406c2328.bf93dc","wires":[["95a25950.6a5da8"]]},{"id":"390165a4.c6fe9a","type":"debug","name":"temperature parsed","active":true,"console":"false","complete":"payload","x":645,"y":167,"z":"406c2328.bf93dc","wires":[]},{"id":"c5d620ea.3a29e","type":"thingspeak","name":"thinkspeak plot","api_key":"APIKEY","field":"field2","x":491,"y":308,"z":"406c2328.bf93dc","wires":[]},{"id":"95a25950.6a5da8","type":"function","name":"parse reply","func":"var rstr = msg.payload.toString();\n\nvar T = null;\nvar other = null;\n\nif (rstr.indexOf(\"Temperature: \") > -1) {\n    var tmp = rstr.split(/[\\s,]+/);\n    T = { payload : tmp[1] };\n} else {\n    other = { payload : rstr };\n}\n\nreturn [ T, other ];","outputs":"2","valid":true,"x":236,"y":171,"z":"406c2328.bf93dc","wires":[["390165a4.c6fe9a","2e1f04fa.d1e0fc","c5d620ea.3a29e"],["ce09b461.31f648"]]},{"id":"ce09b461.31f648","type":"debug","name":"other","active":false,"console":"false","complete":"payload","x":635,"y":259,"z":"406c2328.bf93dc","wires":[]},{"id":"2e1f04fa.d1e0fc","type":"mqtt out","name":"publish","topic":"/temperature","qos":"0","retain":"false","broker":"e8835a.512c7ca8","x":260,"y":304,"z":"406c2328.bf93dc","wires":[]}]
beckdac

Flow Info

created 2 years, 1 month ago

Node Types

Core
  • debug (x2)
  • function (x3)
  • inject (x1)
  • mqtt out (x1)
  • mqtt-broker (x1)
  • tcp request (x1)
Other
  • thingspeak (x1)

Tags

  • frankenstein
  • ds18b20
  • esp8266
Copy this flow JSON to your clipboard and then import into Node-RED using the Import From > Clipboard (Ctrl-I) menu option