Control GPIOs on Up Squared Board

mpetitje
mpetitje New Member Posts: 5

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

Comments

  • mpetitje
    mpetitje New Member Posts: 5

    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 Arteaga
    Javier Arteaga Emutex Posts: 163 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.

  • ccalde
    ccalde New Member Posts: 348 ✭✭✭

    Hi @mpetitje ,

    Is that discussion closed? Did you update your kernel using the custom UP kernel?

    Cheers!

  • KahrenA
    KahrenA New Member Posts: 15

    Since I have the same problem, how do I update to Ubuntu 4.10 upboard kernel line? Thx.

  • KahrenA
    KahrenA New Member Posts: 15
  • nikilee
    nikilee New Member Posts: 1
    edited September 2021

    I am unable to run the MRAA library and got an error that attributes "Led" and "Gpio" do not exist. Anyone able to get around these?

  • camillus
    camillus AAEON Posts: 188 mod

    Hi @nikilee ,

    • Did you follow this guide to install libmraa ?
    • Can you tell on which device you are running this? Also which ubuntu version and kernel?

    Best Regards,

Privacy Policy