[Solved]M5StickC I2C bus error
-
While using the M5StickC with the ENV "environment sensor" connected I receive the following error when running the ENV sample UICode program (https://github.com/m5stack/M5-ProductExampleCodes/tree/master/Unit/ENV/UIFlo):
>>> env0 = units.ENV(units.PORTA)
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
File "m5flow/units.py", line 83, in init
File "lib/bmp280.py", line 147, in init
OSError: I2C bus error (6)I tried a second ENV sensor and received the same error. Any suggestions would be appreciated.
-

check if the grove port is in proper contact :)
-
Thanks for the response. I replaced the grove cable with another grove cable and made sure it was fully seated and still got an error.
>>> import units
>>> a = units.E
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
AttributeError: 'module' object has no attribute 'E'>>> a = units.ENV(units.P)
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
AttributeError: 'module' object has no attribute 'P'>>> a = units.ENV(units.PORTA)
>>>Tried this as well:
>>> from machine import I2C
>>> i2c = I2C(freq=400000, sda=21, scl=22)
>>> Traceback (most recent call last):
File "boot.py", line 29, in reboot
File "m5flow/hardware/axp192.py", line 96, in btnState
File "m5flow/hardware/axp192.py", line 103, in _regChar
OSError: I2C bus error (6)>>> i2c.scan()
[52, 81, 108]
>>> Traceback (most recent call last):
File "boot.py", line 29, in reboot
File "m5flow/hardware/axp192.py", line 96, in btnState
File "m5flow/hardware/axp192.py", line 103, in _regChar
OSError: I2C bus error (6) -

It mean env init well, you can try a.temperature() and a.pressure() and a.humidity() to get msg -
StickC grove IIC not 21, 22, it`s 32, 33
Hello! It looks like you're interested in this conversation, but you don't have an account yet.
Getting fed up of having to scroll through the same posts each visit? When you register for an account, you'll always come back to exactly where you were before, and choose to be notified of new replies (either via email, or push notification). You'll also be able to save bookmarks and upvote posts to show your appreciation to other community members.
With your input, this post could be even better 💗
Register Login