Compatible USB>I2C adapter for RPi4

No, sorry. At summer time, when outside is 38°C > at the attick is 60°C+
At my air-conditioned room is max 26°C.
I’m using passive cooling.

… anyway I still don’t understand why it does matter at all? The USB>I2C adapter is running at 12000Hz, converting IO signals very fast.
Or is the problem that your MQTT can not handle any other I2C bus number only #1 ?

Your math doesn’t work. USB adapter running at 12khz means 1.5ms per bit. If there is no overhead that means 27ms per PCF8574 (start bit + read bit + 7 bit address + 8 bit response + stop bit = 18 bits). 27ms x 16 devices (8 IO x16 = 128) gives us 432ms. That gives us 2.32Hz best possible refresh rate. With the non-real-time nature of Linux and possible overhead of the USB-I2C adapters I doubt it would be possible to refresh all ports are 500ms interval.

However, if we let the PCF8574s watch for the pin to change and tell us when one of its 8 pins changes via the interrupt pin, we only have to poll that device to determine which pin changed. The interrupt pins could still be brought to the Pi if we isolate and possibly boost the signal.

MQTTany can control sACN, do your dimmers support that? If so you could offload control to MQTTany and that solves the delay problem on the openHAB side (I would have to write some code to link the lights to the buttons, but it’s possible) you could then still have openHAB send commands to MQTTany to control the lights.

It can handle any port, it’s just a setting you specify in the config.

1 Like

Mate, you are great guy! Really!!
I can not thank you enough for all the time you have invested into this already.

NOW I understand the problem.

Thank you. I enjoy puzzles.

So do your dimmers support sACN?

Do you have the PCF8574s on boards, or are you making your own? If they are already on boards, please attach a picture.

What will be powering the PCF8574s and at what voltage?

Sadly Eth-Dimmer adapter does NOT support sACN :frowning:
But dimmered light turn on/off a bit slower anyway, so it’s not a problem, if OH is controlling it.

I’ve bought them as “ready to plug in” :slight_smile: Don’t really like to solder much.
They will be powered with 5V.
pcf8574-io-expansion-board

Maybe I’ll add ArtNet support then, I had considered it in the past.

OpenHAB is too slow for controlling the dimmers and doing a smooth fade while the button is held. We need feedback on the current light level, but we also want to change it at a faster frame rate than openHAB can report the new state back to us.

Also how are you isolating the Pi from the PCF8574s? Are you planning on using opto-couplers on the I2C connections from the USB/I2C?

No need to rush ahead!
Please give me a few days first :wink:

About speed:
Stefan said response time was ok even with wireless buttons.
I will try that first, so we may compare it later.

About opto isolation:
see post #37

(Bad) News about the project:

Using those AtTiny85 adapters as USB>I2C base was a VERY BAD IDEA :frowning:

  1. It was extremely difficult to Flash them (Until I’ve found THIS Forked “WinUSB driver compatible” micronucleous EXE)
  2. Had to solder those pins/wire myself >> caused shortcut first, was hard to remove the tin.
  3. Using multiple pieces having same serial + name turned out to get random I2C bus address!
  4. And the “final blade” was to find out:

There is a HUGE ERROR known since 2019 dec. in the Firmware: after RPi reboot > it always STOPS working. Only manual unplug / replug helps! :frowning:

My next trial will be:
Using an Arduino NANO! As it turns out:

  • It has an USB port,
  • already an I2C pinout (A4+A5)
  • +14 I/O port !!!
  • very well documented user manuals, examples, videos, etc.
  • … and other extras I might be able to use too, like analog inputs, RS232 …

And the best part: it costs only $5 / $8 (depending on the CH340 / FT232 subtype).
So basically it is CHEAPER, than buying separately an I2C adapter + an extension board!

Also it’s possible to attach an Ethernet shield on top for only $5.
(So no more “max 5 meters” limit…)

By Monday I should have the first 2 pieces delivered.

Wouldn’t you be able to assign a permanent alias to the USB device? I know it’s possible but maybe not with the same model of device.

Do you have firmware for the arduino? It won’t come programmed.

Not if the SAME serial number is being flashed to ALL those devices. If they differ, here is a howto…

No, nothing yet, but as I see, there are LOT’S of examples and nearly “ready-to-use” github codes.
Also I can make firmwares to it myself, because it can be uploaded with Mikropascal codes too, not just C.
(I hate C, but love Pascal :blush: )

Well hang on now, I just had a look at the firmware you flashed. VSCode could probably flash that via platformio and you could change the product ID to suit your needs.

Don’t worry about that, I’ve dropped AtTiny85 boards completely.
You have maybe missed my 4. bad news:

  • They FREEZE = HALT = DO NOT START after each reboot

So they are useless. Not worth working on them 1 minute longer, because Arduino NANO-s are a much better choice!