- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
Hi,
I am trying to read some sensors data in node.js by using mraa. I am able to read values from PIN1 by using the bellow code
var analogPin1 = new mraa.Aio(1); //setup access analog inpuput pin 0
var analogValue = analogPin1.read(); //read the value of the analog pin successfully
but new mraa.Aio(0), new mraa.Aio(2), new mraa.Aio(3) are giving me this error "Error: Invalid AIO pin specified - do you have an ADC?"
var analogPin3 = new mraa.Aio(0); //Error
var analogValue = analogPin3.read();
I also tried to get the value through galileo-io but it is giving me same error
board.analogRead("A0", function(data) {
console.log('data', data);
});
I checked the value through cat /sys/bus/iio/devices/iio:device0/in_voltage0_raw and I am successfully getting the result back, so it is most likely mraa issue
I have the latest linux IoTKit image on the SD card and mraa library is updated 0.9.5
I ffound there are other people facing the same issue as me
https://github.com/intel-iot-devkit/mraa/issues/117 Initializing Aio instance fails on Galileo Gen 2 (aio: unable to setup multiplexers for pin) · Issue # 117 · intel-iot-de…
Does anyone Know what could be the reason for it?
Link Copied
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
Hi taha82,
I'll try to reproduce the issue, meanwhile, could you confirm if this issue happens only in Node.js or it also happens in another programming language, let's say Python for example?
Regards,
Diego
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
I just checked in python and got the same error. " Invalid AIO pin specified - do you have an ADC?" I am able to read pin 1 but not others.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
Hi taha82,
I tested the analog examples for Node.js and Python and I didn't get any errors. I used the following examples:
https://github.com/intel-iot-devkit/mraa/blob/master/examples/javascript/AioA0.js mraa/AioA0.js at master · intel-iot-devkit/mraa · GitHub
https://github.com/intel-iot-devkit/mraa/blob/master/examples/python/aio.py mraa/aio.py at master · intel-iot-devkit/mraa · GitHub
I tested the pins 0, 1, 2, and 3 and none of them threw an error. I'm using the MRAA version 0.9.5. Run the following command to know what image version you are using: uname -a
Regards,
Diego
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
Hi Giego,
I got this from the command you mentioned "Linux galileo 3.8.7-yocto-standard # 1 Tue Sep 29 22:16:33 GMT 2015 i586 GNU/Linux" and I tried the both examples from that link and got the same error again.
Best Regards,
Taha
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
Hi taha82,
We're using the same image version and also the same MRAA version; however, I'm not able to reproduce the issue. It might be related with the configuration; could you run the following command and provide the outcome of it: cat /sys/kernel/debug/gpio?
I also recommend you to re-install MRAA just to make sure that everything is fine with the library.
Regards,
Diego
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
I will try to reinstall the mraa. Meanwhile, here is the output form the command you provided.
Thanks and Regards,
Taha
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
Probably this problem is related with:
https://github.com/intel-iot-devkit/mraa/issues/390 https://github.com/intel-iot-devkit/mraa/issues/390
BR,
xbolshe
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
Hi taha82,
I'd like to know if the issue is still happening after reinstalling the MRAA library.
Regards,
Diego
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
Hi Diego,
I haven't got the time yet to check it. Once I will check, I will update here.
Thanks and Regards,
Taha
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
Hello, was the issue fixed? I'm having a similar issue
Thanks

- Subscribe to RSS Feed
- Mark Topic as New
- Mark Topic as Read
- Float this Topic for Current User
- Bookmark
- Subscribe
- Printer Friendly Page