Python library for Seeedstudio Grove devices

Overview

grove.py

Build Status

Python library for Seeedstudio Grove Devices on embeded Linux platform, especially good on below platforms:



Architecture

To operate grove sensors, the grove.py depends many hardware interface libraries such as mraa/upm/smbus2.




Installation

For beginner or library user only, please install with online method.
For developer or advanced user, please install dependencies and then install grove.py with source code.

Online install

install/update all dependencies and latest grove.py

curl -sL https://github.com/Seeed-Studio/grove.py/raw/master/install.sh | sudo bash -s -

Install grove.py

From source code

git clone https://github.com/Seeed-Studio/grove.py
cd grove.py
# Python2
sudo pip install .
# Python3
sudo pip3 install .



Usage

Basic GPIO Input & Output demo

import time
from grove.gpio import GPIO

led = GPIO(12, GPIO.OUT)
button = GPIO(22, GPIO.IN)

while True:
    if button.read():
        led.write(1)
    else:
        led.write(0)
    time.sleep(0.1)

See more demos and how to run



API Documentation

click here

how to update me



Contribution

Check list for adding a new grove device, for simple, take grove_led as a example.

  • Add a Class in the python source file, and export with __all__ =
  • Code sytle PEP8 is recommanded
  • The python source could run directly with python and python3
  • Add demo code at the near top of source file
  • The demo code could run directly with someone python/python3 IDE.
  • Add document to class and it's member and show the result by refering to API document
  • Add a command item in setup.py console_scripts list, take effect by install again
  • Add a item to command table in Usage Doc
  • If the command need argument but not specified, please list available arguments.
  • If specified invalid argument, also output usage document then exit.
