mraa | Linux Library for low speed IO Communication

 by   eclipse C Version: v2.2.0 License: MIT

kandi X-RAY | mraa Summary

kandi X-RAY | mraa Summary

mraa is a C library typically used in Internet of Things (IoT), Raspberry Pi applications. mraa has no bugs, it has no vulnerabilities, it has a Permissive License and it has medium support. You can download it from GitHub.

Linux Library for low speed IO Communication in C with bindings for C++, Python, Node.js & Java. Supports generic io platforms, as well as Intel Edison, Intel Joule, Raspberry Pi and many more.
Support
    Quality
      Security
        License
          Reuse

            kandi-support Support

              mraa has a medium active ecosystem.
              It has 1314 star(s) with 605 fork(s). There are 132 watchers for this library.
              OutlinedDot
              It had no major release in the last 6 months.
              There are 162 open issues and 438 have been closed. On average issues are closed in 65 days. There are 23 open pull requests and 0 closed requests.
              It has a neutral sentiment in the developer community.
              The latest version of mraa is v2.2.0

            kandi-Quality Quality

              mraa has no bugs reported.

            kandi-Security Security

              mraa has no vulnerabilities reported, and its dependent libraries have no vulnerabilities reported.

            kandi-License License

              mraa is licensed under the MIT License. This license is Permissive.
              Permissive licenses have the least restrictions, and you can use them in most projects.

            kandi-Reuse Reuse

              mraa releases are not available. You will need to build from source code and install.
              Installation instructions are not available. Examples and code snippets are available.

            Top functions reviewed by kandi - BETA

            kandi's functional review helps you automatically verify the functionalities of the libraries and avoid rework.
            Currently covering the most popular Java, JavaScript and Python libraries. See a Sample of mraa
            Get all kandi verified functions for this library.

            mraa Key Features

            No Key Features are available at this moment for mraa.

            mraa Examples and Code Snippets

            No Code Snippets are available at this moment for mraa.

            Community Discussions

            QUESTION

            accessing GPIO low power connector on DragonBoard 410C running Android
            Asked 2020-Sep-13 at 03:51

            I'm working with a recently purchased DragonBoard 410C running the Android 5.1 operating system and using Android Studio with Kotlin for generating a sample application that explores some of the hardware such as the 40 pin low power connector.

            My question is how to access the 40 pin low power connector with the GPIO pins using Kotlin and Android Studio.

            From my research thus far, it appears that the mraa library is the path to success however I have been unable to find any documentation on using the library with Kotlin.

            How do I get started with the mraa library with Kotlin to access the 40 pin low power connector?

            Or is there a different approach?

            My first example is a simple blink the LED application however I have no idea as to how to access pins of the low power connector using Kotlin.

            Notes and resources

            mraa documentation page

            Libmraa is a C/C++ library with bindings to Python, Javascript and Java to interface with the I/O on Galileo, Edison & other platforms, with a structured and sane API where port names/numbering matches the board that you are on. Use of libmraa does not tie you to specific hardware with board detection done at runtime you can create portable code that will work across the supported platforms.

            upm library for mraa GitHub repository

            The UPM repository provides software drivers for a wide variety of commonly used sensors and actuators. These software drivers interact with the underlying hardware platform (or microcontroller), as well as with the attached sensors, through calls to MRAA APIs.

            Which Android runs which Linux kernel? https://android.stackexchange.com/questions/51651/which-android-runs-which-linux-kernel

            ...

            ANSWER

            Answered 2020-Sep-13 at 03:51

            After reviewing a number of alternatives, it appears that the easiest approach for accessing the GPIO pins of the DragonBoard 410C running Android 5.1 was to use the legacy sysfs special device files method.

            I'm not sure if this is the only workable solution. Using Android Things as well as using libgpiod both seem to require a more recent Linux kernel than Android 5.1 uses.

            I have written an article on CodeProject.com providing details about working up this solution. See Using Windows 10 for Development with DragonBoard 410C and Android.

            Which Android runs which Linux kernel? https://android.stackexchange.com/questions/51651/which-android-runs-which-linux-kernel

            Source https://stackoverflow.com/questions/63653864

            QUESTION

            Issue with my C program : compilation error occurs
            Asked 2019-Sep-24 at 13:20

            I am using Yocto project cross-compiler to compile my C code.

            But for some reasons I have compilation errors.

            This is my C code :

            ...

            ANSWER

            Answered 2019-Sep-24 at 13:20

            You are compiling your code written in C with a C++ compiler.
            Just change your .c files to .cpp files, and compile using g++ rather than gcc if you are on Unix systems.

            Source https://stackoverflow.com/questions/58078145

            QUESTION

            Using the i2c smartdrive sensor with a Pio Cli commands to run motors
            Asked 2018-Feb-06 at 20:28

            This is my i2c sensor: http://www.mindsensors.com/rpi/76-smartdrive-high-current-motor-controller look in pdf in Documents sessions please

            Based on this google guide https://developer.android.com/things/sdk/pio/pio-cli.html What I need to put in XX ZZ YY UU to run motors in determined speed, direction, duration, etc...

            e.g.: pio i2c I2C1 0x1B write-reg-buffer 0xXX 0xYY 0xUU 0xZZ

            As (in this case) I will use writeRegBuffer() on my android things app to run one, two or both motors in determined spped, direction, duration, etc?

            e.g.: I used (via jcenter) this driver in intel edison/android things DP2, but now I want to create an AT driver to use smartdrive in nx pico and rpi 3, because there would be no more mraa:

            https://github.com/androidthings/contrib-drivers/issues/70

            My questions is: If you see here: https://github.com/intel-iot-devkit/upm/blob/master/src/smartdrive/smartdrive.hpp and especially in this: https://github.com/intel-iot-devkit/upm/blob/master/src/smartdrive/smartdrive.cxx in function

            ...

            ANSWER

            Answered 2018-Feb-06 at 20:28

            run motor 1 in direction A pio i2c I2C1 0x1B write-raw 0x46 128 0x05 0x00 0xD1

            run motor 1 in direction B pio i2c I2C1 0x1B write-raw 0x46 127 0x05 0x00 0xD1

            run motor 2 in direction A pio i2c I2C1 0x1B write-raw 0x4E 128 0x05 0x00 0xD1

            run motor 2 in direction B pio i2c I2C1 0x1B write-raw 0x4E 127 0x05 0x00 0xD1

            Source https://stackoverflow.com/questions/48368262

            QUESTION

            Ignoring node_modules for compiling server-side ES6 with Webpack locally
            Asked 2017-Nov-30 at 22:22

            I am working with a Raspberry Pi Zero that is my server, running my module.

            Raspberry's are not the best to compile code so I want to compile the server-side code locally. To do so I need to compile the code without resolving my imports. Why that ?

            Because the Server module uses other modules that can only be installed on the Raspberry (such as UPM or MRAA for sensors).

            For now I compile on the Pi but it's slow.

            So I'm trying to compile to ES6 locally with my config:

            ...

            ANSWER

            Answered 2017-Nov-30 at 22:22

            The modules could not be excluded with nodeExternals() because it lists the modules in /node_modules/. However, the modules that are to be excluded are not installed locally so nodeExternals() does not do the job.

            It needs to exclude them from by reading package.json.

            This will read the modules from the package.json file & exclude them instead of the node_modules directory:

            Source https://stackoverflow.com/questions/47470754

            QUESTION

            MAX77651 Can't read register with i2c
            Asked 2017-Oct-12 at 12:37

            I am trying to test the i2c communication of the MAX77651 chip before programming it.

            So here is my setup to do so:

            I have an UMFT4222ev connected to my Linux laptop by USB. This chip has his SCL and SDA linked to the SDA and SCL of my MAX77651 thanks to the Evaluation Kit for the MAX77651. My MAX77651evkit is powered with 3,7V on the Vbatt pin.

            I also installed the mraa librarie from git hub and the libft4222. I know mraa is well installed because i tried it with and example.

            I was told that the mraa library takes in charge the setup of the FT4222 so i only used mraa functions to make my program.

            I searched on the website of Maxim integrated the i2c slave address and one register where i could read data and check if everyting is working. I then read the i2c protocol of communication to read a single register which is available here : https://datasheets.maximintegrated.com/en/ds/MAX77650-MAX77651.pdf at the page 78.

            With all those informations I tried to make my "test program". I solved the compiling errors but when I execute the program I can't get what is in the register which should be 0xFF.

            Here is my program:

            ...

            ANSWER

            Answered 2017-Oct-08 at 00:44

            QUESTION

            Java app running on Intel Edison can't read from sensor (and Python can)
            Asked 2017-May-26 at 15:27

            I created a quick & dirty prototype in Python that reads temperature/humidity from an HTU21D sensor sensor that's connected to an Intel Edison. I'm trying to rewrite the Python prototype in Java. Unfortunately, the values being returned for temperature/humidity in Java are zero.

            The code is posted on Github: https://github.com/alexwoolford/htu21d_logger. Under the covers, both Python and Java versions are using upm/mraa.

            Here's the Java code to read from the sensor:

            ...

            ANSWER

            Answered 2017-May-26 at 15:24

            QUESTION

            Does a .so library need to be present at run time in all cases
            Asked 2017-May-25 at 05:19

            My question is in relation to .so shared libraries. I am building a project that uses cmake on one ubuntu machine but running the application on another ubuntu machine.

            In the CMakeLists.txt file, I have the following lines:

            ...

            ANSWER

            Answered 2017-May-24 at 15:58

            In general, gcc and clang support lazy linking/binding of symbols, but not for entire libraries. This means that all of the shared objects (ie: .so files) should be present at application startup, at a minimum. The one exception to this is if you modified your makefile to not link against these libraries, and you manually call library functions via dlopen()/dlsym(), etc.

            The binding of individual symbols within those libraries can be postponed until they are needed, or you can force all the symbols to be resolved at startup, using -z lazy or -z now, respectively.

            It is strange that your application runs without libmraa.so being present. The two most likely reasons your application is running in the absence of the library is:

            • Your application isn't using any symbols defined in the library, so the linker ignores the library at build time (try ldd app_name and see if your library is present in the list of libraries provided by ldd).
            • Something is amiss in your build script, and you are statically linking against a .a archive of the library.

            Edit: In response to how the application knows how to find the library, your linker (ld in this case) will use rpath lookup to decide which directories to use in its search for the appropriate library. You can see how this works by doing something like LD_DEBUG=libs app_name from the command line. You can also add an extra path via LD_LIBRARY_PATH=/some/path app_name.

            Source https://stackoverflow.com/questions/44162653

            QUESTION

            400: bad request when using hashlib on flask login
            Asked 2017-Apr-24 at 05:37

            I'm setting up some basic database hashing, but upon setup I'm receiving a 400 bad request.

            This is my first time using hashes and I could use some advice. I don't plan on salting the hashes. is there something I'm missing on the HTML side?

            ...

            ANSWER

            Answered 2017-Apr-24 at 05:37

            request.form['postPass']

            This is not populated on GET request only POST so that will be an issue.

            If you want both GET and POST in this view I suggest doing this:

            Source https://stackoverflow.com/questions/43578015

            QUESTION

            DHT11 sensor failure on Edison whereas working successful on RPi
            Asked 2017-Apr-19 at 15:49

            Some time ago I was connecting DHT11 sensor to Arduino UNO and wrote a simple library based on the one from Arduino website.

            At the moment I'd like to connect DHT11 to Intel Edison with Arduino Expansion Board running Yocto Linux. While trying to rewrite the library to Python I expected a problem with microseconds's sleeps in that language and finally decided to remake Raspberry Pi DHT11 Library using mraa. However, sensor isn't working as well. I found the topic on Intel forum blaming Edison ports fast IN/OUT switching inability. The proposed solution using two wires also didn't help me.

            After this introduction, a few questions come to my mind:

            1. Since both Raspberry and Edison are computer systems with real processors and Linux (unlike the Arduino which consists of simple microcontroller), why are people facing a problem with DHT11 on Edison, while those who are using Raspberry aren't?

            2. What is the source of those problems? Is it connected with non-deterministic OS timing on Edison (RPi has the same, hasn't it?), with digital pins flaw or both?

            3. Is it even possible to solve this using two wires (alternatively with a diode)? Maybe it's impossible without a suggested tri-state buffer?

            4. What is the simplest way to connect one-wire devices to Edison?

            ...

            ANSWER

            Answered 2017-Apr-19 at 15:49

            The 1-Wire protocol, as you know, requires deterministic timing. It is not possible to do deterministic timing on a computing platform like Edison, or even a PC. You might get somewhere close to it using usleep() but your app may get interrupted at any time, thereby messing up your timings.

            What you need to do when using a system without deterministic timing of GPIO is attach the sensor using an interface. That interface should use a small micro which DOES have deterministic timing. (ie a Pic, ATTINY, etc).

            • OR - Use an existing peripheral on your system which does have deterministic timing, such as a UART.

            I wrote a blog-post some years ago on how you can use a UART to do 1-Wire protocol. You should be able to find it here: http://wphost.spider-e.com/?p=231

            Source https://stackoverflow.com/questions/43453868

            QUESTION

            Difference between installing library from a PPA on Ubuntu v compiling the library
            Asked 2017-Jan-17 at 03:21

            Could somebody explain the difference to me between 'installing' a library from a PPA on Ubuntu and compiling a library from source?

            For example - Intel have a library called MRAA for accessing platform IO in linux.

            You can install the library from a PPA (which works for me) or you can compile it.

            Intel MRAA library

            How does installing remove the need for compiling?

            ...

            ANSWER

            Answered 2017-Jan-17 at 03:21

            I'm not entirely certain of this, but I believe installing from a PPA removes the need to compile because it is already compiled.

            Compilation is the process by which source code is transformed into instructions which can be interpreted by the computer's processor, I.E. binary.

            When you install from a PPA, I believe you're installing code which has already been compiled, thus there is no need to compile any source code.

            Source https://stackoverflow.com/questions/41673300

            Community Discussions, Code Snippets contain sources that include Stack Exchange Network

            Vulnerabilities

            No vulnerabilities reported

            Install mraa

            You can download it from GitHub.

            Support

            Eclipse Mraa (Libmraa) is a C/C++ library with bindings to Java, Python and JavaScript to interface with the I/O pins and buses on various IoT and Edge platforms, with a structured and sane API where port names/numbering match the board that you are on. Use of libmraa does not tie you to specific hardware. Since board detection done at runtime you can create portable code that will work across the supported platforms. The intent is to make it easier for developers and sensor manufacturers to map their sensors & actuators on top of supported hardware and to allow control of low level communication protocol by high level languages & constructs. The MRAA project is an Eclipse IoT project. A detailed project description can be found [here](https://projects.eclipse.org/proposals/eclipse-mraa). [![Build Status](https://travis-ci.org/intel-iot-devkit/mraa.svg?branch=master)](https://travis-ci.org/intel-iot-devkit/mraa) [![Quality Gate](https://sonarcloud.io/api/project_badges/measure?project=mraa-master&metric=alert_status)](https://sonarcloud.io/dashboard?id=mraa-master).
            Find more information at:

            Find, review, and download reusable Libraries, Code Snippets, Cloud APIs from over 650 million Knowledge Items

            Find more libraries
            CLONE
          • HTTPS

            https://github.com/eclipse/mraa.git

          • CLI

            gh repo clone eclipse/mraa

          • sshUrl

            git@github.com:eclipse/mraa.git

          • Stay Updated

            Subscribe to our newsletter for trending solutions and developer bootcamps

            Agree to Sign up and Terms & Conditions

            Share this Page

            share link