Giter VIP home page Giter VIP logo

Comments (11)

jisotalo avatar jisotalo commented on July 2, 2024

Are you sure that you only have one connection at time? Only one connection is supported if no TwinCAT router installed (so make sure the other ads library is not running at the same time and connecting to this target).

Can you set debugging level to 3 and post the console output?

from node-red-contrib-ads-client.

dev4iotatgps avatar dev4iotatgps commented on July 2, 2024

The other ads lib is not running and I have also removed the node configuration from the ads lib. After that, I have restarted the TwinCAT-System and the Router.

Here is the console output:

2023-06-15 11:05:30 [info] Starting flows 2023-06-15 11:05:30 [debug] red/nodes/flows.start : starting flow : global 2023-06-15 11:05:30 [debug] red/nodes/flows.start : starting flow : adbad0c8def14ca1 2023-06-15 11:05:30 [debug] red/nodes/flows.start : starting flow : 094d73ef8fd841d7 2023-06-15 11:05:30 [info] [ads-client-connection:79fed921af51fcd5] Connecting to 192.168.2.3.1.1:851... 2023-06-15 11:05:30 [info] Started flows 2023-06-15 11:05:32 [info] [ads-client-connection:79fed921af51fcd5] Connecting to 192.168.2.3.1.1:851 failed, keeping trying.. 2023-06-15 11:05:32 [warn] [ads-client-connection:79fed921af51fcd5] Failed to connect 192.168.2.3.1.1:851 at startup: ClientException: Connection to 192.168.2.3:48898 failed (timeout) - No response from router in 2000 ms 2023-06-15 11:06:18 [debug] saved flow revision: b097da4b6e7074bc3a53b4bb02238bf2 2023-06-15 11:06:18 [info] Stopping flows 2023-06-15 11:06:18 [debug] red/nodes/flows.stop : stopping flow : adbad0c8def14ca1 2023-06-15 11:06:18 [debug] red/nodes/flows.stop : stopping flow : 094d73ef8fd841d7 2023-06-15 11:06:18 [debug] red/nodes/flows.stop : stopping flow : global 2023-06-15 11:06:18 [info] [ads-client-connection:79fed921af51fcd5] Disconnecting from 192.168.2.3.1.1:851 and unsubscribing from all... 2023-06-15 11:06:18 [info] [ads-client-connection:79fed921af51fcd5] Disconnected from 192.168.2.3.1.1:851 2023-06-15 11:06:18 [info] Stopped flows 2023-06-15 11:06:18 [info] Updated flows 2023-06-15 11:06:18 [info] Starting flows 2023-06-15 11:06:18 [debug] red/nodes/flows.start : starting flow : global 2023-06-15 11:06:18 [debug] red/nodes/flows.start : starting flow : adbad0c8def14ca1 2023-06-15 11:06:18 [debug] red/nodes/flows.start : starting flow : 094d73ef8fd841d7 2023-06-15 11:06:18 [info] [ads-client-connection:79fed921af51fcd5] Connecting to 192.168.2.3.1.1:851... 2023-06-15 11:06:18 [info] Started flows 2023-06-15 11:06:20 [info] [ads-client-connection:79fed921af51fcd5] Connecting to 192.168.2.3.1.1:851 failed, keeping trying.. 2023-06-15 11:06:20 [warn] [ads-client-connection:79fed921af51fcd5] Failed to connect 192.168.2.3.1.1:851 at startup: ClientException: Connection to 192.168.2.3:48898 failed (timeout) - No response from router in 2000 ms 2023-06-15 11:06:20 [info] [debug:debug 5] { payload: false, connection: { connected: false, isLocal: false, localAmsNetId: null, localAdsPort: null, targetAmsNetId: '192.168.2.3.1.1', targetAdsPort: '851' }, _msgid: '7fdfebbe8159c317' }

from node-red-contrib-ads-client.

jisotalo avatar jisotalo commented on July 2, 2024

from node-red-contrib-ads-client.

dev4iotatgps avatar dev4iotatgps commented on July 2, 2024
16 Jun 11:25:18 - [info] Started flows

  ads-client _connect(): Socket connection established to 192.168.2.3:48898 +2ms

  ads-client:details _registerAdsPort(): Registering an ADS port from ADS router 192.168.2.3:48898 +513ms

  ads-client:details IO out ------> 8 bytes +0ms

  ads-client _connect(): Socket connection ended by remote, connection failed. +2ms

