Skip to content

read_i2c_block_data() needs updating for CircuitPython 6 - "extra keyword arguments given" error #1

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
kevinjwalters opened this issue Dec 9, 2020 · 4 comments

Comments

@kevinjwalters
Copy link

The combined plotted program spits this on CircuitPython 6.0.0 on a Feather nRF52840 Express with Enviro+ FeatherWing attached but no PMS5003:

PMS5003 Read Timeout: Failed to read start of frame byte
You probably don't have a pms5003 connected, continuing without particulate logging
Traceback (most recent call last):
  File "code.py", line 60, in <module>
  File "lib/pimoroni_ltr559/__init__.py", line 218, in __init__
  File "lib/i2cdevice/__init__.py", line 230, in get
  File "lib/i2cdevice/__init__.py", line 183, in read_register
  File "lib/i2cdevice/__init__.py", line 288, in _i2c_read
  File "lib/pimoroni_circuitpython_adapter/__init__.py", line 46, in read_i2c_block_data
  File "lib/pimoroni_circuitpython_adapter/__init__.py", line 40, in read_i2c_block_data
TypeError: extra keyword arguments given

This is due to the removal of the stop kwarg from I2C.writeto() in CircuitPython 6.0.0 (see adafruit/circuitpython#2082 for details).

The documentation for this on 6.0.x is currently incorrect. I confirmed that with @dhalbert.

@dglaude
Copy link

dglaude commented Dec 9, 2020

If you want to avoid this problem on your Enviro+, you may want to use this library for your LTR559:
https://github.com/pimoroni/Pimoroni_CircuitPython_LTR559/

There is a bit of discussion on the evolution of Pimoroni libraries to be a better CP citizen:

(It does not fix the problem with this library, but it might be the way to go)

kevinjwalters pushed a commit to kevinjwalters/circuitpython_adapter that referenced this issue Dec 9, 2020
…to_then_readfrom() to make this work with CircuitPython 6.x (and 5.3.x) pimoroni#1
@kevinjwalters
Copy link
Author

Thanks, I'll have a look. I just put PR #2 in which I think fixes all of this.

@kevinjwalters
Copy link
Author

Fixed with #2

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants