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

hx711.node: undefined symbol: wiringPiSetup #5

Open
carlberg74 opened this issue Jan 9, 2018 · 5 comments
Open

hx711.node: undefined symbol: wiringPiSetup #5

carlberg74 opened this issue Jan 9, 2018 · 5 comments

Comments

@carlberg74
Copy link

Hi,

Found your nodejs lib for hx711, but I keep getting error: missing symbol. (I am new at nodejs)
node: symbol lookup error: /home/ubuntu/test-nodejs/node_modules/hx711/build/Release/hx711.node: undefined symbol: wiringPiSetup

Get this when running code below:

var hx711 = require('hx711');
const SCLK = 5;
const DATA = 6;
var sensor = hx711(SCLK, DATA); << error.

Found the wiringPi/wiringPi/wiringPi.h in the src of wiringPi from git, and it seem to contain wiringPiSetup etc, but I don't know where to put it..or how to fix this.

Please advice.

Cheers

@dangrie158
Copy link
Owner

Hi,

wiringPi is a dependency of the driver. For installation instructions visit: http://wiringpi.com/download-and-install/

@carlberg74
Copy link
Author

Yes, I have installed wiringPi, gpio -v works and I can even use the WiringPi-Node lib with node without getting any runtime error.
I installed this node hx711 lib using: npm install hx711 --save, is there something missing in the package?

@dangrie158
Copy link
Owner

Hi,
how did you install wiringPi? Check if you have a libWiringPi in your LD_LIBRARY_PATH or modify the binding.gyp file to reference the .so object using an absolute path and recompile the library.

Hope this helps.

@carlberg74
Copy link
Author

I solved it using the binding.gyp adding "libraries": [ "/usr/local/lib/libwiringPi.so" ] comment out -ldflags
and then ran node-gyp build..

Maybe it also worked if I just set the LD_LIBRARY_PATH and then ran node.gyb build... i don't know.

thanks.

@dangrie158
Copy link
Owner

Thanks for letting me know.

Would be great if you could make a pull request as it seems that this is the more compatible way of doing things.
Otherwise it would be great if you could just post your updated gyp file so I can edit it in.

Thanks
Daniel

@dangrie158 dangrie158 reopened this Jan 30, 2018
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