Connecting to Node RED

Home Forums Conduit: AEP Model Connecting to Node RED

Viewing 14 posts - 1 through 14 (of 14 total)
  • Author
    Posts
  • #9822
    Vikram Kumar
    Participant

    I have an AEP Conduit and could connect to Node RED out of the box using default settings. However, since it was not picking up DNS settings and connecting to a 3rd party service I wanted to use, I changed some of the Network Interface settings.

    Now the DNS is working fine but I can no longer connect to Node RED. The link on the left hand side under Apps points to 192.168.0.105:1880 (192.168.0.105 is the IP address of my Conduit) and the connection times out.

    Not fully sure whether the connection times out because the Conduit is responding slowly or if it can’t resolve the URL. What can be done to connect to Node RED?

    #9823
    Vikram Kumar
    Participant

    Little more info after trying different settings. Selecting LAN as the Network Interface allows connection to Node RED on 192.168.0.105:1880 while selecting WAN causes the connection time out issue. However, I need to select WAN to use the 3rd party service so the question is how to connect to Node RED while still selecting WAN as the Network Interface?

    #9824
    Jason Reiss
    Keymaster

    We will be addressing this in an upcoming upgrade. You should be able to setup a static route to able red ui with wan enabled.
    You will want to route 1880 on the external to 1880 on 127.0.0.1.

    #9847
    Brandon Bayer
    Blocked

    Vikram,

    All you should have to do on 1.0.33 after changing eth0 to WAN is to go to Firewall > Settings and create an Inbound Filter Rule with the Destination Port set to 1880. This will allow incoming connections to port 1880 over WAN.

    -Brandon

    #10020
    Jim Maricondo
    Participant

    I have a similar problem connecting to Node RED. In my case, I am able to access the Node RED app just fine. However, upon accessing it, I immediately get an error “Error: Lost connection to server”. Why?

    I tried creating the demo case to dump the msg.payload of an incoming LoRa packet, but it does not work.

    How can I troubleshoot this? Would like to get it working ASAP. Thank you.

    You can see a screenshot at:
    https://drive.google.com/file/d/0B3VFuV8cdsgUeXhZY1hQbGpkQUk/preview

    nodered

    #10035
    Jeff Hatch
    Keymaster

    Jim,

    There are a couple of things to look for initially, one is to open the developer tools in the browser and look at the console output for errors. This may give you an idea of what is going on with the Node-RED connection when it is lost.

    Another thing to check is to see if Node-RED is restarting. One way to do this would be to log into the Conduit via SSH and run a “ps auxww | grep node” before you try to connect and after you receive the error to check if the node-red PID has changed indicating that it has restarted.

    Jeff Hatch

    #10043
    Jim Maricondo
    Participant

    Hi Jeff,

    Thank you for the prompt response. Where is the option for developer tools/console output? I can’t find it in the admin GUI.

    I logged in and checked the processes and actually the node-red process has been running continuously since the device was started. However, the Node RED GUI still always gives the lost connection error, and furthermore my Node RED flow to dump the payload does not get executed.

    I thought maybe some of this info might be helpful? What do you think I should do next?

    Thanks,
    -Jim

    admin@mtcdt:~# more /var/log/app/development.log
    
    Welcome to Node-RED
    ===================
    16 Nov 17:37:00 - [info] Node-RED version: v0.10.4
    16 Nov 17:37:00 - [info] Node.js  version: v0.8.28
    16 Nov 17:37:00 - [info] Loading palette nodes
    16 Nov 17:38:00 - [info] User Directory : /var/config/app/install/development
    16 Nov 17:38:00 - [info] Flows file     : /var/config/app/install/development/flows.json
    16 Nov 17:38:01 - [info] Server now running at http://127.0.0.1:1881/
    16 Nov 17:38:01 - [info] Starting flows
    16 Nov 17:38:02 - [info] [lora in:10a69305.ef596d] lora in node created
    16 Nov 17:38:02 - [info] Started flows
    16 Nov 17:38:02 - [info] [lora in:10a69305.ef596d] mcard: true
    16 Nov 17:38:02 - [info] [lora in:10a69305.ef596d] Connected to MQTT for LoRa in node.
    Attempting to log in as: admin
    Status code: 200
    Attempting to log out using token: DABD9D8E93D23D07D395813FDEDDF25
    admin@mtcdt:~# ls -l /var/log/app/development.log
    -rw-r--r--    1 admin    root           845 Nov 17 13:52 /var/log/app/development.log
    admin@mtcdt:~# date
    Wed Nov 18 11:48:18 PST 2015
    
    admin@mtcdt:~# tail /var/log/messages
    Nov 18 11:49:39 mtcdt daemon.notice stunnel: LOG5[7211]: Connection reset: 0 byte(s) sent to SSL, 0 byte(s) sent to socket
    Nov 18 11:49:41 mtcdt daemon.notice stunnel: LOG5[7212]: Service [node-red] accepted connection from 10.2.0.192:54638
    Nov 18 11:49:41 mtcdt daemon.err stunnel: LOG3[7212]: SSL_accept: Peer suddenly disconnected
    Nov 18 11:49:41 mtcdt daemon.notice stunnel: LOG5[7212]: Connection reset: 0 byte(s) sent to SSL, 0 byte(s) sent to socket
    Nov 18 11:49:43 mtcdt daemon.notice stunnel: LOG5[7213]: Service [node-red] accepted connection from 10.2.0.192:54639
    Nov 18 11:49:43 mtcdt daemon.err stunnel: LOG3[7213]: SSL_accept: Peer suddenly disconnected
    Nov 18 11:49:43 mtcdt daemon.notice stunnel: LOG5[7213]: Connection reset: 0 byte(s) sent to SSL, 0 byte(s) sent to socket
    Nov 18 11:49:45 mtcdt daemon.notice stunnel: LOG5[7214]: Service [node-red] accepted connection from 10.2.0.192:54640
    Nov 18 11:49:45 mtcdt daemon.err stunnel: LOG3[7214]: SSL_accept: Peer suddenly disconnected
    Nov 18 11:49:45 mtcdt daemon.notice stunnel: LOG5[7214]: Connection reset: 0 byte(s) sent to SSL, 0 byte(s) sent to socket
    
    #10045
    Jim Maricondo
    Participant

    Here is a a messages dump which shows logging into Node-RED by connecting to the admin GUI on port 1880.

    admin@mtcdt:~# tail -f /var/log/messages
    Nov 18 11:51:09 mtcdt user.info API: [SESSION] Authorized Agent [admin] Permission [admin] IP [127.0.0.1] Port [] Token []
    Nov 18 11:51:09 mtcdt user.info API: [ROUTER][GET][heartbeat]
    Nov 18 11:51:09 mtcdt user.info API: [SESSION] Ending FCGI Request [5228] as [RESPONDER]
    Nov 18 11:51:09 mtcdt daemon.info lighttpd[662]: 127.0.0.1 127.0.0.1 - [18/Nov/2015:11:51:09 -0800] "GET /api/heartbeat HTTP/1.1" 404 85 "-" "curl/7.35.0"
    Nov 18 11:51:15 mtcdt daemon.notice stunnel: LOG5[7256]: Service [node-red] accepted connection from 10.2.0.192:54711
    Nov 18 11:51:15 mtcdt daemon.err stunnel: LOG3[7256]: SSL_accept: Peer suddenly disconnected
    Nov 18 11:51:15 mtcdt daemon.notice stunnel: LOG5[7256]: Connection reset: 0 byte(s) sent to SSL, 0 byte(s) sent to socket
    Nov 18 11:51:17 mtcdt daemon.notice stunnel: LOG5[7257]: Service [node-red] accepted connection from 10.2.0.192:54712
    Nov 18 11:51:17 mtcdt daemon.err stunnel: LOG3[7257]: SSL_accept: Peer suddenly disconnected
    Nov 18 11:51:17 mtcdt daemon.notice stunnel: LOG5[7257]: Connection reset: 0 byte(s) sent to SSL, 0 byte(s) sent to socket
    
    Nov 18 11:51:26 mtcdt daemon.notice stunnel: LOG5[7258]: Service [node-red] accepted connection from 10.2.0.192:54713
    Nov 18 11:51:26 mtcdt daemon.err stunnel: LOG3[7258]: SSL_accept: Peer suddenly disconnected
    Nov 18 11:51:26 mtcdt daemon.notice stunnel: LOG5[7258]: Connection reset: 0 byte(s) sent to SSL, 0 byte(s) sent to socket
    Nov 18 11:51:28 mtcdt daemon.notice stunnel: LOG5[7259]: Service [node-red] accepted connection from 10.2.0.192:54714
    Nov 18 11:51:28 mtcdt daemon.err stunnel: LOG3[7259]: SSL_accept: Peer suddenly disconnected
    Nov 18 11:51:28 mtcdt daemon.notice stunnel: LOG5[7259]: Connection reset: 0 byte(s) sent to SSL, 0 byte(s) sent to socket
    Nov 18 11:51:29 mtcdt daemon.notice stunnel: LOG5[7260]: Service [node-red] accepted connection from 10.2.0.192:54715
    Nov 18 11:51:29 mtcdt daemon.notice stunnel: LOG5[7261]: Service [node-red] accepted connection from 10.2.0.192:54716
    Nov 18 11:51:29 mtcdt daemon.err stunnel: LOG3[7260]: SSL_accept: Peer suddenly disconnected
    Nov 18 11:51:29 mtcdt daemon.notice stunnel: LOG5[7260]: Connection reset: 0 byte(s) sent to SSL, 0 byte(s) sent to socket
    Nov 18 11:51:29 mtcdt daemon.info stunnel: LOG6[7261]: SSL accepted: new session negotiated
    Nov 18 11:51:29 mtcdt daemon.info stunnel: LOG6[7261]: No peer certificate received
    Nov 18 11:51:29 mtcdt daemon.info stunnel: LOG6[7261]: Negotiated TLSv1.2 ciphersuite ECDHE-RSA-AES256-GCM-SHA384 (256-bit encryption)
    Nov 18 11:51:29 mtcdt daemon.info stunnel: LOG6[7261]: s_connect: connecting 127.0.0.1:1881
    Nov 18 11:51:29 mtcdt daemon.notice stunnel: LOG5[7261]: s_connect: connected 127.0.0.1:1881
    Nov 18 11:51:29 mtcdt daemon.notice stunnel: LOG5[7261]: Service [node-red] connected remote server from 127.0.0.1:35952
    Nov 18 11:51:29 mtcdt daemon.notice stunnel: LOG5[7262]: Service [node-red] accepted connection from 10.2.0.192:54717
    Nov 18 11:51:29 mtcdt daemon.info stunnel: LOG6[7262]: SSL accepted: previous session reused
    Nov 18 11:51:29 mtcdt daemon.info stunnel: LOG6[7262]: s_connect: connecting 127.0.0.1:1881
    Nov 18 11:51:29 mtcdt daemon.notice stunnel: LOG5[7262]: s_connect: connected 127.0.0.1:1881
    Nov 18 11:51:29 mtcdt daemon.notice stunnel: LOG5[7263]: Service [node-red] accepted connection from 10.2.0.192:54718
    Nov 18 11:51:29 mtcdt daemon.notice stunnel: LOG5[7264]: Service [node-red] accepted connection from 10.2.0.192:54720
    Nov 18 11:51:29 mtcdt daemon.notice stunnel: LOG5[7265]: Service [node-red] accepted connection from 10.2.0.192:54721
    Nov 18 11:51:29 mtcdt daemon.notice stunnel: LOG5[7266]: Service [node-red] accepted connection from 10.2.0.192:54719
    Nov 18 11:51:29 mtcdt daemon.notice stunnel: LOG5[7262]: Service [node-red] connected remote server from 127.0.0.1:35953
    Nov 18 11:51:29 mtcdt daemon.info stunnel: LOG6[7266]: SSL accepted: previous session reused
    Nov 18 11:51:29 mtcdt daemon.info stunnel: LOG6[7266]: s_connect: connecting 127.0.0.1:1881
    Nov 18 11:51:29 mtcdt daemon.info stunnel: LOG6[7263]: SSL accepted: previous session reused
    Nov 18 11:51:29 mtcdt daemon.info stunnel: LOG6[7263]: s_connect: connecting 127.0.0.1:1881
    Nov 18 11:51:29 mtcdt daemon.notice stunnel: LOG5[7263]: s_connect: connected 127.0.0.1:1881
    Nov 18 11:51:29 mtcdt daemon.notice stunnel: LOG5[7263]: Service [node-red] connected remote server from 127.0.0.1:35955
    Nov 18 11:51:29 mtcdt daemon.info stunnel: LOG6[7264]: SSL accepted: previous session reused
    Nov 18 11:51:29 mtcdt daemon.info stunnel: LOG6[7264]: s_connect: connecting 127.0.0.1:1881
    Nov 18 11:51:29 mtcdt daemon.notice stunnel: LOG5[7264]: s_connect: connected 127.0.0.1:1881
    Nov 18 11:51:29 mtcdt daemon.notice stunnel: LOG5[7264]: Service [node-red] connected remote server from 127.0.0.1:35956
    Nov 18 11:51:29 mtcdt daemon.notice stunnel: LOG5[7266]: s_connect: connected 127.0.0.1:1881
    Nov 18 11:51:29 mtcdt daemon.notice stunnel: LOG5[7266]: Service [node-red] connected remote server from 127.0.0.1:35954
    Nov 18 11:51:29 mtcdt daemon.info stunnel: LOG6[7265]: SSL accepted: previous session reused
    Nov 18 11:51:29 mtcdt daemon.info stunnel: LOG6[7265]: s_connect: connecting 127.0.0.1:1881
    Nov 18 11:51:29 mtcdt daemon.notice stunnel: LOG5[7265]: s_connect: connected 127.0.0.1:1881
    Nov 18 11:51:29 mtcdt daemon.notice stunnel: LOG5[7265]: Service [node-red] connected remote server from 127.0.0.1:35957
    Nov 18 11:51:31 mtcdt daemon.notice stunnel: LOG5[7267]: Service [node-red] accepted connection from 10.2.0.192:54722
    Nov 18 11:51:31 mtcdt daemon.err stunnel: LOG3[7267]: SSL_accept: Peer suddenly disconnected
    Nov 18 11:51:31 mtcdt daemon.notice stunnel: LOG5[7267]: Connection reset: 0 byte(s) sent to SSL, 0 byte(s) sent to socket
    Nov 18 11:51:32 mtcdt daemon.notice stunnel: LOG5[7268]: Service [node-red] accepted connection from 10.2.0.192:54723
    Nov 18 11:51:32 mtcdt daemon.err stunnel: LOG3[7268]: SSL_accept: Peer suddenly disconnected
    Nov 18 11:51:32 mtcdt daemon.notice stunnel: LOG5[7268]: Connection reset: 0 byte(s) sent to SSL, 0 byte(s) sent to socket
    Nov 18 11:51:33 mtcdt daemon.notice stunnel: LOG5[7269]: Service [node-red] accepted connection from 10.2.0.192:54724
    Nov 18 11:51:33 mtcdt daemon.err stunnel: LOG3[7269]: SSL_accept: Peer suddenly disconnected
    Nov 18 11:51:33 mtcdt daemon.notice stunnel: LOG5[7269]: Connection reset: 0 byte(s) sent to SSL, 0 byte(s) sent to socket
    Nov 18 11:51:34 mtcdt daemon.notice stunnel: LOG5[7270]: Service [node-red] accepted connection from 10.2.0.192:54726
    Nov 18 11:51:34 mtcdt daemon.err stunnel: LOG3[7270]: SSL_accept: Peer suddenly disconnected
    Nov 18 11:51:34 mtcdt daemon.notice stunnel: LOG5[7270]: Connection reset: 0 byte(s) sent to SSL, 0 byte(s) sent to socket
    Nov 18 11:51:35 mtcdt daemon.notice stunnel: LOG5[7271]: Service [node-red] accepted connection from 10.2.0.192:54727
    Nov 18 11:51:35 mtcdt daemon.err stunnel: LOG3[7271]: SSL_accept: Peer suddenly disconnected
    Nov 18 11:51:35 mtcdt daemon.notice stunnel: LOG5[7271]: Connection reset: 0 byte(s) sent to SSL, 0 byte(s) sent to socket
    Nov 18 11:51:36 mtcdt daemon.notice stunnel: LOG5[7272]: Service [node-red] accepted connection from 10.2.0.192:54728
    Nov 18 11:51:37 mtcdt daemon.err stunnel: LOG3[7272]: SSL_accept: Peer suddenly disconnected
    Nov 18 11:51:37 mtcdt daemon.notice stunnel: LOG5[7272]: Connection reset: 0 byte(s) sent to SSL, 0 byte(s) sent to socket
    Nov 18 11:51:38 mtcdt daemon.notice stunnel: LOG5[7273]: Service [node-red] accepted connection from 10.2.0.192:54729
    ^C
    admin@mtcdt:~# 
    
    • This reply was modified 8 years, 5 months ago by Jim Maricondo.
    #10048
    Jeff Hatch
    Keymaster

    Jim,

    When I restart node-red I get similar errors, but not the same pertaining to the stunnel proxy not being able to connect on the localhost port:

    Nov 18 21:36:16 mtcdt daemon.info stunnel: LOG6[65]: SSL accepted: previous session reused
    Nov 18 21:36:16 mtcdt daemon.info stunnel: LOG6[65]: s_connect: connecting 127.0.0.1:1881
    Nov 18 21:36:16 mtcdt daemon.err stunnel: LOG3[65]: s_connect: connect 127.0.0.1:1881: Connection refused (111)
    Nov 18 21:36:16 mtcdt daemon.info stunnel: LOG6[65]: s_connect: connecting 127.0.0.1:1882
    Nov 18 21:36:16 mtcdt daemon.info stunnel: LOG6[66]: SSL accepted: previous session reused
    Nov 18 21:36:16 mtcdt daemon.info stunnel: LOG6[66]: s_connect: connecting 127.0.0.1:1881
    Nov 18 21:36:16 mtcdt daemon.err stunnel: LOG3[66]: s_connect: connect 127.0.0.1:1881: Connection refused (111)
    

    It almost seems like the connecting host is dropping the connection according to the log. Have you tried logging in from a different host or different browser?

    Jeff

    #10076
    Jim Maricondo
    Participant

    Jeff,

    You are right. Retried it with Firefox (41.0.2) and it is finally working. Maybe you can add to your support base the fact that it does not work with Safari (9.0.1).

    I realize most hardware guys don’t use Macs. But 90% of Silicon Valley (at least software guys) do, and I guess we are spoiled to think that all web apps work across all browsers.

    Thanks,
    -Jim

    #10078
    Brandon Bayer
    Blocked

    Jim,

    Ah, that is interesting. I did a quick search and it looks like this is a known issue with Express 3 which is used by the Conduit’s version of Node-RED but is fixed in Express 4. The Node-RED upgrade won’t be in the next Conduit version to be released within a month or two (Node-RED v0.11.1), but we’ll try to get NR 0.12.0 or later in the next release after that.

    -Brandon

    #10080
    Sean O Connell
    Participant

    Hi Brandon,

    Will the next update to Conduit AEP with Node Red be a hardware or software upgrade ?

    Rgds, Sean.

    #10086
    Brandon Bayer
    Blocked

    Sean,

    It will be software only!

    -Brandon

    #17950
    Rumana Yasmin
    Participant

    Hi,
    I have also faced same problem with node red. Does anybody have any idea to solve this issue ‘Error: Lost connection to server’ whilw launch the node red?

    -Rumana Yasmin

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