Greetings everyone! I have very similar error as @sqbaczek when running 1 ToF4M via PaHUB2 with CoreS3 and also Cardputer on UIflow 2.0. The ToF4M works fine when directly connected to the I2C port of either CoreS3 or Cardputer. It appears that ToF4M cannot be initiated when connected via PaHUB2 on UIflow 2.0.
Below is the error I get with CoreS3 when on UIflow 2.0:
Traceback (most recent call last): File "<stdin>", line 24, in <module> File "<stdin>", line 17, in setup File "driver/vl53l1x.py", line 60, in __init__ File "driver/vl53l1x.py", line 176, in get_model_info File "driver/vl53l1x.py", line 273, in _read_register TypeError: unexpected keyword argument 'addrsize'Below is my code on UIflow 2.0:
import os, sys, io import M5 from M5 import * from hardware import * from unit import TOF4MUnit from unit import PAHUBUnit label0 = None i2c0 = None pahub_0 = None tof4m_0 = None def setup(): global label0, i2c0, pahub_0, tof4m_0 M5.begin() Widgets.fillScreen(0x222222) label0 = Widgets.Label("label0", 0, 0, 1.0, 0xffffff, 0x222222, Widgets.FONTS.DejaVu18) i2c0 = I2C(0, scl=Pin(1), sda=Pin(2), freq=100000) tof4m_0 = TOF4MUnit(PAHUBUnit(i2c=i2c0, channel=0), 0x29) def loop(): global label0, i2c0, pahub_0, tof4m_0 M5.update() label0.setText(str(tof4m_0.get_distance)) 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")I tested other units via PaHUB2 with CoreS3 on UIflow 2.0. These include Gesture Unit, 8Servos Unit, ENV Pro Unit, EXT.IO2 Unit. They all appear to work fine, at least not showing any initiation error.