Community
cancel
Showing results for 
Search instead for 
Did you mean: 
thass1
New Contributor I
1,207 Views

Mraa Libraray Aio Issue

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?

10 Replies
Diego_V_Intel
Employee
184 Views

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

thass1
New Contributor I
184 Views

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.

Diego_V_Intel
Employee
184 Views

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

thass1
New Contributor I
184 Views

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

Diego_V_Intel
Employee
184 Views

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

thass1
New Contributor I
184 Views

I will try to reinstall the mraa. Meanwhile, here is the output form the command you provided.

Thanks and Regards,

Taha

asss
Valued Contributor II
184 Views

Diego_V_Intel
Employee
184 Views

Hi taha82,

I'd like to know if the issue is still happening after reinstalling the MRAA library.

Regards,

Diego

thass1
New Contributor I
184 Views

Hi Diego,

I haven't got the time yet to check it. Once I will check, I will update here.

Thanks and Regards,

Taha

ARobe11
Beginner
184 Views

Hello, was the issue fixed? I'm having a similar issue

Thanks

Reply