I’d like to attach 18 or more GPIO panels 1-3meter away from Raspberry 4, so I will need 2-3 USB>I2C adapters. (All together I need 128 I/O ports or more for my house.)
Is there any recommendation what USB adapter board should I buy to get more I2C buses?
What IC of that is OpenHABian will be compatible with?
Thanks for any recommendation!
I’ve already bought lots of I2C boards:
-8x 8IO and
-2x of 16IO
They were cheap and directly available from stock at Hungary. (Sadly I don’t have time to wait 3 weeks for a shipment from China… my smarthome system died by a lightning and I can not control ANYthing in my house now )
Currently I need a quick solution to screw everything together within 1-2 meter distance.
(My Pi4 is in the room near the ceiling to keep it in 25C enviroment, but all the cables are at the attick above.)
…
Later, I’d like to enhance the system with 1-Wire temp sensors, and maybe other things…
…
RS485 seems to be a really good choice, but did not find too much special sensors yet other than I2C.
(IR, movement, NFC, nearing, …)
Thank you very much for the links!
I’ve found those too yesterday, but didn’t believe it would be stable / possible to do this way…
I’ve digged into it a bit more, and found 2 problems with this solution:
There are no ATTiny45 boards available any more, only ATTiny85 ones. (ca. 4$ inc. VAT)
it gives 5V output, instead of 3.3V !!!
… So I would also need a 5V>3.3V I2C conversion board from a shop which has this on stock. (Usually sold for 10$!)
I wonder why isn’t there any robust, “ready to use” = Plug&Play version of this in Europe at all?
I assume from the information you have given that you are using Mcp23017 and MCP23008 devices. These have 8 addresses that are usable, so you don’t need any external hardware to connect them.
I recommend you use some kind of buffer or level shifter for this. 1-3m of wire could draw high amounts of current and damage your Pi. Though you have already stated you don’t want to buy such things, but I have warned you.
There are 2 I2C buses on a Raspberry Pi, I2C0 is used for the HAT memory chip but can still be used by software. Just connect some to one bus and some to the other and make sure your addresses are set correctly.
You will need to pay special attention when making your cables. Bring only the SDA and SCL lines from the Pi, along with ground. Twist SDA and a ground wire together the whole length, and do the same with SCL with a different ground wire. You will need to connect the ground wires at the remote end as well. Use power at the remote end, don’t bring it from the Pi.
Thank you for all those tips, but I think you have misunderstood me. Such things are exactly what I would like to avoid!
What I meant is, that I’d like to use a SAFE, nearly “industrial solution”:
No tiny wires, twisted and soldered
No direct Pi4<>GPIO pins
etc…
but a simple USB cable with a Plug&Play adapter at the end with standard 3.3V output to plug all those board one after the other. (To connect to Opto-couplers.)
This way, If something goes wrong, (like an other lightning,) I could simply unplug the device, and replace it in 5 seconds. (Instead of 3 weeks.)
Something like this one: (Click link).
if I would get confirmation that such a device would work out of the box without special Firmware flashing or wiring or any other complication.
Now I understand the goal. The board you like will work if you write some software for it. You might look at my MQTTany software, you could write a module for USB-I2C devices like this. I can assist, or write it if I have time.
Maybe this product would still be something for you. Also recognized as an I2c device under linux and the voltage can be set. https://www.fischl.de/i2c-mp-usb/
Many thanks you looked for it!
Currently I’m waiting for delivery for 3 Digispark USB panels based on ATTiny85 chip.
They are really cheap ($4). link…
So I will try to flash that firmware you have suggested earlier.
I’ve convinced myself, that a bit of soldering and flashing is not the end of the word…
Thank you! This is the first piece of software I’ve shared so I’m still learning, but I wanted to do it right.
It is not a binding, and not meant to be. It started as a small script to allow me to read and control GPIO pins on a Pi that was not running openHAB and has grown from there.
Probably not much. The code already exists for the MCP230xx chips so I would just need to copy that and change the parts that actually communicate with the chip.
I can do it no problem, but as for payment your help in testing the code will be enough. I probably won’t have time to do it until next weekend though.
I’m not sure why the program wasn’t found, I thought it came pre installed in raspbian. Google would be the best place to find installation instructions for it.
Relatively speaking, yes. What you describe will not be possible. MQTT is not real-time like you need for that, but then again neither is openHAB.
That sound very bad! Obviously that would be the most important thing to accomplish.
Everything else is just “extra”.
Do you know about any “real scenarios”, how much delay it takes to handle long-dimming?
sudo apt install i2c-tools
The answer to your next questions is no, OH is not a real-time system. To handle long, short, double clicks etc. you may use microcontrollers or PLC.