I am reading through this guide on GPIO: https://wiki.radxa.com/Rockpi4/hardware/gpio
Here, the subtitle “wiringX GPIO mapping” links to this external webpage: https://manual.wiringx.org/platforms/radxa/rock4.html#supported-features
It’s interesting but somewhat confusing to the beginner as to what to make of it.
Returning to the GPIO page I get to the bottom and there is another link to GPIO Libraries/API ( libmraa ): https://wiki.radxa.com/Rockpi4/dev/libmraa
I’ve implemented these steps and then on the bottom of this page it says:
More examples (including examples written in python and java) can be found at:
/usr/local/share/mraa/examples/
If I open up examples/python folder I see there are 13 examples. Opening one of these shows that a python library “mraa” is used.
I then discovered another reference to wiringX which is not listed on the GPIO page: https://wiki.radxa.com/WiringX
Here it says:
WiringX is a GPIO library similar to wiringPi, this document describes how to build and use mraa for ROCK Pi boards.
Then in their Python3 examples, wiringX is used. Does this mean mraa is under the hood or is this library a very different implementation.
So could someone explain what the differences are.
For example, why refer to wiringX if mraa is sufficient. Did I need to install the libmraa if I simply decided to use wiringX. All quite confusing for the noob.
PS. Just to note, neither work out of the box.
If I try to run the GPIO python example (gpio.py) from the /usr/local/share/mraa/examples/python
folder
it returns an error saying that based on the file mraa.py in the python/dist-packages/ folder there is an invalid GPIO pin specified.
I did not even try to run similar example from the wiringX examples folder as it uses: gpio.setup(gpio.RASBERRYPI1B2), which is clearly not relevant here.