Due to high demand, expect some shipping delays at this time - orders may not ship for up to 2-3 business days.
0

USB-To-I2C dongles
Moderators: adafruit_support_bill, adafruit

Please be positive and constructive with your questions and comments.

USB-To-I2C dongles

by ullix on Thu Jan 13, 2022 7:31 am

I got your FT232H Breakout - I call this a dongle - for use with my I2C devices, and I have to say, I am very disappointed!

The Stemma QT cabling seems to be a good choice, but my device failed with 3 different cables. The switch was "on". It would not even recognize the dongle, let alone any connected devices. After I soldered all headers to the board, and used it on a breadboard, it worked well.

Then I used Python 3.9 on my Ubuntu PC, and the PyFTDI lib, and tested this dongle with some I2C devices. It worked with all of them, except the Sensirion SCD30 (CO2, Temperature, Humidity) device. The FT232H would not even recognize the existence of this device, let alone get data from it.

With a total of 6 I2C devices on the bus, I scanned the bus. All other dongles, which I tested, correctly recognized all I2C devices and their addresses. The FT232H sometimes reported no devices connected, sometimes devices connected, which did not exist, and would never see the SCD30.

I then also tested the performance with the devices where FT232H worked: It came out some 20(!) times behind the best in terms of speed to deliver data, and those other dongles were over 10 years old!

I summarized my results in a review: "Review of USB-To-I2C Dongles as used by GeigerLog" downloadable from my Articles page: https://sourceforge.net/projects/geigerlog/files/Articles/

So, defects in the hardware and dismal software performance. Any ideas about what is going on?

ullix
 
Posts: 11
Joined: Thu Jan 13, 2022 7:00 am

Re: USB-To-I2C dongles

by danhalbert on Sat Jan 15, 2022 2:06 pm

Have you tried the https://www.adafruit.com/product/4471 (MCP2221?)

danhalbert
 
Posts: 3153
Joined: Tue Aug 08, 2017 12:37 pm

Re: USB-To-I2C dongles

by ullix on Sun Jan 16, 2022 5:10 am

Ooooh, look at this, another dongle! I wonder why this did not show up in my searches, so, thanks for pointing it out!

It sure has a bunch of attractive specs. What keeps me worried is, similar to the FT232H, that it needs a 41 page installation instruction, different for Linux, Windows and Mac! And I don't want Circuit Python, but continue with my own, plain vanilla, Python.

I checked with pyftdi to see whether they may support this chip (no answer yet); the two chips seem to have much in common.

For cross-platform applications you can't beat a USB-To-Serial connection, because this is supported everywhere without extra installations.

ullix
 
Posts: 11
Joined: Thu Jan 13, 2022 7:00 am

Re: USB-To-I2C dongles

by ullix on Fri Jan 28, 2022 6:09 am

I finally got the answer from the pyftdi lib folks and unfortunately this lib does not support the chip MCP2221.

Does pyftdi support the MCP2221 chips?

They also confirm the poor performance with the FT232H breakout board. Too bad.

Makes me keep using the USB-ISS dongle.

ullix
 
Posts: 11
Joined: Thu Jan 13, 2022 7:00 am

Re: USB-To-I2C dongles

by danhalbert on Fri Jan 28, 2022 10:24 am

If you are willing to not use pyftdi, you can use it on Linux like this: https://learn.adafruit.com/circuitpytho ... 2221/linux

danhalbert
 
Posts: 3153
Joined: Tue Aug 08, 2017 12:37 pm

Re: USB-To-I2C dongles

by ullix on Sat Jan 29, 2022 6:12 am

I am not bound to using the pyftdi lib, but it is the only one I know of. It is supporting FTDI chips only (and only a certain subset), and as the lib authors explained, it is so slow because all the bit-banging for I2C is done in traffic across the USB cable. Since the MCP2221 chip looks very similar, I expect the same bit-banging traffic would be needed, making this also a slow device, or not?

I also looked at CircuitPython, and I'm left more puzzled than ever. Why would I even need this given the characterization: "CircuitPython - a microprocessor specific implementation of Python written in C"? I intend to use a dongle to connect desktop with I2C device so that I can keep programming on my Python 3(.10), and don't need nor want an extra microprocessor.

Further I read: "CircuitPython is almost-completely compatible with Python." "almost-completely" - sorry, but this is Marketinglish for incompatible, and is a knock-out criterion.

Downloading the full pdf gave me 41 pages (!!) of installation instructions. Given that users of my Python software use Lin, Win, Mac, I need to request that everyone work their way through 41 pages to install this sub-feature? No way.

Why is this product released at all given that there are at least two dongles (USB-ISS, ELV, see review linked to in 1st post) which do not require any installation, are fully compatible with Python, and are vastly superior in speed?

And on top Adafruit delivers a product defect as described above with respect to cables and/or plugs.

ullix
 
Posts: 11
Joined: Thu Jan 13, 2022 7:00 am

Re: USB-To-I2C dongles

by danhalbert on Sat Jan 29, 2022 10:35 am

I am not bound to using the pyftdi lib, but it is the only one I know of. It is supporting FTDI chips only (and only a certain subset), and as the lib authors explained, it is so slow because all the bit-banging for I2C is done in traffic across the USB cable. Since the MCP2221 chip looks very similar, I expect the same bit-banging traffic would be needed, making this also a slow device, or not?

The link I gave above (https://learn.adafruit.com/circuitpytho ... 2221/linux) shows how to use it with `hidapi`. You need to install a few extra packages to get hidapi to work. pyftdi is not required.

I also looked at CircuitPython, and I'm left more puzzled than ever. Why would I even need this given the characterization: "CircuitPython - a microprocessor specific implementation of Python written in C"? I intend to use a dongle to connect desktop with I2C device so that I can keep programming on my Python 3(.10), and don't need nor want an extra microprocessor.

CircuitPython (a friendly fork of MicroPython) is meant to run on microcontrollers. It is a completely different implementation of Python than CPython, the standard desktop Python. It has its own native modules for supporting GPIO, I2C, etc. on various microcontrollers.

We have several hundred CircuitPython-based libraries that support a wide variety external peripherals, displays, controllers, etc. To enable these libraries to be used with CPython, we wrote a wrapper layer called "Blinka" (adafruit-blinka) so that you can run CircuitPython programs (not CircuitPython itself) on host computers. For Raspberry Pi and other single-board Linux computers with controllable pins, you don't need anything further. For host computers like a Windows or Linux PC, pins aren't available, so we developed ways of supporting MCP2221 and other such USB-to-hw adapters.

That way you can use all our libraries, instead of using dongle-specific libraries or having to write your own dongle-compatible library to support some peripheral. The libraries are available via PyPi (https://pypi.org/search/?q=adafruit-circuitpython).

This idea is explained here: https://learn.adafruit.com/circuitpytho ... rypi-linux and in various similar guides.

If you aren't interested in reusing our libraries, but intend to write your own, then you may be less interested in Blinka and how we support the USB dongles. Nevertheless, we felt that many people would want to leverage what's already written.

danhalbert
 
Posts: 3153
Joined: Tue Aug 08, 2017 12:37 pm

Re: USB-To-I2C dongles

by ullix on Sun Jan 30, 2022 5:01 am

Thanks for this much better explanation!

ullix
 
Posts: 11
Joined: Thu Jan 13, 2022 7:00 am

Please be positive and constructive with your questions and comments.