Hi Dan,
After some time struggling with multiple template pages I had only limited success so for now the tooling is on the same page. Well, the word tooling is a bit overdone. It only can scan the i2c bus for devices and it can send a byte to an i2c address for easy testing the hardware.
The basic version of the plugin works. I have tested it with 2 semi homemade modules but more testing has to be done. Although configurable, the pcf8575 (16 bit module), is not implemented yet. In the code I have chosen to first build a list of bytes, one byte for every 8 stations and once completed send the bytes to the modules. So implementing the 16 bit module shouldn't be too difficult from here. I already did some basic test with sending 16 bits to a module using
bus.write_byte_data but I've seen a little different behavior on the i2c lines than using
bus.write_byte for sending 8 bits. For that I have to hook-up the scope and see what's going on. Also I have to order some more 8 and 16 bit modules to simulate larger setups.
The power consumption is fine when using 5v from the Pi. It should be able to support 64 or even 128 optocouplers. For safety my setup uses a level-shifter to connect the 3.3v data lines from the Pi to the 5v i2c modules. Although it is advisable to do reading the datasheet the pcf857x pulls SDA low when sending data back to the Pi so it should be safe to connect the module(s) directly to the Pi. However the datasheet also tells that a high signal must be at least 0.7xVcc, so 3,5v. Since the Pi is 3.3v it might not drive the maximum number of boards when using a bit long i2c data lines. When I have more boards I will do some more testing on this.
During September I'm out of the country and have limited online time but will try to spend some time on documentation. Hopefully in October I can have a first more or less stable version of the plugin available for a larger public (if someone is interested anyway). By that time may be you can have a look at the code. Since I'm not a programmer by profession I'm most likely to have twice the amount of code you would have made.
So, a bit of a long story but since I'm away for some time after next week I would give you this update.
Gerard