Install Libmraa on Buster

Also related to (I’m a new user and can only put two links in each message):

Hi, the package name of mraa for ROCK Pi 4 is changed to libmraa, which also supports ROCK Pi S/E/N10.

Package rockchip-fstab and libmraa-rockpi4 are not needed any more.

We have just updated the mraa guide. Please check here,https://wiki.radxa.com/Rockpi4/dev/libmraa.

hi @Stephen further to comment from @marvin above

Unfortunately, things still aren’t working. Here is the Dockerfile we are using and this is what /boot/hw_intfc.conf looks like:

intfc:pwm0=off
intfc:pwm1=off
intfc:uart2=off
intfc:uart4=off
intfc:spi1=off
intfc:spi2=off
intfc:i2c2=on
intfc:i2c6=on
intfc:i2c7=on

But neither GPIO or I2C returns any results:

# mraa-i2c list
# mraa-gpio list
No Pins

Also, it appears to detect the i2c buses 2, 6 and 7 but does not configure them properly:

# /usr/sbin/i2cdetect -l
i2c-0	unknown   	rk3x-i2c                        	N/A
i2c-1	i2c       	rk3x-i2c                        	I2C adapter
i2c-2	unknown   	rk3x-i2c                        	N/A
i2c-7	unknown   	rk3x-i2c                        	N/A
i2c-9	unknown   	DesignWare HDMI                 	N/A

Also, when we use the same hat with i2c on a Raspberry Pi 4, we see the ECC in the expected address, 0x60:

# /usr/sbin/i2cdetect -y 1
0 1 2 3 4 5 6 7 8 9 a b c d e f
00: -- -- -- -- -- -- -- -- -- -- -- -- --
10: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
20: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
30: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
40: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
50: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
60: 60 -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
70: -- -- -- -- -- -- -- --

But when we do the same thing on the RockPi, it shows up busy and in a different address, 0x11:

# /usr/sbin/i2cdetect -y 1
     0  1  2  3  4  5  6  7  8  9  a  b  c  d  e  f
00:          -- -- -- -- -- -- -- -- -- -- -- -- --
10: -- UU -- -- -- -- -- -- -- -- -- -- -- -- -- --
20: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
30: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
40: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
50: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
60: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
70: -- -- -- -- -- -- -- --

Clearly this is the wrong I2c bus

Any ideas?

Would you please use this image for quick test, https://dl.radxa.com/rockpi4/images/debian/rockpi4b_debian_buster_xfce4_arm64_20210608_1321-gpt.img.gz?

Thanks @Stephen this helped narrow down the problems I was facing. Here’s an overview of the main challenges faced:

  • Radxa APT does not have consistent contents. libmraa specifically seems to be available only in buster-testing but not buster-stable. Furthermore, some docs reference buster alone.
  • Unable to locate the source code for the packages in Radxa APT. Unclear how the referenced packages work.
  • Using a RockPi image supplied by Balena.io instead of the official Radxa release. Dockerfiles that use that image must set privileged: true. Attempted to use container flag io.balena.features.sysfs without success.
  • The end goal is to get gateway-miner-rs working on RockPi. Care needed to be taken to supply the application with the correct arguments. sudo ./gateway_mfr --path /dev/i2c-7 --address 96 test. Note that 0x60 == 96. 96 is the default address.

I am still doing some additional validations, but every thing is working now. Thank you.

Package libmraa is added to buster-stable.

Any chance we could get a .deb installable on bullseye (esp given that it’s current stable)?

AFAICT it should just be a matter of depending on python3.9 rather than 3.7/3.8 (<3.9 is not available in bullseye main repos)

We are still getting the error of package not found in the apt repo

“Unable to locate package”

You can modify file /etc/apt/sources.list.d/apt-radxa-com.list like this:

deb http://apt.radxa.com/buster-stable/ buster main
deb http://apt.radxa.com/buster-testing/ buster main

Because the newest package libmraa is added to buster-testing.
And install needed packages.

sudo apt update
sudo apt install libmraa