Compatible with Banana Pi M2 Berry / M5 or Radxa Rock 3 A / Rock 4 C+?

hello community,
as the title asks:

any chance this is working with one of these alternative boards?

  • Banana Pi M2 Berry
  • Banana Pi M5
  • Radxa Rock 3 A
  • Radxa Rock 4 C+

my first test with M2 Berry and the 16.04 official image was that the GrovePi is visible via $ sudo i2cdetect -y 2
the grove_rgb_lcd example works with the smbus number changed from 1 to 2.
but i did not get the grovepi.py to work. also i tried with setting it to hw smbus mode and tweaking the di_i2c.py script to use also use the bus ‘2’:
with this i get an exception at line 225
as after the first read the data variable just has a simple 0 in there. (not a list…)

anyone had this running?

i have cross-posted this request at the GrovePi github repro:

any ideas / tips - pleas let me know!!!

sunny greetings
stefan

3 Likes

There is research being done by Modular Robotics/Dexter Industries on this exact topic, but it is quite early on in the process and there really isn’t much to report as yet.

If you do any research on this topic yourself, we’d all greatly appreciate if you’d post about it here and perhaps on the GoPiGo GitHub site.

3 Likes

just a clarification from my side-
i am mainly interested in python and maybe node-red support…

i have some first findings:

banana pi M2 Berry

grovepi not working yet. (needs a bunch of more in depth looking at the sources…)
rgb_lcd is working with modifications.
just setting bus = smbus.SMBus(2) (commenting all the other lines 25…35.

Banana Pi M5

working. :slight_smile:
after an odyssey of digging into what this all depends on i came up with something that seems to work:
this is currently only what i have done → to be checked what is really needed…

check i2c grovepi detection

sudo i2cdetect -y 0
     0  1  2  3  4  5  6  7  8  9  a  b  c  d  e  f
00:          03 04 -- -- -- -- -- -- -- -- -- -- -- 
10: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- 
20: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- 
30: -- -- -- -- -- -- -- -- -- -- -- -- -- -- 3e -- 
40: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- 
50: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- 
60: -- -- 62 -- -- -- -- -- -- -- -- -- -- -- -- -- 
70: 70 -- -- -- -- -- -- --   

→ there should be an 04 visible.
i also had connected an grove_rgb_lcd - therefore there are some more devices found…

instal

based on [SOLVED] Using GrovePi+ on Raspberry Pi bullseye 64-bit OS

sudo apt install python3-pip
sudo apt install python-as-python3
sudo apt install arduino
sudo apt install python3-periphery
sudo apt install python3-smbus
curl -kL dexterindustries.com/update_grovepi | bash
cd Dexter/GrovePi/Software/Python
wget https://raw.githubusercontent.com/DexterInd/RFR_Tools/master/miscellaneous/di_i2c.py
wget https://raw.githubusercontent.com/DexterInd/RFR_Tools/master/miscellaneous/di_mutex.py

tweaks

sudo pip uninstall RPI.GPIO
git clone https://github.com/BPI-SINOVOIP/RPi.GPIO.git
cd RPi.GPIO/
sudo python setup.py install

# cd ~
# sudo apt remove wiringpi
# # this installs the forked version from https://github.com/WiringPi/WiringPi-Python
# pip install wiringpi
# not needed anymore..
# as we use hw i2c

# tweak grovepi.py
# change 
#   set_bus("RPI_1SW") 
# to
# set_bus("RPI_1") 
# → to enable HW mode.

# tweak di_i2c.py
# change 
# self.i2c_bus = I2C("/dev/i2c-1")
# to
# self.i2c_bus = I2C("/dev/i2c-0")


# check
python ./Dexter/GrovePi/Software/Python/grove_led_blink.py
# working


nano ./Dexter/GrovePi/Software/Python/grove_rgb_lcd/grove_rgb_lcd.py
# remove lines
#    import RPi.GPIO as GPIO
#    rev = GPIO.RPI_REVISION
#    if rev == 2 or rev == 3:
#        bus = smbus.SMBus(1)
#    else:
# so that only this line is there
# bus = smbus.SMBus(0)

# check
python ./Dexter/GrovePi/Software/Python/grove_rgb_lcd/grove_rgb_lcd.py
# working

@jimrh do you have a link / issue i should report to?

2 Likes

Do you have a GitHub repo?

That would be the best place for it as you can continue work and share what you do.

Pretty much everyone here as their own GitHub repo that they save their robotics work to and we all post links to them.

You can set a repo up if you don’t have one for this project and then share it with everyone else.

My only request is that you stick around and continue this line of research as it happens to be extremely important now that Pi’s are scarce.

This would be an invaluable contribution to what the rest of us are doing and I am looking forward to your continued research and results.

Jim

i have no repro for this project explicit - as it is just a test setup.
i am willing to create pull-requests for the GrovePi and
RFR_Tools repros -
as these are the points where the board detection in python is failing…
this would need some help from others to cross test on orig RPIs as i do not have access to such…

3 Likes

The best way would be to create a repo for your project and then fork the repositories where you are having problems. You can use the forked repo’s in your project, and as you generate solutions you can generate pull requests from your fork.

Having a project specific repo is good because it allows you to both segregate and share your work with others who may wish to either learn from you, or help add to your efforts.

2 Likes