how to make node-red app accessible to customer

Home Forums Conduit: AEP Model how to make node-red app accessible to customer

Viewing 17 posts - 1 through 17 (of 17 total)
  • Author
    Posts
  • #17374
    Akshay Bhavsar
    Participant

    Hi 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
    Akshay

    #17380
    Jeff Hatch
    Keymaster

    Akshay,

    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

    #17395
    Akshay Bhavsar
    Participant

    Thanks for your help Jeff. Is it possible to access webpage directly without even login to Node-RED page ?

    #17402
    Akshay Bhavsar
    Participant

    What 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

    #17447
    Akshay Bhavsar
    Participant

    Can anyone please explain this how to solve this scenario with more concrete example ?

    Thanks

    #17449
    Peter Ferland
    Blocked

    Are you using HTTP request and response nodes? You should not require a login when using these nodes to handle a request.

    #17451
    Akshay Bhavsar
    Participant

    I 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

    #17453
    Peter Ferland
    Blocked

    Can 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

    #17456
    Akshay Bhavsar
    Participant

    Here 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

    #17457
    Peter Ferland
    Blocked

    Is /home/root/data.txt readable by anyone?

    #17460
    Peter Ferland
    Blocked

    Also, 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.

    #17466
    Akshay Bhavsar
    Participant

    /home/root/data.txt , how can I make this file to readable by everyone ?

    #17467
    Peter Ferland
    Blocked

    From a terminal chmod a+r /home/root/data.txt

    #17468
    Akshay Bhavsar
    Participant

    ok 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.

    #17469
    Akshay Bhavsar
    Participant

    Thanks 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 ?

    #17473
    Akshay Bhavsar
    Participant

    Hey 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

    #17486
    Peter Ferland
    Blocked

    Node-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.

Viewing 17 posts - 1 through 17 (of 17 total)
  • You must be logged in to reply to this topic.