16 Jun 11:25:18 - [info] [ads-client-connection:dd14ce822fbd2590] Connecting to 192.168.2.3.1.1:851 failed, keeping trying..

16 Jun 11:25:18 - [warn] [ads-client-connection:dd14ce822fbd2590] Failed to connect 192.168.2.3.1.1:851 at startup: ClientException: Connection to 192.168.2.3:48898 failed - socket ended by remote

  ads-client _registerAdsPort(): Failed to register ADS port - Timeout - no response in 2000 ms +2s

  ads-client _disconnect(): Starting to close connection (force: false) +3ms

  ads-client _unsubscribeAllInternals(): Unsubscribing from all notifications +1ms

  ads-client _unsubscribeAllInternals(): Unsubscribed from 0 notifications +0ms

  ads-client:details _unregisterAdsPort(): Unregister ads port null from 192.168.2.3:48898 +2s

  ads-client:details IO out ------> 8 bytes +0ms

  ads-client _registerAdsPort(): Failed to unregister ADS port - Timeout - no response in 2000 ms +2s

  ads-client _disconnect(): Connection closed successfully +1ms

  ads-client setDebugging(): Debug level set to 3 +0ms

  ads-client _connect(): Starting to connect 192.168.2.3:48898 +0ms

  ads-client _connect(): Socket connection established to 192.168.2.3:48898 +1ms

  ads-client:details _registerAdsPort(): Registering an ADS port from ADS router 192.168.2.3:48898 +2s

  ads-client:details IO out ------> 8 bytes +0ms

  ads-client _connect(): Socket connect failed: Error: read ECONNRESET

  ads-client     at TCP.onStreamRead (node:internal/stream_base_commons:217:20) {

  ads-client   errno: -104,

  ads-client   code: 'ECONNRESET',

  ads-client   syscall: 'read'

  ads-client } +1s

  ads-client:details _registerAdsPort(): Socket connection errored. +1s

  ads-client _disconnect(): Starting to close connection (force: false) +2s

  ads-client _unsubscribeAllInternals(): Unsubscribing from all notifications +1ms

  ads-client _unsubscribeAllInternals(): Unsubscribed from 0 notifications +0ms

  ads-client:details _unregisterAdsPort(): Unregister ads port null from 192.168.2.3:48898 +2s

  ads-client:details IO out ------> 8 bytes +0ms

  ads-client _registerAdsPort(): Failed to unregister ADS port - Timeout - no response in 2000 ms +2s

  ads-client _disconnect(): Connection closed successfully +1ms

  ads-client setDebugging(): Debug level set to 3 +0ms

  ads-client _connect(): Starting to connect 192.168.2.3:48898 +0ms

  ads-client _connect(): Socket connection established to 192.168.2.3:48898 +4ms

  ads-client:details _registerAdsPort(): Registering an ADS port from ADS router 192.168.2.3:48898 +2s

  ads-client:details IO out ------> 8 bytes +0ms

from node-red-contrib-ads-client.

jisotalo avatar jisotalo commented on July 2, 2024

Thanks. Please try to set manual ADS port. Se set the localAdsPort to something like 31859 or so.

from node-red-contrib-ads-client.

dev4iotatgps avatar dev4iotatgps commented on July 2, 2024

With the localAdsPort it is not working:

