{"id":26800,"library":"binho-host-adapter","title":"Binho Host Adapter","description":"Python library for controlling Binho multi-protocol USB host adapters (I2C, SPI, UART, GPIO, etc.). Current version 0.1.6. Release cadence: sporadic.","status":"active","version":"0.1.6","language":"python","source_language":"en","source_url":"https://github.com/BinhoIO/binho-host-adapter","tags":["binho","adapter","i2c","spi","uart","gpio","usb"],"install":[{"cmd":"pip install binho-host-adapter","lang":"bash","label":"Standard install"}],"dependencies":[{"reason":"USB/serial communication with the adapter","package":"pyserial","optional":false},{"reason":"HID communication for some adapter models","package":"hidapi","optional":true}],"imports":[{"note":"Direct attribute access on module may fail; always import the class.","wrong":"import binho; adapter = binho.BinhoHostAdapter()","symbol":"BinhoHostAdapter","correct":"from binho import BinhoHostAdapter"},{"note":"Constants are in a submodule, not top-level.","wrong":"from binho import BINHO_I2C","symbol":"BINHO_I2C","correct":"from binho.defines import BINHO_I2C"}],"quickstart":{"code":"from binho import BinhoHostAdapter\nfrom binho.defines import BINHO_I2C\n\nadapter = BinhoHostAdapter()\nadapter.open()\nadapter.setOperationMode(BINHO_I2C)\nadapter.i2c.setBitRate(400000)\nadapter.i2c.begin()\n# Write to device 0x50\nadapter.i2c.write(0x50, [0x00, 0x01])\n# Read 2 bytes\ndata = adapter.i2c.read(0x50, 2)\nprint(data)\nadapter.close()","lang":"python","description":"Initialize adapter, set I2C mode, write/read bytes."},"warnings":[{"fix":"Always call `adapter.open()` after instantiation.","message":"Adapter must be opened before any operation. Forgetting `adapter.open()` causes `AttributeError` or silent failures.","severity":"gotcha","affected_versions":"all"},{"fix":"Install FTDI VCP drivers from ftdichip.com.","message":"The library uses `pyserial` for serial communication. On Windows, missing or misconfigured serial drivers can cause `SerialException`. Ensure proper FTDI drivers are installed.","severity":"gotcha","affected_versions":"all"},{"fix":"Use the new I2C object methods: `adapter.i2c.write()`, `adapter.i2c.read()`.","message":"Older examples use `adapter.i2c_write()` method which was replaced by `adapter.i2c.write()`. The old method may be removed.","severity":"deprecated","affected_versions":"<0.1.6"}],"env_vars":null,"last_verified":"2026-04-27T00:00:00.000Z","next_check":"2026-07-26T00:00:00.000Z","problems":[{"fix":"Upgrade: `pip install --upgrade binho-host-adapter`.","cause":"Installed version too old (pre-0.1.0) or incomplete install.","error":"ImportError: cannot import name 'BinhoHostAdapter' from 'binho'"},{"fix":"Call `adapter.setOperationMode(BINHO_I2C)` before using `adapter.i2c`.","cause":"Adapter mode not set to I2C before accessing i2c sub-object.","error":"AttributeError: 'BinhoHostAdapter' object has no attribute 'i2c'"},{"fix":"Add user to dialout group: `sudo usermod -a -G dialout $USER && logout`.","cause":"User does not have permission to access the USB serial device.","error":"serial.serialutil.SerialException: could not open port /dev/ttyACM0: [Errno 13] Permission denied: '/dev/ttyACM0'"}],"ecosystem":"pypi","meta_description":null,"install_score":null,"install_tag":null,"quickstart_score":null,"quickstart_tag":null}