Difference between revisions of "Mraa"
(Created page with "{{Languages|rockpiN10}} __NOTOC__ == Mraa on ROCK Pi boards == This document describes how to build and use mraa for ROCK Pi boards. === List of ROCK Pi Boards supported =...") |
(Add example of installing mraa on ROCK Pi N10.) |
||
Line 1: | Line 1: | ||
{{Languages|rockpiN10}} | {{Languages|rockpiN10}} | ||
− | + | === Mraa on ROCK Pi boards === | |
− | + | ||
− | == Mraa on ROCK Pi boards == | + | |
− | + | ||
This document describes how to build and use mraa for ROCK Pi boards. | This document describes how to build and use mraa for ROCK Pi boards. | ||
− | === List of ROCK Pi Boards supported === | + | ==== List of ROCK Pi Boards supported ==== |
− | + | ||
* ROCK Pi 4 A/B/C | * ROCK Pi 4 A/B/C | ||
* ROCK Pi E | * ROCK Pi E | ||
Line 14: | Line 10: | ||
* ROCK Pi S | * ROCK Pi S | ||
* ROCK Pi X | * ROCK Pi X | ||
+ | |||
+ | ==== List of Linux Distributions ==== | ||
+ | * Ubuntu | ||
+ | * Debian | ||
+ | |||
+ | ==== Install example: Install Mraa on ROCK Pi N10 Debian system ==== | ||
+ | For Debian Distribution the below commands install the essential set: | ||
+ | <pre> | ||
+ | root@rockpin10bc:/home/rock# apt-get install -y git build-essential swig3.0 python-dev cmake libjson-c-dev libnode-dev | ||
+ | root@rockpin10bc:/home/rock# apt-get install -y libc6 libjson-c3 libgcc1 libstdc++6 python2.7 libpython2.7 python3.7 libpython3.7 | ||
+ | root@rockpin10bc:/home/rock# apt-get install -y libc6 libjson-c3 libgcc1 libstdc++6 python libpython2.7 python3.6 libpython3.6 | ||
+ | root@rockpin10bc:/home/rock# apt-get install -y libgtest-dev pkg-config cmake-data | ||
+ | </pre> | ||
+ | |||
+ | Get source code. | ||
+ | <pre> | ||
+ | root@rockpin10bc:/home/rock# git clone -b master https://github.com/radxa/mraa.git | ||
+ | root@rockpin10bc:/home/rock# cd mraa | ||
+ | </pre> | ||
+ | |||
+ | Patch the source code for building mraa with Python. | ||
+ | <pre> | ||
+ | diff --git a/CMakeLists.txt b/CMakeLists.txt | ||
+ | index 250d910..f1880e1 100644 | ||
+ | --- a/CMakeLists.txt | ||
+ | +++ b/CMakeLists.txt | ||
+ | @@ -145,7 +145,7 @@ include_directories (${SYSTEM_USR_DIR}) | ||
+ | option (BUILDDOC "Build all doc." OFF) | ||
+ | option (BUILDSWIG "Build swig modules." ON) | ||
+ | option (BUILDSWIGPYTHON "Build swig python modules." ON) | ||
+ | -option (BUILDSWIGNODE "Build swig node modules." ON) | ||
+ | +option (BUILDSWIGNODE "Build swig node modules." OFF) | ||
+ | option (BUILDSWIGJAVA "Build Java API." OFF) | ||
+ | option (USBPLAT "Detection USB platform." OFF) | ||
+ | option (FIRMATA "Add Firmata support to mraa." OFF) | ||
+ | @@ -156,7 +156,7 @@ option (FTDI4222 "Build with FTDI FT4222 subplatform support." OFF) | ||
+ | option (ENABLEEXAMPLES "Disable building of examples" ON) | ||
+ | option (INSTALLTOOLS "Install all tools" ON) | ||
+ | option (BUILDTESTS "Override the addition of tests" ON) | ||
+ | -option (USEPYTHON3TESTS "Force tests to run with python3" OFF) | ||
+ | +option (USEPYTHON3TESTS "Force tests to run with python3" ON) | ||
+ | |||
+ | set (BUILDARCH "" CACHE STRING "Override architecture to build for") | ||
+ | </pre> | ||
+ | |||
+ | Build and install mraa. | ||
+ | |||
+ | <pre> | ||
+ | root@rockpin10bc:/home/rock/mraa# mkdir build | ||
+ | root@rockpin10bc:/home/rock/mraa# cd build/ | ||
+ | root@rockpin10bc:/home/rock/mraa/build# cmake .. | ||
+ | root@rockpin10bc:/home/rock/mraa/build# make | ||
+ | root@rockpin10bc:/home/rock/mraa/build# make install | ||
+ | root@rockpin10bc:/home/rock/mraa/build# ldconfig | ||
+ | root@rockpin10bc:/home/rock/mraa/build# mraa-gpio version | ||
+ | Version v2.1.0-11-g06b2be2 on Radxa ROCK Pi N10 | ||
+ | </pre> | ||
+ | |||
+ | ==== Use mraa ==== | ||
+ | Since we have installed mraa successfully, now we start to use it. At this part, you can check out the following guides. | ||
+ | |||
+ | * [[rockpi4/dev/libmraa | mraa on ROCK Pi 4 ]] | ||
+ | * [[rockpiE/dev/libmraa | mraa on ROCK Pi E ]] | ||
+ | * [[rockpiN10/dev/libmraa | mraa on ROCK Pi N10 ]] | ||
+ | * [[rockpiS/dev/libmraa | mraa on ROCK Pi S ]] | ||
+ | |||
+ | ==== Troubleshooting ==== | ||
+ | * If you have an issue, start a new post on the forum. https://forum.radxa.com/. |
Revision as of 10:36, 17 January 2021
Contents
Mraa on ROCK Pi boards
This document describes how to build and use mraa for ROCK Pi boards.
List of ROCK Pi Boards supported
- ROCK Pi 4 A/B/C
- ROCK Pi E
- ROCK Pi N10
- ROCK Pi S
- ROCK Pi X
List of Linux Distributions
- Ubuntu
- Debian
Install example: Install Mraa on ROCK Pi N10 Debian system
For Debian Distribution the below commands install the essential set:
root@rockpin10bc:/home/rock# apt-get install -y git build-essential swig3.0 python-dev cmake libjson-c-dev libnode-dev root@rockpin10bc:/home/rock# apt-get install -y libc6 libjson-c3 libgcc1 libstdc++6 python2.7 libpython2.7 python3.7 libpython3.7 root@rockpin10bc:/home/rock# apt-get install -y libc6 libjson-c3 libgcc1 libstdc++6 python libpython2.7 python3.6 libpython3.6 root@rockpin10bc:/home/rock# apt-get install -y libgtest-dev pkg-config cmake-data
Get source code.
root@rockpin10bc:/home/rock# git clone -b master https://github.com/radxa/mraa.git root@rockpin10bc:/home/rock# cd mraa
Patch the source code for building mraa with Python.
diff --git a/CMakeLists.txt b/CMakeLists.txt index 250d910..f1880e1 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -145,7 +145,7 @@ include_directories (${SYSTEM_USR_DIR}) option (BUILDDOC "Build all doc." OFF) option (BUILDSWIG "Build swig modules." ON) option (BUILDSWIGPYTHON "Build swig python modules." ON) -option (BUILDSWIGNODE "Build swig node modules." ON) +option (BUILDSWIGNODE "Build swig node modules." OFF) option (BUILDSWIGJAVA "Build Java API." OFF) option (USBPLAT "Detection USB platform." OFF) option (FIRMATA "Add Firmata support to mraa." OFF) @@ -156,7 +156,7 @@ option (FTDI4222 "Build with FTDI FT4222 subplatform support." OFF) option (ENABLEEXAMPLES "Disable building of examples" ON) option (INSTALLTOOLS "Install all tools" ON) option (BUILDTESTS "Override the addition of tests" ON) -option (USEPYTHON3TESTS "Force tests to run with python3" OFF) +option (USEPYTHON3TESTS "Force tests to run with python3" ON) set (BUILDARCH "" CACHE STRING "Override architecture to build for")
Build and install mraa.
root@rockpin10bc:/home/rock/mraa# mkdir build root@rockpin10bc:/home/rock/mraa# cd build/ root@rockpin10bc:/home/rock/mraa/build# cmake .. root@rockpin10bc:/home/rock/mraa/build# make root@rockpin10bc:/home/rock/mraa/build# make install root@rockpin10bc:/home/rock/mraa/build# ldconfig root@rockpin10bc:/home/rock/mraa/build# mraa-gpio version Version v2.1.0-11-g06b2be2 on Radxa ROCK Pi N10
Use mraa
Since we have installed mraa successfully, now we start to use it. At this part, you can check out the following guides.
Troubleshooting
- If you have an issue, start a new post on the forum. https://forum.radxa.com/.