grove.py
grove.py copied to clipboard
Errors when installing on a Raspberry Pi running Bullseye
When running this script on a Raspberry Pi running Bullseye, I get the following errors:
pi@tracker:~ $ curl -sL https://github.com/Seeed-Studio/grove.py/raw/master/install.sh | sudo bash -s -
deb https://seeed-studio.github.io/pi_repo/ stretch main
Warning: apt-key is deprecated. Manage keyring files in trusted.gpg.d instead (see apt-key(8)).
% Total % Received % Xferd Average Speed Time Time Time Current
Dload Upload Total Spent Left Speed
0 0 0 0 0 0 0 0 --:--:-- --:--:-- --:--:-- 0Warning: apt-key is deprecated. Manage keyring files in trusted.gpg.d instead (see apt-key(8)).
100 3822 100 3822 0 0 15991 0 --:--:-- --:--:-- --:--:-- 15991
OK
Get:1 https://seeed-studio.github.io/pi_repo stretch InRelease [3,167 B]
Hit:2 http://raspbian.raspberrypi.org/raspbian bullseye InRelease
Hit:3 http://archive.raspberrypi.org/debian bullseye InRelease
Get:4 https://seeed-studio.github.io/pi_repo stretch/main armhf Packages [31.0 kB]
Fetched 34.1 kB in 1s (32.2 kB/s)
Reading package lists... Done
Building dependency tree... Done
Reading state information... Done
All packages are up to date.
Reading package lists... Done
Building dependency tree... Done
Reading state information... Done
Package python-pip is not available, but is referred to by another package.
This may mean that the package is missing, has been obsoleted, or
is only available from another source
However the following packages replace it:
python3-pip
E: Package 'python-pip' has no installation candidate
dpkg-query: package 'python-pip' is not installed and no information is available
Use dpkg --info (= dpkg-deb --info) to examine archive files.
Reading package lists... Done
Building dependency tree... Done
Reading state information... Done
Package python-pip is not available, but is referred to by another package.
This may mean that the package is missing, has been obsoleted, or
is only available from another source
However the following packages replace it:
python3-pip
E: Package 'python-pip' has no installation candidate
dpkg-query: package 'python-pip' is not installed and no information is available
Use dpkg --info (= dpkg-deb --info) to examine archive files.
Reading package lists... Done
Building dependency tree... Done
Reading state information... Done
Package python-pip is not available, but is referred to by another package.
This may mean that the package is missing, has been obsoleted, or
is only available from another source
However the following packages replace it:
python3-pip
E: Package 'python-pip' has no installation candidate
dpkg-query: package 'python-pip' is not installed and no information is available
Use dpkg --info (= dpkg-deb --info) to examine archive files.
Reading package lists... Done
Building dependency tree... Done
Reading state information... Done
python3-pip is already the newest version (20.3.4-4+rpt1).
0 upgraded, 0 newly installed, 0 to remove and 0 not upgraded.
Enable I2C interface ...
I2C interface enabled...
Reading package lists... Done
Building dependency tree... Done
Reading state information... Done
Package python-rpi.gpio is not available, but is referred to by another package.
This may mean that the package is missing, has been obsoleted, or
is only available from another source
E: Package 'python-rpi.gpio' has no installation candidate
dpkg-query: package 'python-rpi.gpio' is not installed and no information is available
Use dpkg --info (= dpkg-deb --info) to examine archive files.
Reading package lists... Done
Building dependency tree... Done
Reading state information... Done
Package python-rpi.gpio is not available, but is referred to by another package.
This may mean that the package is missing, has been obsoleted, or
is only available from another source
E: Package 'python-rpi.gpio' has no installation candidate
dpkg-query: package 'python-rpi.gpio' is not installed and no information is available
Use dpkg --info (= dpkg-deb --info) to examine archive files.
Reading package lists... Done
Building dependency tree... Done
Reading state information... Done
Package python-rpi.gpio is not available, but is referred to by another package.
This may mean that the package is missing, has been obsoleted, or
is only available from another source
E: Package 'python-rpi.gpio' has no installation candidate
dpkg-query: package 'python-rpi.gpio' is not installed and no information is available
Use dpkg --info (= dpkg-deb --info) to examine archive files.
-------------------------------------------------------
Grove.py installation FAILED, FAILED, FAILED
-------------------------------------------------------
This looks like the Python2 packages are not compatible with bullseye, which makes sense as Python2 has been deprecated. It would be nice if the script was update to only install Python3 libraries to avoid these errors.
I have the exact same problem, running the install on a Raspberry Pi Zero. Running fine on Buster for over a year. Would the issue be solved in Github or be best addressed to Seeed Studio?
#47
Online install
install/update all dependencies and latest grove.py (If you are using Raspberry Pi with Raspberrypi OS >= Bullseye, you cannot use this command line.)
curl -sL https://github.com/Seeed-Studio/grove.py/raw/master/install.sh | sudo bash -s -
Install grove.py
From source code (If you are using Raspberry Pi with Raspberrypi OS >= Bullseye, you have to use this command line.)
git clone https://github.com/Seeed-Studio/grove.py
cd grove.py
# Python2
sudo pip install .
# Python3
sudo pip3 install .
Many thanks. This advice worked a treat and the Grove water detectors are now fully-functional on the Raspberry Pi Zero, running Bullseye.
Glad to be of assistance! ;-)
From source code (If you are using Raspberry Pi with Raspberrypi OS >= Bullseye, you have to use this command line.)
Building from source did not work for me on Bullseye:
fatal: cannot exec 'remote-https': Input/output error
Fatal Python error: init_sys_streams: can't initialize sys standard streams
Python runtime state: core initialized
Traceback (most recent call last):
File "<frozen importlib._bootstrap>", line 1007, in _find_and_load
File "<frozen importlib._bootstrap>", line 986, in _find_and_load_unlocked
File "<frozen importlib._bootstrap>", line 680, in _load_unlocked
File "<frozen importlib._bootstrap_external>", line 786, in exec_module
File "<frozen importlib._bootstrap_external>", line 922, in get_code
File "<frozen importlib._bootstrap_external>", line 980, in get_data
OSError: [Errno 5] Input/output error
I started over in Buster and had no problems at all running the curl
command. :relieved:
Hi @ishotjr,
Did you try the commands for Python3? sudo pip3 install .
I just tried to build from source code on Bullseye (with Python3) and it worked for me. Maybe you could try to reflash Bullseye and try again?
Can I know which Raspberry Pi Model you are using?
Thank you.
@lakshanthad unfortunately I wiped the Bullseye install and replaced it with Buster, so I can't try anything, but here's my exact steps:
cd ~
git clone https://github.com/Seeed-Studio/grove.py
cd grove.py
sudo pip3 install .
fatal: cannot exec 'remote-https': Input/output error
Fatal Python error: init_sys_streams: can't initialize sys standard streams
Python runtime state: core initialized
Traceback (most recent call last):
File "<frozen importlib._bootstrap>", line 1007, in _find_and_load
File "<frozen importlib._bootstrap>", line 986, in _find_and_load_unlocked
File "<frozen importlib._bootstrap>", line 680, in _load_unlocked
File "<frozen importlib._bootstrap_external>", line 786, in exec_module
File "<frozen importlib._bootstrap_external>", line 922, in get_code
File "<frozen importlib._bootstrap_external>", line 980, in get_data
OSError: [Errno 5] Input/output error
:bowtie:
Hello @ishotjr,
I followed the exact same steps you have mentioned and worked for me.
My environment is as follows:
- Raspberry Pi 4 Model B
- Raspberry Pi OS Bullseye
- Python 3.9.2
- pip 20.3.4
I would suggest you to reinstall Bullseye and try again. That would help you to start fresh with the installation. If that also gives errors, run the below command to output the complete log and share again here: sudo pip3 install . > log.txt
Thank you
@lakshanthad ok, thank you! Just to clarify, the previous attempt was a fresh installation too. 😊
Hello @ishotjr,
I understand. Please try on a fresh install again if you have the time. And if that works well, I can close this issue.
Thank you.
Hi all,
When I try to run i.e. grove_led
I got the message Check whether I2C enabled and Grove Base Hat RPi or Grove Base Hat RPi Zero inserted
. I2C is enabled and the Grove Base HAT sits on top of my Raspberrypi 4.
For the second attempt I followed the advise from above and started from scratch with a refreshed system. Then I ran the commands:
git clone https://github.com/Seeed-Studio/grove.py
cd grove.py
sudo pip3 install .
The output of pip3 install doesn't mention any problems:
Looking in indexes: https://pypi.org/simple, https://www.piwheels.org/simple
Processing /home/pi/grove.py
Collecting smbus2
Downloading https://www.piwheels.org/simple/smbus2/smbus2-0.4.1-py2.py3-none-any.whl (11 kB)
Building wheels for collected packages: grove.py
Building wheel for grove.py (setup.py) ... done
Created wheel for grove.py: filename=grove.py-0.6-py3-none-any.whl size=143445 sha256=04d93e15b483cebfe917875b0c13697f378c31626b82ecf8f0dfe3cc55a40a60
Stored in directory: /tmp/pip-ephem-wheel-cache-9z15rh2h/wheels/4d/18/97/e09b15ec52bed2c3d11734c763ba83604391bf7651631a48e3
Successfully built grove.py
Installing collected packages: smbus2, grove.py
Successfully installed grove.py-0.6 smbus2-0.4.1
Thanks in advance.
Hello @chaeusler,
I have reproduced your issue on my Raspberry Pi 4 and it works well.
pi@raspberrypi:~/grove.py/grove $ python grove_led.py
Hat Name = 'Grove Base Hat RPi'
Usage: grove_led.py <pin>
<pin> could be one of below values
in the pin column for GPIO function
And connect the device to corresponding slot
==============
pin | slot
==============
5 | D5
12 | PWM
16 | D16
18 | D18
22 | D22
24 | D24
26 | D26
My environment is as follows:
- Raspberry Pi OS 11 (Bullseye)
- Python 3.9.2 (default version from Bullseye)
- pip 20.3.4 (default version from Bullseye)
I have setup I2C by: sudo raspi-config > Interface Options > I2C
1, Can I know your environment as well? 2, Could you try to reflash the SD card and start fresh? 3, Have you attached the Base HAT to the Raspberry Pi 4 in the correct orientation?
Thank you.
Hi @lakshanthad,
Thanks for your investigations!
pi@raspberrypi:~/grove.py/grove $ hostnamectl
Static hostname: raspberrypi
Icon name: computer
Machine ID: ce513f1a44ff4c9dbd382eb66e08c51e
Boot ID: b2e4734a4c6b474f95a6241b4ffb8db5
Operating System: Raspbian GNU/Linux 11 (bullseye)
Kernel: Linux 5.10.103-v7l+
Architecture: arm
pi@raspberrypi:~/grove.py/grove $ python -V
Python 3.9.2
pi@raspberrypi:~/grove.py/grove $ pip -V
pip 20.3.4 from /usr/lib/python3/dist-packages/pip (python 3.9)
Before reporting, I already started from scratch. Then I only executed the following commands:
git clone https://github.com/Seeed-Studio/grove.py
cd grove.py
sudo pip3 install .
yes
As I understand we have an identical setup.
Hello,
That is quite strange. Can I know how you enabled I2C?
Also, could you please try to run other .py examples and check whether you encounter similar errors?
Thank you.
Hi @chaeusler , Could you able to solve this problem? I am also in the same situation.
Hi @chaeusler , Could you able to solve this problem? I am also in the same situation.
Same issue here (I can see my i2c device using i2cdetect)
My problem has been fixed with this commit: https://github.com/Seeed-Studio/grove.py/commit/a4a5c9bb00aa2bb5ee6d6d50098d6ddc05346140
My problem has been fixed with this commit: a4a5c9b
Unfortunately this did not fix my issue. I'm still getting:
OSError: Please check if the I2C device insert in I2C of Base Hat