how to make node-red app accessible to customer
Home › Forums › Conduit: AEP Model › how to make node-red app accessible to customer
- This topic has 16 replies, 3 voices, and was last updated 8 years, 2 months ago by
Peter Ferland.
-
AuthorPosts
-
February 21, 2017 at 1:05 am #17374
Akshay Bhavsar
ParticipantHi there,
I have got the node-red app running on https://192.168.2.1:1880/test. How can I make this webpage accessible to customer without even launching node-red app and signIn in. Can I make MultiConnect Conduit as WAN connection on Ethernet cable?
I am bit new into this, so can anyone please help me ?
Thanks
AkshayFebruary 21, 2017 at 10:22 am #17380Jeff Hatch
KeymasterAkshay,
You can configure the Ethernet interface (eth0) as a WAN with a gateway and dns settings in the Web UI in Setup->Network Interfaces. In order make your page accessible you will have to create a firewall rule in Firewall->Settings to allow a connection to the Ethernet interface address on the desired port. That should allow a customer to log into your Node-RED page.
Jeff
February 21, 2017 at 2:34 pm #17395Akshay Bhavsar
ParticipantThanks for your help Jeff. Is it possible to access webpage directly without even login to Node-RED page ?
February 22, 2017 at 7:01 am #17402Akshay Bhavsar
ParticipantWhat I want to exactly do is like if I give my conduit to other person, then he should be able to access web-page app directly ( by just going to https://192.168.2.1:1880/test), without even login to conduit and node-red. How can I do this ?
Another question is if any problem occurs then, I should be able to fix it remotely by accessing node-red and GUI of Multitech conduit. So, how could I access multitech conduit remotely without using Simcard.
Any help would be great !
Thanks
February 23, 2017 at 4:06 pm #17447Akshay Bhavsar
ParticipantCan anyone please explain this how to solve this scenario with more concrete example ?
Thanks
February 23, 2017 at 4:09 pm #17449Peter Ferland
BlockedAre you using HTTP request and response nodes? You should not require a login when using these nodes to handle a request.
February 23, 2017 at 4:27 pm #17451Akshay Bhavsar
ParticipantI do use http request and response node. Have a look attached flow for confirmation.
https://drive.google.com/open?id=0B8vP1Z3v0Sw8cFNwZGpZNDAzSnc
When I try to run https://192.168.2.1:1880/test without login to node-red, I see error page.
https://drive.google.com/file/d/0B8vP1Z3v0Sw8T3cwcGtKNy1NQ2c/view
-
This reply was modified 8 years, 2 months ago by
Akshay Bhavsar.
February 23, 2017 at 4:45 pm #17453Peter Ferland
BlockedCan you export your actual node red flow? Highlight all the nodes then go to “Export” in the hamburger menu in the top right to copy it.
Can you try importing this example? I’ve confirmed that it runs on my Conduit, displaying a simple page on https://192.168.2.1:1880/simple . I can access the webpage from both a webbrowser and curl on the command line. http://flows.nodered.org/flow/8666510f94ad422e4765
February 23, 2017 at 4:54 pm #17456Akshay Bhavsar
ParticipantHere is the flow.
[{"id":"8ed4b335.cac8a","type":"file","name":"","filename":"/home/root/data.txt","appendNewline":true,"createDir":false,"overwriteFile":"false","x":687.9999885559082,"y":192,"z":"c8f27500.54b3f8","wires":[]},{"id":"1a0f0418.0a73fc","type":"template","name":"","field":"","format":"handlebars","template":"<pre>{{payload}}</pre>","x":741,"y":434,"z":"c8f27500.54b3f8","wires":[["7a2e6c25.ac6cb4"]]},{"id":"7a2e6c25.ac6cb4","type":"http response","name":"","x":920.9999885559082,"y":430.9999542236328,"z":"c8f27500.54b3f8","wires":[]},{"id":"5446f213.d50c2c","type":"http in","name":"","url":"/test","method":"get","swaggerDoc":"","x":270,"y":433.99993896484375,"z":"c8f27500.54b3f8","wires":[["403ed356.16ea8c"]]},{"id":"c327ffe5.3525d","type":"debug","name":"","active":false,"console":"false","complete":"payload","x":706,"y":349.99993896484375,"z":"c8f27500.54b3f8","wires":[]},{"id":"403ed356.16ea8c","type":"file in","name":"","filename":"/home/root/data.txt","format":"utf8","x":498,"y":433.99993896484375,"z":"c8f27500.54b3f8","wires":[["c327ffe5.3525d","1a0f0418.0a73fc"]]},{"id":"a29775ea.2a1308","type":"lora in","name":"","datatype":"bytes","x":299.799991607666,"y":190.1999969482422,"z":"c8f27500.54b3f8","wires":[["aa0885d9.f41798"]]},{"id":"aa0885d9.f41798","type":"function","name":"","func":"var identify_button = ((msg.payload).slice((msg.payload.length)-10,(msg.payload.length)-9));\nvar rBuf_identify_button = new Buffer(identify_button,'hex');\nvar identify_button_val = (rBuf_identify_button.readUInt8(0));\nvar time = msg.timestamp;\nvar ID_tag = msg.eui;\n\nvar button_status;\nvar identify_button_val_remainder = (identify_button_val)%64;\nif(identify_button_val_remainder == 14)\n{\n button_status = \"pressed\";\n}\nelse\n{\n button_status = \"Not-pressed\"; \n}\n\nvar battery = ((msg.payload).slice((msg.payload.length)-9,(msg.payload.length)-8));\nvar rBuf_battery = new Buffer(battery,'hex');\nvar battery_val = (rBuf_battery.readInt8(0));\n\nvar latitude = ((msg.payload).slice((msg.payload.length)-8,(msg.payload.length)-4));\nvar rBuf_latitude = new Buffer(latitude,'hex');\nvar latitude_val = (rBuf_latitude.readInt32BE(0))*0.000001;\n\nvar longitude = ((msg.payload).slice((msg.payload.length)-4,msg.payload.length));\nvar rBuf_longitude = new Buffer(longitude,'hex');\nvar longitude_val = (rBuf_longitude.readInt32BE(0))*0.000001;\n\nmsg.payload = {payload: \"time: \" +time+ \", \" + \"ID tag: \" +ID_tag+ \", \" + \"Button: \"+ button_status+ \", \" +\"Battery status: \" + battery_val + \"%, \" + \"GPS Data: \" + latitude_val + \",\" + longitude_val };\n\nreturn msg.payload;\n\n","outputs":1,"noerr":0,"x":480.8000068664551,"y":192.20001220703125,"z":"c8f27500.54b3f8","wires":[["8ed4b335.cac8a","d8e03144.1d9eb"]]},{"id":"d8e03144.1d9eb","type":"debug","name":"","active":false,"console":"false","complete":"payload","x":654.7999725341797,"y":111.19999694824219,"z":"c8f27500.54b3f8","wires":[]}]
I have tried the flow you mentioned, I can access that one even without login in to node-red. I am not sure what is the problem with my flow.
Thanks
February 23, 2017 at 4:59 pm #17457Peter Ferland
BlockedIs /home/root/data.txt readable by anyone?
February 23, 2017 at 5:03 pm #17460Peter Ferland
BlockedAlso, I’d recommend using mqtt or websockets or at least a temporary file on the ramdisk at /var/volatile instead of a file on the flash.
February 23, 2017 at 5:08 pm #17466Akshay Bhavsar
Participant/home/root/data.txt , how can I make this file to readable by everyone ?
February 23, 2017 at 5:11 pm #17467Peter Ferland
BlockedFrom a terminal chmod a+r /home/root/data.txt
February 23, 2017 at 5:19 pm #17468Akshay Bhavsar
Participantok thanks..What I have notice strange thing is that, after importing a flow you mentioned and running that, my flow also started to working even without login into node-red.
February 23, 2017 at 5:28 pm #17469Akshay Bhavsar
ParticipantThanks for your help Peter.. Appreciated it.. Just one more question, how can I remotely access conduit, make changes and would be able to deploy the code ?
-
This reply was modified 8 years, 2 months ago by
Akshay Bhavsar.
February 23, 2017 at 9:46 pm #17473Akshay Bhavsar
ParticipantHey Peter,
I could access my web application without even login to conduit and node-red, but when I restart the conduit, I have to wait about 7-10 minutes to access web-application, until then it shows this error as mentioned before.
Why it is taking such a long time ?
https://drive.google.com/file/d/0B8vP1Z3v0Sw8T3cwcGtKNy1NQ2c/view
Thanks
February 24, 2017 at 9:13 am #17486Peter Ferland
BlockedNode-red can take a long time to finish loading on the conduit. 7-10 minutes is a bit long though, more typical is 3-5 minutes. You’d have to look at the logs on the conduit itself to see if anything is stalling or timing out.
For remote management, have you used devicehq before? It relies on the Conduit checking in several times a day so it can be used even if the Conduit does not have a public ip address https://www.devicehq.com/sign_in
If you have a publicly available ip address you can also open up ports on the WAN interface, but you’d need to make sure to set a password before doing that. -
This reply was modified 8 years, 2 months ago by
-
AuthorPosts
- You must be logged in to reply to this topic.