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

JavaScript binding - no sensor name and dp value. #41

Closed
donwojtallo opened this issue Jan 31, 2015 · 7 comments
Closed

JavaScript binding - no sensor name and dp value. #41

donwojtallo opened this issue Jan 31, 2015 · 7 comments
Assignees

Comments

@donwojtallo
Copy link

Creating new sensor using new ev3dev.Sensor(); returns:
Error: ENOENT, no such file or directory '/sys/class/lego-sensor/sensor1/name'
It looks like there is no name value anymore.
Here is workaround to make sensor work. In module/bin/index.js ev3dev/nstead of line:
var typeName = fs.readFileSync(path.join(rootPath, "name")).toString().trim();
I put this:
var typeName = '';

The second error is no dp value:
Error: ENOENT, no such file or directory '/sys/class/lego-sensor/sensor1/dp'
The example script returns this inside getFloatValue() function. I tried this on gyro sensor.

Also, small thing, the package on npm repository is outdated, using the sensor shows error which were already fixed on Github.

@WasabiFan
Copy link
Member

@donwojtallo sorry about that; yes, the npm package is outdated. I publish to npm when we do a release on GitHub, which happens when we are finished with our changes across all languages.

So, until the module is updated on npm, I recommend that you clone my "ev3dev-lang-js" repo and follow the instructions in the readme to build from source. Then you can just copy the new "index.js" file that you built to wherever your project is and use that instead for now.

@donwojtallo
Copy link
Author

I am already working on cloned repo and report problems above with that version.

@WasabiFan
Copy link
Member

@donwojtallo Pull my recent changes and try again; I believe I fixed the issue.

Thanks for pointing this out!

@donwojtallo
Copy link
Author

Sorry for delay. I've tested it and now it works!
I've also fixed example file (see).
Please, update npm package too. I think it's important to keep this package up-to-date.
Thank you!

@WasabiFan
Copy link
Member

@donwojtallo Can we close this?

@donwojtallo
Copy link
Author

I thought You will update npm package before closing this. If You believe that it's not related to this issue, I am closing this right now. Sorry for misunderstanding.

@WasabiFan
Copy link
Member

Because we use a single version number on most of our bindings, I can't update the npm package without becoming out-of-sync with the other libraries. I may be able to publish a "beta" version without updating the version number; I'll see what I can do and post back here if I get it published.

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

No branches or pull requests

2 participants