mraa | Linux Library for low speed IO Communication
kandi X-RAY | mraa Summary
kandi X-RAY | mraa Summary
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
Top functions reviewed by kandi - BETA
Currently covering the most popular Java, JavaScript and Python libraries. See a Sample of mraa
mraa Key Features
mraa Examples and Code Snippets
Community Discussions
Trending Discussions on mraa
QUESTION
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
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:51After 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
QUESTION
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:20You 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.
QUESTION
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:28run 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
QUESTION
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:22The 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:
QUESTION
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:44I think you are confused by pg. 75 of the MAX77651 datasheet.
QUESTION
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:24The HTU21D Java example code was missing the following call:
QUESTION
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:58In 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 byldd
). - 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
.
QUESTION
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:37request.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:
QUESTION
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:
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?
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?
Is it even possible to solve this using two wires (alternatively with a diode)? Maybe it's impossible without a suggested tri-state buffer?
What is the simplest way to connect one-wire devices to Edison?
ANSWER
Answered 2017-Apr-19 at 15:49The 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
QUESTION
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.
How does installing remove the need for compiling?
...ANSWER
Answered 2017-Jan-17 at 03:21I'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.
Community Discussions, Code Snippets contain sources that include Stack Exchange Network
Vulnerabilities
No vulnerabilities reported
Install mraa
Support
Reuse Trending Solutions
Find, review, and download reusable Libraries, Code Snippets, Cloud APIs from over 650 million Knowledge Items
Find more librariesStay Updated
Subscribe to our newsletter for trending solutions and developer bootcamps
Share this Page