Closed mgfink closed 3 years ago
I should probably mention that at this point I'd just like grove.py (and upm, mraa, etc.) to run in a container on a Pi4 running Raspbian Buster. If anyone has such a thing and would be willing to share, that would be great!
I do not know about Docker, but on the Pi itself in the /boot/config.txt uses dtparam=i2c_vc=on to enable the I2C Bus 0. Perhaps the Docker /boot/config.txt is using the Raspberry PI style notation to enable the bus.
That seems to have fixed it...if I added that line on the host I can run the Python sequence from there as well as from the container. THANK YOU!!!
Hello -
I'm trying to get grove.py running on a Docker container on a Raspberry Pi 4B. There have been several issues along the way and am at the point where I'm blocked when trying to call mraa.I2c(0). Only on the container, it will fail with the message "libmraa[9]: i2c: Device not initialized" and other errors shown below.
I've been able to confirm general access to the GPIO pins using rpi.gpio from within the container. I also run the container in privileged mode and pass the i2c buses as device inputs when starting the container. I'm wondering if anyone has come across this and can point me in the right direction.
FWIW I did create a /boot/config.txt file on the container (via Dockerfile) with dtparam=i2c0=on in it. This also did not help.
--------------- Host interaction --------------- pi@raspberrypi:~ $ python3 Python 3.7.3 (default, Jan 22 2021, 20:04:44) [GCC 8.3.0] on linux Type "help", "copyright", "credits" or "license" for more information.
--------------- END ---------------
--------------- Docker interaction --------------- pi@raspberrypi:~ $ docker run --device /dev/i2c-0 --device /dev/i2c-1 --privileged -it -exec grove-container bash root@2028dd0927bd:/src# python Python 3.7.10 (default, May 12 2021, 17:09:41) [GCC 8.3.0] on linux Type "help", "copyright", "credits" or "license" for more information.
--------------- Dockerfile ---------------
--------------- END ---------------
Thanks in advance!