mathiask88 / node-snap7

node.js wrapper for snap7
MIT License
163 stars 59 forks source link

Building node-snap7 on Mac OS X #6

Closed lsibilla closed 9 years ago

dscmax commented 9 years ago

I'm new to GitHub soI apologize if my comment is not written in the correct place. I would like to know how to install node-snap7 on a Mac (OS X Yosemite). In the instructions I found Windows and Linux only, I tried the procedure for Linux but I failed. Is it possible to update the wiki? Thanks.

mathiask88 commented 9 years ago

I added support for OS X in https://github.com/mathiask88/node-snap7/commit/70054a0e7e1de10c0c5dc34edd4b3f1fcdd33ce2 with some differences to this PR. It would be nice if anyone could test this, because I don't own a mac.

@dscmax Needs the same requirements as linux because its a flavor of unix: python, make and a c/c++ compiler. An easy way is to install apple's XCode and the Command Line tools under Preferences->Downloads.

lsibilla commented 9 years ago

@mathiask88 I tested the your changes and it works fine. I can connect to my 0BA7 and run the application that was running with my branch of node-snap7.

Nevertheless, I faced a regression on the Connect() function. If I give a callback parameter, right after connection, my node app will exit with an "Abort trap 6" message. I worked around by removing the error handling and it works fine.

It's not very safe but it's not a critical application either.

I had this issue on some other functions at the very beginning I used node-snap7 and did the same work-around. I think it was on the ReadArea/WriteArea function, which take a callback argument also.

@dscmax It's quite a long time I did setup my application but I don't remember having much issue except the one for which I made the pull request. I recommend you to follow instruction provided by @mathiask88 and take care of your package.json. You should not use the latest release but the latest commit.

Here is the dependency I have set up : "dependencies": { ... "node-snap7": "mathiask88/node-snap7", ... }

You might have some warnings but it will build correctly.

mathiask88 commented 9 years ago

@lsibilla Good to hear OS X builds fine. Can you give more details for the Abort trap 6 error e.g. node/iojs version and full error message in a new issue?

@lsibilla @dscmax Oh yes I forgot to publish a new version on npm, sorry about that. I will do this after I know where that abort trap error comes from.

dscmax commented 9 years ago

@lsibilla @mathiask88 Thank you for your good work. I will give a try to node-snap7 on my Mac ASAP (i.e. before the end of coming week ?). When I tried to install node-snap7 last time (before the fixes of Isibilia) I matched the requirements for Linux installation (gcc / make / Python available on my Mac) but I have not been able to have a successful installation.

lsibilla commented 9 years ago

I have created a separate issue for this as this was not an issue before : https://github.com/mathiask88/node-snap7/issues/7

I also noticed that some area are not always read correctly. I will try to provide a small project emphasizing the issue later. In the meantime I came back to my branch.

@dscmax I guess, you had the same issue I had before and for which I provided the patch. Try with the newest version or with lsibilla/node-snap7. If it's not ok, I can help.