Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

server.engine.addressSpace is not a funciton error #11

Open
henjoe opened this issue Nov 20, 2022 · 1 comment
Open

server.engine.addressSpace is not a funciton error #11

henjoe opened this issue Nov 20, 2022 · 1 comment

Comments

@henjoe
Copy link

henjoe commented Nov 20, 2022

Hi, I know this is an old project, but it is very useful on my side.
However, I can't run the code due to the ff error:

image

Hoping you can help me.

Regards,
Henjoe

@StRobiEst
Copy link

You have to change 4 things in the file "mqtt2opcua/mqtt2opcua.js"
After the comment // Cater for paths starting with "/" add 2 lines

            const addressSpace = server.engine.addressSpace;
            const namespace = addressSpace.getOwnNamespace();

After 1 line replace the row
server.engine.addressSpace.addFolder("ObjectsFolder", { browseName: top});
with
namespace.addFolder("ObjectsFolder", { browseName: top});
9 rows down replace the row
server.engine.addressSpace.addFolder(node, { browseName: path[sub]});
with
namespace.addFolder(node, { browseName: path[sub]});
And for last 6 rows down replace the row
nodes[topic] = namespace.addVariable({
with
nodes[topic] = namespace.addVariable({

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants