Hello,
I did not succeed to make my ENV IV unit working with Firmware V2.0.8.
Same issue with a M5Dial and a M5StickC
The code (for StickC)
import os, sys, io
import M5
from M5 import *
from hardware import *
from unit import ENVUnit
label0 = None
i2c0 = None
env4_0 = None
def setup():
global label0, i2c0, env4_0
M5.begin()
label0 = Widgets.Label("label0", 4, 26, 1.0, 0xffffff, 0x222222, Widgets.FONTS.DejaVu18)
i2c0 = I2C(0, scl=Pin(33), sda=Pin(32), freq=100000)
print(i2c0.scan())
env4_0 = ENVUnit(i2c=i2c0, type=4)
label0.setText(str(env4_0.read_temperature()))
def loop():
global label0, i2c0, env4_0
M5.update()
if __name__ == '__main__':
try:
setup()
while True:
loop()
except (Exception, KeyboardInterrupt) as e:
try:
from utility import print_error_msg
print_error_msg(e)
except ImportError:
print("please update to latest firmware")
The output :
[68, 118]
Traceback (most recent call last):
File "<stdin>", line 22, in <module>
File "<stdin>", line 15, in setup
File "unit/env.py", line 1, in init
File "driver/bmp280.py", line 113, in init
ValueError: device not found
However, the 2 sensors are well detected during the I2C scan ( 68 is the SHT40, 118 is the BMP280).
With Firmware V2.0.7, no issue for both devices.