-
Notifications
You must be signed in to change notification settings - Fork 39
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
Comments
@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. |
I am already working on cloned repo and report problems above with that version. |
@donwojtallo Pull my recent changes and try again; I believe I fixed the issue. Thanks for pointing this out! |
Sorry for delay. I've tested it and now it works! |
@donwojtallo Can we close this? |
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. |
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. |
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.The text was updated successfully, but these errors were encountered: