Commit 85a6a17f authored by Franklin Chen's avatar Franklin Chen

README.md and flows.json added

parent d4bbb47e
# Installation
Running the front end requires Node-RED to be installed.
Once Node-RED is installed, and running, you can access the Flow editor by using your web browser to navigate to:
```sh
localhost:<port>
```
<port> here represents whichever network port Node-RED is configured to use.
- e.g. If Node-RED is configured to port 1880, I would access it by navigating to localhost:1880
After you access the Flow editor, you can simply use the included **flows.json** to *import* and *deploy* the new flow.
**NOTE**: When compiling the code for the ESP32, don't forget to update the SSID and Password for your own network.
# Navigating the Front End
Once you've *deployed* the flow, navigate to the following link to access to front-end.
```sh
localhost:<port>/ui/
```
This will bring you to the ***Home*** tab, which contains readouts for **temperature** and **humidity**.
Toggling **Temperature Scale** will cause the gauge to change between *Celsius* (default) and *Fahrenheit*.
Toggling the **Alarm** switch will send a message to your device to toggle whether the buzzer will sound when the device fails to scan.
Toggling the **LED** switch will send a message to your device to toggle whether the on-board LED will flash when the device scans.
Navigating to the ***Debug*** tab will bring you to readouts of the latest messages receieved on the various channels used.
- **/th-wcv3/*** shows the latest message receieved across the whole system.
- **/temp_c**, **/temp_f**, **/humidity**, and **/switch** all show the latest message receieved in their respective channels.
# Libraries Used
- **DHT sensor library** by Adafruit
- **PubSubClient** by knolleary
\ No newline at end of file
[{"id":"f6f2187d.f17ca8","type":"tab","label":"Flow 1","disabled":false,"info":""},{"id":"3cc11d24.ff01a2","type":"comment","z":"f6f2187d.f17ca8","name":"WARNING: please check you have started this container with a volume that is mounted to /data\\n otherwise any flow changes are lost when you redeploy or upgrade the container\\n (e.g. upgrade to a more recent node-red docker image).\\n If you are using named volumes you can ignore this warning.\\n Double click or see info side panel to learn how to start Node-RED in Docker to save your work","info":"\nTo start docker with a bind mount volume (-v option), for example:\n\n```\ndocker run -it -p 1880:1880 -v /home/user/node_red_data:/data --name mynodered nodered/node-red\n```\n\nwhere `/home/user/node_red_data` is a directory on your host machine where you want to store your flows.\n\nIf you do not do this then you can experiment and redploy flows, but if you restart or upgrade the container the flows will be disconnected and lost. \n\nThey will still exist in a hidden data volume, which can be recovered using standard docker techniques, but that is much more complex than just starting with a named volume as described above.","x":350,"y":80,"wires":[]},{"id":"618191df.e0b5b8","type":"mqtt in","z":"f6f2187d.f17ca8","name":"","topic":"csc113/serialdata/tx","qos":"2","datatype":"auto","broker":"b46c030.3ef3e","x":130,"y":180,"wires":[["817371e6.526cb","d0eac389.d1a5d","d87a123c.5b464","d4c7e182.c535d8","2a0ee812.98bc28"]]},{"id":"817371e6.526cb","type":"debug","z":"f6f2187d.f17ca8","name":"","active":false,"tosidebar":true,"console":true,"tostatus":true,"complete":"true","targetType":"full","statusVal":"payload","statusType":"msg","x":630,"y":180,"wires":[]},{"id":"d0eac389.d1a5d","type":"ui_text","z":"f6f2187d.f17ca8","group":"c1aa66dc.761bd8","order":4,"width":0,"height":0,"name":"payload","label":"payload","format":"{{msg.payload}}","layout":"row-spread","x":340,"y":260,"wires":[]},{"id":"d87a123c.5b464","type":"ui_text","z":"f6f2187d.f17ca8","group":"c1aa66dc.761bd8","order":1,"width":0,"height":0,"name":"topic","label":"topic","format":"{{msg.topic}}","layout":"row-spread","x":330,"y":220,"wires":[]},{"id":"b06fca10.9f4d4","type":"ui_form","z":"f6f2187d.f17ca8","name":"","label":"Form","group":"3e773d14.88ae42","order":2,"width":0,"height":0,"options":[{"label":"Name","value":"name","type":"text","required":true,"rows":null}],"formValue":{"name":""},"payload":"","submit":"submit","cancel":"cancel","topic":"","x":90,"y":420,"wires":[["79370d38.b25b84"]]},{"id":"79370d38.b25b84","type":"ui_text","z":"f6f2187d.f17ca8","group":"3e773d14.88ae42","order":1,"width":0,"height":0,"name":"","label":"name","format":"{{msg.payload.name}}","layout":"row-spread","x":390,"y":460,"wires":[]},{"id":"d4c7e182.c535d8","type":"ui_text","z":"f6f2187d.f17ca8","group":"c1aa66dc.761bd8","order":2,"width":0,"height":0,"name":"","label":"_msgid","format":"{{msg._msgid}}","layout":"row-spread","x":480,"y":260,"wires":[]},{"id":"ce9b6532.c179a","type":"debug","z":"f6f2187d.f17ca8","name":"","active":false,"tosidebar":true,"console":true,"tostatus":false,"complete":"true","targetType":"full","statusVal":"","statusType":"auto","x":390,"y":420,"wires":[]},{"id":"2a0ee812.98bc28","type":"ui_text","z":"f6f2187d.f17ca8","group":"c1aa66dc.761bd8","order":3,"width":0,"height":0,"name":"","label":"QoS","format":"{{msg.qos}}","layout":"row-spread","x":470,"y":220,"wires":[]},{"id":"c2b6993c.feeca8","type":"ui_chart","z":"f6f2187d.f17ca8","name":"","group":"50620339.477b14","order":1,"width":6,"height":4,"label":"","chartType":"line","legend":"false","xformat":"HH:mm:ss","interpolate":"linear","nodata":"no data","dot":false,"ymin":"","ymax":"","removeOlder":1,"removeOlderPoints":"","removeOlderUnit":"60","cutout":0,"useOneColor":false,"useUTC":false,"colors":["#1f77b4","#aec7e8","#ff7f0e","#2ca02c","#98df8a","#d62728","#ff9896","#9467bd","#c5b0d5"],"useOldStyle":false,"outputs":1,"x":330,"y":360,"wires":[[]]},{"id":"cc3eb4c6.7f106","type":"debug","z":"f6f2187d.f17ca8","name":"","active":false,"tosidebar":true,"console":true,"tostatus":false,"complete":"true","targetType":"full","statusVal":"","statusType":"auto","x":630,"y":340,"wires":[]},{"id":"e703b7f3.e853f","type":"mqtt in","z":"f6f2187d.f17ca8","name":"","topic":"csc113/serialdata/num","qos":"2","datatype":"auto","broker":"b46c030.3ef3e","x":140,"y":360,"wires":[[]]},{"id":"8271f02f.f387c","type":"ui_text","z":"f6f2187d.f17ca8","group":"50620339.477b14","order":2,"width":6,"height":2,"name":"","label":"text","format":"{{msg.status}}","layout":"col-center","x":630,"y":300,"wires":[]},{"id":"76ce98d1.fe631","type":"status","z":"f6f2187d.f17ca8","name":"","scope":["618191df.e0b5b8","3cc11d24.ff01a2"],"x":100,"y":300,"wires":[["c24d6f8c.2e2f9"]]},{"id":"c24d6f8c.2e2f9","type":"json","z":"f6f2187d.f17ca8","name":"","property":"payload","action":"","pretty":false,"x":330,"y":300,"wires":[["8271f02f.f387c","cc3eb4c6.7f106"]]},{"id":"b46c030.3ef3e","type":"mqtt-broker","name":"test.mosquitto.org","broker":"test.mosquitto.org","port":"1883","clientid":"","usetls":false,"compatmode":false,"keepalive":"60","cleansession":true,"birthTopic":"","birthQos":"0","birthPayload":"","closeTopic":"","closeQos":"0","closePayload":"","willTopic":"","willQos":"0","willPayload":""},{"id":"c1aa66dc.761bd8","type":"ui_group","name":"msg","tab":"2dadb840.96aab","order":1,"disp":true,"width":"6","collapse":false},{"id":"3e773d14.88ae42","type":"ui_group","name":"form","tab":"5a2ae754.38df28","order":2,"disp":false,"width":"6","collapse":false},{"id":"50620339.477b14","type":"ui_group","name":"Chart","tab":"2dadb840.96aab","order":3,"disp":true,"width":12,"collapse":false},{"id":"2dadb840.96aab","type":"ui_tab","name":"Home","icon":"dashboard","disabled":false,"hidden":false},{"id":"5a2ae754.38df28","type":"ui_tab","name":"Test","icon":"dashboard","disabled":false,"hidden":false}]
\ No newline at end of file
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment