FORUM CTRLX AUTOMATION
ctrlX World Partner Apps for ctrlX AUTOMATION
03-26-2024 03:10 PM - edited 03-26-2024 03:13 PM
Hello everyone,
I developed an app that has to subscribe to a specific PLC node in the Datalayer. The app utilizes Service2Service Authentication in order to generate an access token.
The scope.json looks as following:
{
"id": "datalayer-visualizer-app", "rexroth-device.all.rwx"]
}
I retrieve the token successfully. Here is how it looks like as it is parsed from jwt.io website:
Note: I noticed that the id parameter is empty and the plchandle is set to 0.
When I attempt to subscribe to PLC node in the Datalayer I get the following DL_INVALID_ADDRESS error:
However, if I subscribe to a Datalayer node that is not defined by the PLC app, the subscribtion with this S2S token is working flawlessly.
Solution:
If I authenticate via username/password and retrieve the token from the Authorization API. This issue is resolved. I successfully subscribed to the PLC-defined node in the Datalayer.
What I suspect might be the issue is that the token retrieved from the Authorization API is complete (it includes the id and the plchandle parameter is not 0)
Additional Info:
Build environment: Ubuntu 22.04
Snap base: core22
CtrlX CORE X3 (with core 22 app installed)
CtrlX Works version: 1.20.5
I would really appreciate your feedback. 😊
Solved! Go to Solution.
03-28-2024 10:50 AM
Hi @CtrlXplorer
I followed these two guides to reproduce your error:
How to subscribe to nodes of the ctrlX Data Layer via web interface
But I was not able to reproduce your error. It worked fine for me. Please check if you have an error in the Data Layer path to the node you want to subscribe to. I would recommend to use this button to copie out the path:
Best regards,
Nick
03-28-2024 11:51 AM
Hi @nickH
Thank you for your reply. I also followed the guides that you specified and I made sure that the node paths was correct in the subscription ( I used tools like online Diff-checker and Notepad++ to see if there were any differences). As I already mentioned the problem only occurs when I use the S2S authentication token itself, and not because of the node path being incorrect. Also, I do not ecounter any errors if I retrieve the token from the Authorization API itself (using username and password).
My program logic simply waits for this S2S token file to be generated in the expected directory. Afterwards a SSE subscription request is being made to the exact PLC Datalayer node (see screenshot below) utilizing the S2S token as way of authenticating.
However the problem with the DL_INVALID_ADDRESS for the PLC Datalayer node persists.
Best regards,
CtrlXplorer
03-28-2024 01:12 PM
I also will leave a screenshot of the system apps versions below . Hope it helps to localize the issue:
03-28-2024 02:13 PM - edited 03-28-2024 02:15 PM
Hi @CtrlXplorer
I tried it now once again with the V1.20 but it still works for me (also with the S2S Token).
Here are my Apps:
To get the S2S-Token I used this sample on GitHub. Then I did the subscription from cmd with curl (with the S2S-Token) and it works fine:
03-28-2024 04:30 PM
Hi again @nickH
I noticed that you are using lower versions of some System apps than what I am testing on. Could you please try to upgrade:
- Automation Core to version 1.20.2
- Device Admin to version 1.20.7
- Hardware Support to version 1.20.5
- PLC to version 1.20.6
- Realtime Kernel (see my screenshot above)
- Setup to 1.20.1
- snapd to 2.59.2
- Solutions to 1.20.1
You may get the complete archive of all mentioned upgrades from the Collaboration rooms and then search for the System Apps X3 01.20.12 archive. Also just wanted to politely remind you to make a backup of your system configuration before upgrading 😅
I also installed the S2S Authentication sample that you provided and still got the same results. Here are some screenshots.
🟥(S2S Token) Subscription to PLC Datalayer node: plc/app/Application/sym/GVL/SignalleucteGruen1
✅(S2S Token) Subscription to Datalayer node: framework/metrics/system/cpu-utilisation-percent
✅(Authorization API Token) Subscription to PLC Datalayer node: plc/app/Application/sym/GVL/SignalleucteGruen1
04-03-2024 10:39 AM
Important Updates: As this is a PLC project, developed by a customer, the source project configurations were inspected and the issue was found to be located in the Symbol Configuration. Most likely the customer developed the PLC project on a lower version of the CtrlX PLC Engineering software. That was the reason for the DL_INVALID_ADDRESS error when subscribing to a PLC Datalayer node via ServiceToService token.
Solution: The issue was resolved by deleting the old Symbol Configuration and setting up a new one with the following addittional settings checked:
Special thanks to @nickH for helping to identify the issue! I am marking this topic as closed. 🙂