Community migration in progress. Please bear with us as we work through the migration.

Control GPIOs on Up Squared Board

mpetitjempetitje Posts: 5New Member

Hello,

I am struggling to control the GPIOs of the Up Squared. I tried the MRAA libraries without success (I always get 'Invalid GPIO pin specified' as output). Is MRAA the way to go or is there some other way ? Is any additionnal configuration needed in order to use MRAA ?

I am running ublinux 3.0, and the output of uname -a is

Linux upsquared 4.4.0-ubi4-amd64 #1 SMP Debian 4.4.35-1 (2016-11-29) x86_64 GNU/Linux

Thanks a lot

Tagged:

Comments

  • mpetitjempetitje Posts: 5New Member

    A bit of update: I am able to toggle a GPIO using bash commands:

    cd /sys/class/gpio
    echo 433 > export
    echo out > gpio433
    while 1
    do  echo 1 > value; sleep 1
    echo 0 > value; sleep 1
    done
    

    However, I can't a access the same GPIO using MRAA. My hypothesis is that the pinmap is not loaded properly. Indeed, when I run this simple C hello code, I am not able to recognize the board.

    #include "mraa.h"
    int main(int argc, char** argv)
    {
        const char* board_name = mraa_get_platform_name();
        fprintf(stdout, "hello mraa\n Version: %s\n Running on %s\n", mraa_get_version(), board_name);
    
        mraa_deinit();
        return MRAA_SUCCESS;
    }
    
  • Javier ArteagaJavier Arteaga Posts: 152Emutex mod

    Hi @mpetitje,

    Sorry that I didn't see this thread before. As mentioned on the MRAA issue, that kernel simply does not include UP2 support. Please upgrade to ubilinux 4 or the Ubuntu 4.10 upboard kernel line to use MRAA on UP2.

Sign In or Register to comment.