Comments
  • Unable to install dependencies upm and mraa on Raspberry Pi Bullseye

    Unable to install dependencies upm and mraa on Raspberry Pi Bullseye

    Possibly related to issue #46, I can't get the dependencies upm and mraa installed:

    sudo apt install python3-mraa python3-upm
    Reading package lists... Done
    Building dependency tree... Done
    Reading state information... Done
    Some packages could not be installed. This may mean that you have
    requested an impossible situation or if you are using the unstable
    distribution that some required packages have not yet been created
    or been moved out of Incoming.
    The following information may help to resolve the situation:
    
    The following packages have unmet dependencies:
     python3-mraa : Depends: libjson-c3 (>= 0.10) but it is not installable
                    Depends: libmraa1 but it is not going to be installed
                    Depends: libpython3.5 (>= 3.5.0~b1) but it is not installable
     python3-upm : Depends: libmraa1 but it is not going to be installed
                   Depends: libpython3.5 (>= 3.5.0~b1) but it is not installable
                   Depends: libupm1 but it is not going to be installed
    E: Unable to correct problems, you have held broken packages.
    
    opened by Patrick257 6
  • Problem opening multiple i2c busses at the same time

    Problem opening multiple i2c busses at the same time

    in i2c.py the line #51

    Bus.instance = smbus.SMBus(bus)

    causes problems when trying to open two distinct i2c busses from the same app. in our case both calls would open a device on the same i2c bus.

    changing to

    self.instance = smbus.SMBus(bus)

    fixed the problem.

    using respberry py at the paj7620 sensor on i2c bus 1 & 3

    opened by nikolozka 3
  • ADC.version() - wrong implementation for register 0x03

    ADC.version() - wrong implementation for register 0x03

    @property def version(self): return self.read_register(0x3)

    Reading from this register doesn' t return a firmware version - int value. Reapeated reading from this register returns following string: GROVE BASE HAT RPI

    opened by pezi 2
  • Can't install lib on Jetson Nano

    Can't install lib on Jetson Nano

    Hello,

    When I use "curl -sL https://github.com/Seeed-Studio/grove.py/raw/master/install.sh | sudo bash -s -" on Jetson nano, the output informs me as:

    Err:18 https://seeed-studio.github.io/pi_repo unknown Release
    404 Not Found [IP: 185.199.109.153 443]

    Any suggestion?

    Thanks!

    opened by shijiong 2
  • curl installation fails due to libmraa1 and libbma456

    curl installation fails due to libmraa1 and libbma456

    When I try to use the online option (curl) to install grove.py I get the following error:

    fjp@ubuntu:~/git/grove.py$ curl -sL https://github.com/Seeed-Studio/grove.py/raw/master/install.sh | sudo bash -s -
    Warning: apt-key output should not be parsed (stdout is not a terminal)
    Hit:1 http://ports.ubuntu.com/ubuntu-ports bionic InRelease
    Hit:2 http://ports.ubuntu.com/ubuntu-ports bionic-updates InRelease                                       
    Hit:3 http://ports.ubuntu.com/ubuntu-ports bionic-backports InRelease                                     
    Hit:4 http://ports.ubuntu.com/ubuntu-ports bionic-security InRelease                
    Hit:5 https://seeed-studio.github.io/pi_repo stretch InRelease                      
    Hit:6 http://ports.ubuntu.com/ubuntu-ports bionic-proposed InRelease
    Hit:7 http://ppa.launchpad.net/oibaf/graphics-drivers/ubuntu bionic InRelease
    Hit:8 http://packages.ros.org/ros/ubuntu bionic InRelease     
    Reading package lists... Done
    Building dependency tree       
    Reading state information... Done
    All packages are up to date.
    N: Skipping acquire of configured file 'main/binary-arm64/Packages' as repository 'https://seeed-studio.github.io/pi_repo stretch InRelease' doesn't support architecture 'arm64'
    Enable I2C interface ...
    I2C interface enabled...
    Reading package lists... Done
    Building dependency tree       
    Reading state information... Done
    python-rpi.gpio is already the newest version (0.6.3-1ubuntu4).
    0 upgraded, 0 newly installed, 0 to remove and 0 not upgraded.
    Reading package lists... Done
    Building dependency tree       
    Reading state information... Done
    python3-rpi.gpio is already the newest version (0.6.3-1ubuntu4).
    0 upgraded, 0 newly installed, 0 to remove and 0 not upgraded.
    Reading package lists... Done
    Building dependency tree       
    Reading state information... Done
    E: Unable to locate package libmraa1
    dpkg-query: package 'libmraa1' is not installed and no information is available
    Use dpkg --info (= dpkg-deb --info) to examine archive files,
    and dpkg --contents (= dpkg-deb --contents) to list their contents.
    Reading package lists... Done
    Building dependency tree       
    Reading state information... Done
    E: Unable to locate package libmraa1
    dpkg-query: package 'libmraa1' is not installed and no information is available
    Use dpkg --info (= dpkg-deb --info) to examine archive files,
    and dpkg --contents (= dpkg-deb --contents) to list their contents.
    Reading package lists... Done
    Building dependency tree       
    Reading state information... Done
    E: Unable to locate package libmraa1
    dpkg-query: package 'libmraa1' is not installed and no information is available
    Use dpkg --info (= dpkg-deb --info) to examine archive files,
    and dpkg --contents (= dpkg-deb --contents) to list their contents.
    -------------------------------------------------------
         Grove.py installation FAILED, FAILED, FAILED      
    -------------------------------------------------------
    

    I think this happens because libmraa1 cannot be located.

    Installing libmraa from here with the following commands:

    sudo add-apt-repository ppa:mraa/mraa
    sudo apt-get update
    sudo apt-get install libmraa2 libmraa-dev libmraa-java python-mraa python3-mraa node-mraa mraa-tools
    

    After that, I executed the curl command again and got a little further but the installation of grove.py stilll fails because of libbma456:

    fjp@ubuntu:~/git/grove.py$ curl -sL https://github.com/Seeed-Studio/grove.py/raw/master/install.sh | sudo bash -s -
    Warning: apt-key output should not be parsed (stdout is not a terminal)
    Hit:1 http://ports.ubuntu.com/ubuntu-ports bionic InRelease
    Get:2 http://ports.ubuntu.com/ubuntu-ports bionic-updates InRelease [88.7 kB]                             
    Hit:3 https://seeed-studio.github.io/pi_repo stretch InRelease                                                       
    Get:4 http://ports.ubuntu.com/ubuntu-ports bionic-backports InRelease [74.6 kB]
    Get:5 http://ports.ubuntu.com/ubuntu-ports bionic-security InRelease [88.7 kB]
    Get:6 http://ports.ubuntu.com/ubuntu-ports bionic-proposed InRelease [242 kB]
    Get:7 http://ports.ubuntu.com/ubuntu-ports bionic-updates/main arm64 DEP-11 Metadata [290 kB]
    Get:8 http://ports.ubuntu.com/ubuntu-ports bionic-updates/main DEP-11 48x48 Icons [73.8 kB]
    Get:9 http://ports.ubuntu.com/ubuntu-ports bionic-updates/main DEP-11 64x64 Icons [147 kB]     
    Get:10 http://ports.ubuntu.com/ubuntu-ports bionic-updates/universe arm64 DEP-11 Metadata [259 kB]
    Get:11 http://ports.ubuntu.com/ubuntu-ports bionic-updates/universe DEP-11 48x48 Icons [207 kB]     
    Get:12 http://ports.ubuntu.com/ubuntu-ports bionic-updates/universe DEP-11 64x64 Icons [445 kB]
    Get:13 http://ports.ubuntu.com/ubuntu-ports bionic-backports/universe arm64 DEP-11 Metadata [7976 B]
    Get:14 http://ports.ubuntu.com/ubuntu-ports bionic-security/main arm64 DEP-11 Metadata [32.6 kB]
    Get:15 http://ports.ubuntu.com/ubuntu-ports bionic-security/main DEP-11 48x48 Icons [17.6 kB]
    Get:16 http://ports.ubuntu.com/ubuntu-ports bionic-security/main DEP-11 64x64 Icons [41.5 kB]
    Get:17 http://ports.ubuntu.com/ubuntu-ports bionic-security/universe arm64 DEP-11 Metadata [37.0 kB]
    Get:18 http://ports.ubuntu.com/ubuntu-ports bionic-security/universe DEP-11 48x48 Icons [16.4 kB]
    Get:19 http://ports.ubuntu.com/ubuntu-ports bionic-security/universe DEP-11 64x64 Icons [111 kB]  
    Get:20 http://ports.ubuntu.com/ubuntu-ports bionic-proposed/main arm64 DEP-11 Metadata [4612 B] 
    Get:21 http://ports.ubuntu.com/ubuntu-ports bionic-proposed/universe arm64 DEP-11 Metadata [212 B]
    Hit:22 http://ppa.launchpad.net/mraa/mraa/ubuntu bionic InRelease                                                                                                                        
    Hit:23 http://ppa.launchpad.net/oibaf/graphics-drivers/ubuntu bionic InRelease                                                                                                           
    Hit:24 http://packages.ros.org/ros/ubuntu bionic InRelease                                                                                                                               
    Fetched 2185 kB in 11s (198 kB/s)                                                                                                                                                        
    Reading package lists... Done
    Building dependency tree       
    Reading state information... Done
    All packages are up to date.
    N: Skipping acquire of configured file 'main/binary-arm64/Packages' as repository 'https://seeed-studio.github.io/pi_repo stretch InRelease' doesn't support architecture 'arm64'
    I2C interface enabled...
    Reading package lists... Done
    Building dependency tree       
    Reading state information... Done
    python-rpi.gpio is already the newest version (0.6.3-1ubuntu4).
    0 upgraded, 0 newly installed, 0 to remove and 0 not upgraded.
    Reading package lists... Done
    Building dependency tree       
    Reading state information... Done
    python3-rpi.gpio is already the newest version (0.6.3-1ubuntu4).
    0 upgraded, 0 newly installed, 0 to remove and 0 not upgraded.
    Reading package lists... Done
    Building dependency tree       
    Reading state information... Done
    The following NEW packages will be installed:
      libmraa1
    0 upgraded, 1 newly installed, 0 to remove and 0 not upgraded.
    Need to get 59.1 kB of archives.
    After this operation, 179 kB of additional disk space will be used.
    Get:1 http://ppa.launchpad.net/mraa/mraa/ubuntu bionic/main arm64 libmraa1 arm64 1.9.0-1~ubuntu18.04 [59.1 kB]
    Fetched 59.1 kB in 10s (5800 B/s)   
    Selecting previously unselected package libmraa1.
    (Reading database ... 211870 files and directories currently installed.)
    Preparing to unpack .../libmraa1_1.9.0-1~ubuntu18.04_arm64.deb ...
    Unpacking libmraa1 (1.9.0-1~ubuntu18.04) ...
    Setting up libmraa1 (1.9.0-1~ubuntu18.04) ...
    Processing triggers for libc-bin (2.27-3ubuntu1) ...
    Reading package lists... Done
    Building dependency tree       
    Reading state information... Done
    python-mraa is already the newest version (2.0.0-1~ubuntu18.04).
    0 upgraded, 0 newly installed, 0 to remove and 0 not upgraded.
    Reading package lists... Done
    Building dependency tree       
    Reading state information... Done
    The following additional packages will be installed:
      libupm1
    The following NEW packages will be installed:
      libupm1 python-upm
    0 upgraded, 2 newly installed, 0 to remove and 0 not upgraded.
    Need to get 3962 kB of archives.
    After this operation, 39.3 MB of additional disk space will be used.
    Get:1 http://ppa.launchpad.net/mraa/mraa/ubuntu bionic/main arm64 libupm1 arm64 1.7.1-1~ubuntu18.04 [656 kB]
    Get:2 http://ppa.launchpad.net/mraa/mraa/ubuntu bionic/main arm64 python-upm arm64 1.7.1-1~ubuntu18.04 [3307 kB]
    Fetched 3962 kB in 11s (352 kB/s)     
    Selecting previously unselected package libupm1.
    (Reading database ... 211875 files and directories currently installed.)
    Preparing to unpack .../libupm1_1.7.1-1~ubuntu18.04_arm64.deb ...
    Unpacking libupm1 (1.7.1-1~ubuntu18.04) ...
    Selecting previously unselected package python-upm.
    Preparing to unpack .../python-upm_1.7.1-1~ubuntu18.04_arm64.deb ...
    Unpacking python-upm (1.7.1-1~ubuntu18.04) ...
    Setting up libupm1 (1.7.1-1~ubuntu18.04) ...
    Setting up python-upm (1.7.1-1~ubuntu18.04) ...
    Processing triggers for libc-bin (2.27-3ubuntu1) ...
    Reading package lists... Done
    Building dependency tree       
    Reading state information... Done
    python3-mraa is already the newest version (2.0.0-1~ubuntu18.04).
    0 upgraded, 0 newly installed, 0 to remove and 0 not upgraded.
    Reading package lists... Done
    Building dependency tree       
    Reading state information... Done
    The following NEW packages will be installed:
      python3-upm
    0 upgraded, 1 newly installed, 0 to remove and 0 not upgraded.
    Need to get 3264 kB of archives.
    After this operation, 33.5 MB of additional disk space will be used.
    Get:1 http://ppa.launchpad.net/mraa/mraa/ubuntu bionic/main arm64 python3-upm arm64 1.7.1-1~ubuntu18.04 [3264 kB]
    Fetched 3264 kB in 12s (283 kB/s)      
    Selecting previously unselected package python3-upm.
    (Reading database ... 212946 files and directories currently installed.)
    Preparing to unpack .../python3-upm_1.7.1-1~ubuntu18.04_arm64.deb ...
    Unpacking python3-upm (1.7.1-1~ubuntu18.04) ...
    Setting up python3-upm (1.7.1-1~ubuntu18.04) ...
    Reading package lists... Done
    Building dependency tree       
    Reading state information... Done
    E: Unable to locate package libbma456
    dpkg-query: package 'libbma456' is not installed and no information is available
    Use dpkg --info (= dpkg-deb --info) to examine archive files,
    and dpkg --contents (= dpkg-deb --contents) to list their contents.
    Reading package lists... Done
    Building dependency tree       
    Reading state information... Done
    E: Unable to locate package libbma456
    dpkg-query: package 'libbma456' is not installed and no information is available
    Use dpkg --info (= dpkg-deb --info) to examine archive files,
    and dpkg --contents (= dpkg-deb --contents) to list their contents.
    Reading package lists... Done
    Building dependency tree       
    Reading state information... Done
    E: Unable to locate package libbma456
    dpkg-query: package 'libbma456' is not installed and no information is available
    Use dpkg --info (= dpkg-deb --info) to examine archive files,
    and dpkg --contents (= dpkg-deb --contents) to list their contents.
    -------------------------------------------------------
         Grove.py installation FAILED, FAILED, FAILED      
    -------------------------------------------------------
    

    I couldn't find out how to install the missing dependency libbma456. Any ideas how I can fix this? Thank you!

    opened by fjp 2
  • "grove_temperature_humidity_sensor" command is not found.

    I want to use Temperature & Humidity Sensor(DHT11).

    I installed grove.py following the steps. But [grove_temperature_humidity_sensor] Command is not found. Also, I can't find the source code(grove_temperature_humidity_sensor.py).

    [grove_temperature_humidity_bme680] Command and [grove_temperature_humidity_sht31] Command can be confirmed.

    Please let us know if you know why it doesn't work. Thank you very much.

    opened by tatsu1225 2
  • issue with UPM: No module named UPM

    issue with UPM: No module named UPM

    Hi,

    I have an rpi model 3b pi@mark2:~/python/grove.py $ uname -a Linux mark2 4.14.98-v7+ #1200 SMP Tue Feb 12 20:27:48 GMT 2019 armv7l GNU/Linux

    pi@mark2:~/python/grove.py $ lsb_release -a No LSB modules are available. Distributor ID: Raspbian Description: Raspbian GNU/Linux 9.8 (stretch) Release: 9.8 Codename: stretch

    The install script seems to run succesffully:

    #######################################################
    
      Lastest Grove.py from github install complete   !!!!!
    
    #######################################################
    

    mraa and upm are installed on my pi:

    pi@mark2:~/python/grove.py $ dpkg -s libupm1
    Package: libupm1
    Status: install ok installed
    Priority: optional
    Section: libs
    Installed-Size: 4238
    Maintainer: Flavian Costin Manea <[email protected]>
    Architecture: armhf
    Source: upm
    Version: 1.6.0-git20190404-pi20190404
    Depends: libc6 (>= 2.15), libgcc1 (>= 1:3.5), libjpeg62-turbo (>= 1.3.1), libmraa1, libstdc++6 (>= 6)
    Description: Sensor/Actuator repository for MRAA (runtime)
     UPM is a high level repository for sensors that use MRAA. Each sensor
     links to MRAA and are not meant to be interlinked although some
     groups of sensors may be.
     .
     This package contains the library used at runtime.
    Homepage: http://iotdk.intel.com/docs/master/upm/
    pi@mark2:~/python/grove.py $ dpkg -s libmraa1
    Package: libmraa1
    Status: install ok installed
    Priority: optional
    Section: libs
    Installed-Size: 183
    Maintainer: Tom Ingleby <[email protected]>
    Architecture: armhf
    Source: mraa
    Version: 1.9.0-git20190404-pi20190404
    Depends: libc6 (>= 2.15), libjson-c3 (>= 0.10)
    Description: userspace I/O library (runtime)
     mraa (libmraa) is library for interacting with userspace I/O on GNU/Linux
     platforms. The library abstracts platform quirks away from the end user.
     Currently interfaces supported include GPIO/PWM/I2C/SPI.
     .
     This package contains the library used at runtime.
    Homepage: http://iotdk.intel.com/docs/master/mraa/
    

    Yet when I try to run grove_temperature_sensor I get this error:

    Traceback (most recent call last):
      File "/usr/local/bin/grove_temperature_sensor", line 11, in <module>
        load_entry_point('grove.py==0.6', 'console_scripts', 'grove_temperature_sensor')()
      File "/usr/local/lib/python3.7/site-packages/pkg_resources/__init__.py", line 487, in load_entry_point
        return get_distribution(dist).load_entry_point(group, name)
      File "/usr/local/lib/python3.7/site-packages/pkg_resources/__init__.py", line 2728, in load_entry_point
        return ep.load()
      File "/usr/local/lib/python3.7/site-packages/pkg_resources/__init__.py", line 2346, in load
        return self.resolve()
      File "/usr/local/lib/python3.7/site-packages/pkg_resources/__init__.py", line 2352, in resolve
        module = __import__(self.module_name, fromlist=['__name__'], level=0)
      File "/usr/local/lib/python3.7/site-packages/grove/grove_temperature_sensor.py", line 31, in <module>
        from grove.factory import Factory
      File "/usr/local/lib/python3.7/site-packages/grove/factory/__init__.py", line 2, in <module>
        from .factory import *
      File "/usr/local/lib/python3.7/site-packages/grove/factory/factory.py", line 38, in <module>
        from grove.temperature import *
      File "/usr/local/lib/python3.7/site-packages/grove/temperature/__init__.py", line 2, in <module>
        from .mcp9808 import TemperMCP9808
      File "/usr/local/lib/python3.7/site-packages/grove/temperature/mcp9808.py", line 38, in <module>
        from upm.pyupm_mcp9808 import MCP9808
    ModuleNotFoundError: No module named 'upm'
    

    this is with version 0.6. Is there any way you can help me with this?

    Kind regards, Chris

    opened by chrisovergaauw 2
  • grove_temperature_humidity_sensor.py

    grove_temperature_humidity_sensor.py

    Hey, why is this code not on the master branch? https://github.com/Seeed-Studio/grove.py/blob/8205879e6e96be4f9c9159b01c347ce1be1be2e5/grove/grove_temperature_humidity_sensor.py

    The sensor documentation refers to non-existing files. http://wiki.seeedstudio.com/Grove-TemperatureAndHumidity_Sensor/

    The DHT11 sensor cannot be tested without this example.

    opened by Desseres 2
  • GPS module only reads US satellites

    GPS module only reads US satellites

    In the GPS module code, the only source that is detected is GP, the US GPS constellation. The Air530 sensor supports other constellations, but this library is unable to detect them.

    The logic in the read function should ignore the 2 characters for the sender field at the start of the NMEA message to support other constellations.

    opened by jimbobbennett 1
  • Trouble installing grove.py

    Trouble installing grove.py

    Hello,

    I've been playing around with an OKdo Air Quality kit and I seem to have fallen at an early hurdle.

    The installation of grove.py on to a Pi using the command below seems to go well until the very end where I am told that the installation failed.

    curl -sL https://github.com/Seeed-Studio/grove.py/raw/master/install.sh | sudo bash -s -

    main: line 107: pip: command not found main: line 108: pip: command not found main: line 107: pip: command not found main: line 108: pip: command not found main: line 107: pip: command not found main: line 108: pip: command not found

     Grove.py installation FAILED, FAILED, FAILED
    

    Any thoughts on how to solve this would be awesome.

    regards,

    opened by grantforster1979 1
  • Adding install of pip for RPi

    Adding install of pip for RPi

    On a clean Raspberry Pi, this installer fails as it depends on Pip, which is not installed by default on Raspberry Pi OS Lite.

    This change installs pip for Python 2 and Python 3.

    This should fix #28

    opened by jimbobbennett 0
  • Can't Run Examples

    Can't Run Examples

    It seems that mraa and upm libraries and not maintained anymore. So you cannot use mraa and upm related Grove modules. FIX THIS BLOODY ISSUE AND DO NOT CLOSE IT AGAIN UNTIL IT IS FIXED.

    opened by dooley-ch 4
  • I2C error (Please check if the I2C device insert in I2C of Base Hat)

    I2C error (Please check if the I2C device insert in I2C of Base Hat)

    I'm getting this I2C error which I can't seem to figure out why:

    raceback (most recent call last):
      File "/home/pi/.local/lib/python3.9/site-packages/seeed_si114x.py", line 296, in _ReadByte
        read_data = self.bus.read_byte_data(self.addr,Reg)
      File "/usr/local/lib/python3.9/dist-packages/smbus2/smbus2.py", line 433, in read_byte_data
        ioctl(self.fd, I2C_SMBUS, msg)
    OSError: [Errno 121] Remote I/O error
    
    During handling of the above exception, another exception occurred:
    
    Traceback (most recent call last):
      File "/home/pi/logic/./tests/sunlight_test.py", line 16, in <module>
        main()
      File "/home/pi/logic/./tests/sunlight_test.py", line 7, in main
        SI1145 = seeed_si114x.grove_si114x()
      File "/home/pi/.local/lib/python3.9/site-packages/seeed_si114x.py", line 184, in __init__
        assert self.Begin() , "Please check if the I2C device insert in I2C of Base Hat"
      File "/home/pi/.local/lib/python3.9/site-packages/seeed_si114x.py", line 194, in Begin
        if self._ReadByte(SI114X_PART_ID) != 0X45:
      File "/home/pi/.local/lib/python3.9/site-packages/seeed_si114x.py", line 298, in _ReadByte
        raise  OSError("Please check if the I2C device insert in I2C of Base Hat")
    OSError: Please check if the I2C device insert in I2C of Base Hat
    Exception ignored in: <function grove_si114x.__del__ at 0xb659cad8>
    Traceback (most recent call last):
      File "/home/pi/.local/lib/python3.9/site-packages/seeed_si114x.py", line 186, in __del__
        self._WriteByte(SI114X_COMMAND, SI114X_RESET)
      File "/home/pi/.local/lib/python3.9/site-packages/seeed_si114x.py", line 306, in _WriteByte
        raise OSError("Please check if the I2C device insert in I2C of Base Hat")
    OSError: Please check if the I2C device insert in I2C of Base Hat
    

    The code I'm running is from: https://github.com/Seeed-Studio/Seeed_Python_SI114X/blob/master/examples/BasicRead.py but the error message indicates that it's within this library? (please correct me if I'm wrong)

    • I found some sources claiming that the "OSError: Please check if the I2C device insert in I2C of Base Hat" is due to incorrect wiring but I don't see how this would be the case when using the Pi hat..
    • I've checked with "i2cdetect -y 1" to make sure the device is recognised (it is)
    • The above error ("OSError: [Errno 121] Remote I/O error") goes away when I type in the I2C device address manually (in my case 0x53), but the bottom error ("OSError: Please check if the I2C device insert in I2C of Base Hat") remains..
    • I'm using this module from grove: https://wiki.seeedstudio.com/Grove-Sunlight_Sensor/
    • I've tried clean-installing from scratch and only downloading the required libs for the hat+sensor
    • I've also tried installing from source (this repo) instead of fetching directly from pip
    • I've tried using a different Pi (same specs) just to be sure it's not an issue with my pi

    Unfortunately I don't have any other I2C devices I can try.

    i2cdetect -y 1 output:

         0  1  2  3  4  5  6  7  8  9  a  b  c  d  e  f
    00:                         08 -- -- -- -- -- -- -- 
    10: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- 
    20: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- 
    30: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- 
    40: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- 
    50: -- -- -- 53 -- -- -- -- -- -- -- -- -- -- -- -- 
    60: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- 
    70: -- -- -- -- -- -- -- --   
    

    I'm running raspbian 11 (bullseye) on a raspberry pi 4

    opened by duart38 0
  • grove/grove_pwm_buzzer.py missing

    grove/grove_pwm_buzzer.py missing

    But both the https://github.com/Seeed-Studio/grove.py/blob/master/setup.py script as well as various documentation (e.g. https://wiki.seeedstudio.com/Grove_Base_Hat_for_Raspberry_Pi/#usage) prominently mention grove_pwm_buzzer.

    I cannot find grove/grove_pwm_buzzer.py it in the current master branch. Only a pull request from some time back. #55 Am I doing something wrong or has the file been deleted for some reason?

    opened by trothe 1
  • Problem in i2c.py opening multiple i2c busses

    Problem in i2c.py opening multiple i2c busses

    This issue was reported by @nikolozka in Issue #12.

    The issue is still in the code and I would like to submit a PR for it, however, I'm trying to understand the reasoning behind this.

    class Bus:
        instance = None
        MRAA_I2C = 0
    
        def __init__(self, bus=None):
           ... skipping code ...
    
           if not Bus.instance:
                Bus.instance = smbus.SMBus(bus)
    
          ... rest of code ...
    

    Why is instance being used as a class attribute? It effectively makes the Bus class a singleton class. Are there any advantages to doing this that I'm missing?

    To reproduce this problem:

    • Connect a Base Hat to the reTerminal.
    • Use an analog sensor such as the Grove Soil Humidity sensor with the ADC of the Base Hat.
    • Create a new I2C bus 4 for the reTerminal (using this example).
    • Connect an I2C sensor such as the AHT20 temperature & humidity sensor to the base hat.
    • Try to read from both sensors.
    File "/usr/local/lib/python3.7/dist-packages/grove/grove_temperature_humidity_aht20.py", line 44, in read
        self.bus.write_i2c_block_data(self.address, 0x00, [0xac, 0x33, 0x00])
    File "/usr/local/lib/python3.7/dist-packages/smbus2/smbus2.py", line 643, in write_i2c_block_data
        ioctl(self.fd, I2C_SMBUS, msg)
    OSError: [Errno 6] No such device or address
    
    opened by maujac 1
  • Interface Grove Ultrasonic Sensor without shield

    Interface Grove Ultrasonic Sensor without shield

    Hi, I am working on interfacing grove ultra sonic sensor v2.0 with my Jetson NX board. I dont have a base hat/shielf/I2C adapter. I want to interface the sensor directly with Jetson board.

    I started with looking into : https://wiki.seeedstudio.com/Grove-Ultrasonic_Ranger/ where they have mentioned "If we don't have Grove Base Shield, We also can directly connect Grove_Ultrasonic_Ranger to Seeeduino as below." But this example C library will not work since it uses arduino library.h.

    Then I started to work with code in this git: https://github.com/Seeed-Studio/grove.py/blob/master/grove/grove_ultrasonic_ranger.py Like I mentioned I dont have base shield so I replaced (pin number) with my GPIO pin and got the below error.

    Check whether I2C enabled and Grove Base Hat RPi or Grove Base Hat RPi Zero inserted

    So i had to remove the lines 98 to 100 and directly configure my pin number and try. It is just printing "Detecting distance.." and nothing else.

    It would be really helpful to get some inputs on this.

    Regards Niranjan

    opened by niranjanravilevelup 0
Owner
Seeed Studio
Seeed Studio
A modern Python client for controlling Wyze devices.

Python Wyze SDK A modern Python client for controlling Wyze devices. Whether you're building a custom app, or integrating into a third-party service l

Shaun Tarves 205 Jan 2, 2023
A Python SDK for connecting devices to Microsoft Azure IoT services

V2 - We are now GA! This repository contains code for the Azure IoT SDKs for Python. This enables python developers to easily create IoT device soluti

Microsoft Azure 381 Dec 30, 2022
Python lib to control HottoH based stove devices

Project desciption This library can be used to discuss with HootoH based stove devices Actually tested and validated with a CMG Drum stove. To use thi

null 3 May 16, 2022
Python client and API for monitoring and controling energy diversion devices from MyEnergi

Python client and API for monitoring and controling energy diversion devices from MyEnergi A set of library functions and objects for interfacing with

null 1 Dec 17, 2021
A minimalist file manager for those who want to use Linux mobile devices.

Portfolio A minimalist file manager for those who want to use Linux mobile devices. Usage Tap to activate and press to select, to browse, open, copy,

Martin Abente Lahaye 71 Nov 18, 2022
A Discord bot that automatically saves SHSH blobs for all of your iOS devices.

AutoTSS AutoTSS is a Discord bot that automatically saves SHSH blobs for all of your iOS devices. Want a CLI automatic blob saver? Check out AutoTSS-c

adam 79 Dec 13, 2022
Home Assistant custom integration for controlling Powered by Tuya (PBT) devices using Tuya Open API, officially maintained by the Tuya Developer Team.

Tuya Home Assistant Integration Home Assistant custom integration for controlling Powered by Tuya (PBT) devices using Tuya Open API, officially mainta

Tuya 704 Jan 3, 2023
AutomaTik is an automation system for MikroTik devices with simplicity and security in mind.

AutomaTik Installation AutomaTik is an automation system for MikroTik devices with simplicity and security in mind. Winbox is the main tool for MikroT

Osman Kazdal 4 Dec 5, 2022
Collection of script to manage WLED devices

Collection of script to manage WLED devices

Daniel Poelzleithner 4 Sep 26, 2022
Monitoring plugin for MikroTik devices

check_routeros - Monitoring MikroTik devices This is a monitoring plugin for Icinga, Nagios and other compatible monitoring solutions to check MikroTi

DinoTools 6 Dec 24, 2022
Pixoo-Awesome is a tool to get more out of your Pixoo Devices.

Pixoo-Awesome is a tool to get more out of your Pixoo Devices. It uses the Pixoo-Client to connect to your Pixoo devices and send data to them. I targ

Horo 10 Oct 27, 2022
Aio-binance-library - Async library for connecting to the Binance API on Python

aio-binance-library Async library for connecting to the Binance API on Python Th

GRinvest 10 Nov 21, 2022
alpaca-trade-api-python is a python library for the Alpaca Commission Free Trading API.

alpaca-trade-api-python is a python library for the Alpaca Commission Free Trading API. It allows rapid trading algo development easily, with support for both REST and streaming data interfaces

Alpaca 1.5k Jan 9, 2023
🐍 The official Python client library for Google's discovery based APIs.

Google API Client This is the Python client library for Google's discovery based APIs. To get started, please see the docs folder. These client librar

Google APIs 6.2k Jan 8, 2023
Python bindings for ArrayFire: A general purpose GPU library.

ArrayFire Python Bindings ArrayFire is a high performance library for parallel computing with an easy-to-use API. It enables users to write scientific

ArrayFire 402 Dec 20, 2022
Balanced API library in python.

Balanced Online Marketplace Payments v1.x requires Balanced API 1.1. Use v0.x for Balanced API 1.0. Installation pip install balanced Usage View Bala

Balanced 70 Oct 4, 2022
python library to the bitly api

bitly API python library Installation pip install bitly_api Run tests Your username is the lowercase name shown when you login to bitly, your access

Bitly 245 Aug 14, 2022
Braintree Python library

Braintree Python library The Braintree Python library provides integration access to the Braintree Gateway. TLS 1.2 required The Payment Card Industry

Braintree 230 Dec 18, 2022
A Python library for the Buildkite API

PyBuildkite A Python library and client for the Buildkite API. Usage To get the package, execute: pip install pybuildkite Then set up an instance of

Peter Yasi 29 Nov 30, 2022