21 Jun 11:52:38 - [warn] Encrypted credentials not found 21 Jun 11:52:38 - [info] Server now running at http://127.0.0.1:1880/ 21 Jun 11:52:38 - [info] Starting flows 21 Jun 11:52:38 - [info] Started flows 21 Jun 11:54:36 - [info] Stopping flows 21 Jun 11:54:36 - [info] Stopped flows 21 Jun 11:54:36 - [info] Updated flows 21 Jun 11:54:36 - [info] Starting flows 21 Jun 11:54:36 - [info] [ads-client-connection:22ead47109caa45b] Connecting to 192.168.2.3.1.1:851... ads-client _connect(): Starting to connect 192.168.2.3:48898 +0ms 21 Jun 11:54:36 - [info] Started flows ads-client _connect(): Socket connection established to 192.168.2.3:48898 +10ms ads-client:details _registerAdsPort(): Registering an ADS port from ADS router 192.168.2.3:48898 +0ms ads-client:details IO out ------> 8 bytes +0ms ads-client _connect(): Socket connection ended by remote, connection failed. +3ms 21 Jun 11:54:36 - [info] [ads-client-connection:22ead47109caa45b] Connecting to 192.168.2.3.1.1:851 failed, keeping trying.. 21 Jun 11:54:36 - [warn] [ads-client-connection:22ead47109caa45b] Failed to connect 192.168.2.3.1.1:851 at startup: ClientException: Connection to 192.168.2.3:48898 failed - socket ended by remote ads-client _registerAdsPort(): Failed to register ADS port - Timeout - no response in 2000 ms +2s ads-client _disconnect(): Starting to close connection (force: false) +4ms ads-client _unsubscribeAllInternals(): Unsubscribing from all notifications +1ms ads-client _unsubscribeAllInternals(): Unsubscribed from 0 notifications +1ms ads-client:details _unregisterAdsPort(): Unregister ads port null from 192.168.2.3:48898 +2s ads-client:details IO out ------> 8 bytes +1ms ads-client _registerAdsPort(): Failed to unregister ADS port - Timeout - no response in 2000 ms +2s ads-client _disconnect(): Connection closed successfully +1ms ads-client setDebugging(): Debug level set to 3 +1ms ads-client _connect(): Starting to connect 192.168.2.3:48898 +0ms ads-client _connect(): Socket connection established to 192.168.2.3:48898 +2ms ads-client:details _registerAdsPort(): Registering an ADS port from ADS router 192.168.2.3:48898 +2s ads-client:details IO out ------> 8 bytes +1ms ads-client _connect(): Socket connection ended by remote, connection failed. +3ms ads-client _registerAdsPort(): Failed to register ADS port - Timeout - no response in 2000 ms +2s ads-client _disconnect(): Starting to close connection (force: false) +4ms ads-client _unsubscribeAllInternals(): Unsubscribing from all notifications +0ms ads-client _unsubscribeAllInternals(): Unsubscribed from 0 notifications +0ms ads-client:details _unregisterAdsPort(): Unregister ads port null from 192.168.2.3:48898 +2s ads-client:details IO out ------> 8 bytes +0ms

from node-red-contrib-ads-client.

dev4iotatgps avatar dev4iotatgps commented on July 2, 2024

Here is the tcpdump of the connection:

`root@Ubuntu22:~# tcpdump

tcpdump: verbose output suppressed, use -v[v]... for full protocol decode
listening on enp0s3, link-type EN10MB (Ethernet), snapshot length 262144 bytes
11:58:05.293321 IP Ubuntu22.31859 > 192.168.2.3.48898: Flags [S], seq 3118779934, win 64240, options [mss 1460,sackOK,TS val 3759176209 ecr 0,nop,wscale 7], length 0
11:58:05.294146 IP 192.168.2.3.48898 > Ubuntu22.31859: Flags [S.], seq 2203309405, ack 3118779935, win 65535, options [mss 1460,nop,wscale 8,nop,nop,sackOK], length 0
11:58:05.294176 IP Ubuntu22.31859 > 192.168.2.3.48898: Flags [.], ack 1, win 502, length 0
11:58:05.294512 IP Ubuntu22.31859 > 192.168.2.3.48898: Flags [P.], seq 1:9, ack 1, win 502, length 8
11:58:05.295641 IP 192.168.2.3.48898 > Ubuntu22.31859: Flags [F.], seq 1, ack 9, win 8212, length 0
11:58:05.296523 IP Ubuntu22.31859 > 192.168.2.3.48898: Flags [.], ack 2, win 502, length 0
11:58:05.297055 IP Ubuntu22.31859 > 192.168.2.3.48898: Flags [F.], seq 9, ack 2, win 502, length 0
11:58:05.297524 IP 192.168.2.3.48898 > Ubuntu22.31859: Flags [.], ack 10, win 8212, length 0
11:58:09.302814 IP Ubuntu22.31859 > 192.168.2.3.48898: Flags [S], seq 3181427978, win 64240, options [mss 1460,sackOK,TS val 3759180219 ecr 0,nop,wscale 7], length 0
11:58:09.304043 IP 192.168.2.3.48898 > Ubuntu22.31859: Flags [S.], seq 2203437407, ack 3181427979, win 65535, options [mss 1460,nop,wscale 8,nop,nop,sackOK], length 0
11:58:09.304131 IP Ubuntu22.31859 > 192.168.2.3.48898: Flags [.], ack 1, win 502, length 0
11:58:09.305986 IP Ubuntu22.31859 > 192.168.2.3.48898: Flags [P.], seq 1:9, ack 1, win 502, length 8
11:58:09.307391 IP 192.168.2.3.48898 > Ubuntu22.31859: Flags [F.], seq 1, ack 9, win 1026, length 0
11:58:09.308679 IP Ubuntu22.31859 > 192.168.2.3.48898: Flags [F.], seq 9, ack 2, win 502, length 0
11:58:09.309347 IP 192.168.2.3.48898 > Ubuntu22.31859: Flags [.], ack 10, win 1026, length 0
11:58:13.315650 IP Ubuntu22.31859 > 192.168.2.3.48898: Flags [S], seq 3244128443, win 64240, options [mss 1460,sackOK,TS val 3759184231 ecr 0,nop,wscale 7], length 0
11:58:13.317088 IP 192.168.2.3.48898 > Ubuntu22.31859: Flags [S.], seq 2203565409, ack 3244128444, win 65535, options [mss 1460,nop,wscale 8,nop,nop,sackOK], length 0
11:58:13.317154 IP Ubuntu22.31859 > 192.168.2.3.48898: Flags [.], ack 1, win 502, length 0
11:58:13.318684 IP Ubuntu22.31859 > 192.168.2.3.48898: Flags [P.], seq 1:9, ack 1, win 502, length 8
11:58:13.320162 IP 192.168.2.3.48898 > Ubuntu22.31859: Flags [F.], seq 1, ack 9, win 1026, length 0
11:58:13.320718 IP Ubuntu22.31859 > 192.168.2.3.48898: Flags [.], ack 2, win 502, length 0
11:58:13.321858 IP Ubuntu22.31859 > 192.168.2.3.48898: Flags [F.], seq 9, ack 2, win 502, length 0
11:58:13.323024 IP 192.168.2.3.48898 > Ubuntu22.31859: Flags [.], ack 10, win 1026, length 0
11:58:17.328687 IP Ubuntu22.31859 > 192.168.2.3.48898: Flags [S], seq 3306832234, win 64240, options [mss 1460,sackOK,TS val 3759188244 ecr 0,nop,wscale 7], length 0
11:58:17.329480 IP 192.168.2.3.48898 > Ubuntu22.31859: Flags [S.], seq 2203693411, ack 3306832235, win 65535, options [mss 1460,nop,wscale 8,nop,nop,sackOK], length 0
11:58:17.329545 IP Ubuntu22.31859 > 192.168.2.3.48898: Flags [.], ack 1, win 502, length 0
11:58:17.331275 IP Ubuntu22.31859 > 192.168.2.3.48898: Flags [P.], seq 1:9, ack 1, win 502, length 8
11:58:17.332440 IP 192.168.2.3.48898 > Ubuntu22.31859: Flags [F.], seq 1, ack 9, win 1026, length 0
11:58:17.334179 IP Ubuntu22.31859 > 192.168.2.3.48898: Flags [F.], seq 9, ack 2, win 502, length 0
11:58:17.335374 IP 192.168.2.3.48898 > Ubuntu22.31859: Flags [.], ack 10, win 1026, length 0

`

from node-red-contrib-ads-client.

jisotalo avatar jisotalo commented on July 2, 2024

Hi!

Are you absolute sure that the localAmsNetId and localAdsPort settings are saved?

Because from debug logs it seems that it's still trying to register a port from target.

There is _registerAdsPort(): Registering an ADS port from ADS router 192.168.2.3:48898 in the log but it's not followed by _registerAdsPort(): Local AmsNetId and ADS port manually given so using xxx (see https://github.com/jisotalo/ads-client/blob/d5a0fe33359974d3aee1d5634093d6a86d2de693/src/ads-client.js#L3692)

If they are saved and should be OK, then there might be a bug in this Node-RED library and the settings are not used.

from node-red-contrib-ads-client.

dev4iotatgps avatar dev4iotatgps commented on July 2, 2024

ok, now it is working! I have put the port wich you have mentioned above into the wrong field.. (localTcpPort)
Sorry! Thank you for your help!

What I do not understand is, when I leave the localAdsPort empty, there is also no localAmsNetId in the connection object, but I have set up a localAmsNetId

image

from node-red-contrib-ads-client.

dev4iotatgps avatar dev4iotatgps commented on July 2, 2024

This is the working config:

image

from node-red-contrib-ads-client.

jisotalo avatar jisotalo commented on July 2, 2024

Glad to hear it's working! The reason you need to give these manually is that you don't have a AMS router running on your device.

The connection object should contain localAmsNetId and localAdsPort but in your picture it's not connected. They are set after successful connection if I remember right.

from node-red-contrib-ads-client.

Related Issues (12)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.