Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
I2C io interface
#11
Hi Gerard,

It seems like a separate page for the test results might be best depending on the amount of screen space it needs.

So far it looks like you have a pretty good grasp of the plugin structure. I don't think there is a wrong choice as long as things don't get too crowded.

Dan
<p><br></p>
Reply
#12
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.  Tongue

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
Reply
#13
Hi Dan,

The first beta is available here on my GitLab. 
There is still some work to do on error handling and removing unnecessary debug info.
Also the 16bit implementation is not done yet so the current code "only" supports 64 stations.
Documentation I will try to work on the coming weeks but being mainly offline that may take some time.

If you are interested and have a few spare minutes I would like to know your professional opinion on the "hobby-coding" I did so far.

--Gerard
Reply
#14
Hi Gerard,

I have cloned your beta and taken a quick look at the web pages. Looks good so far.

One thing I would suggest is to keep in mind that many SIP users are not necessarily electronics tinkerers. They may be small farmers looking for a low cost way to automate irrigation or home owners who want to save water while maintaining a healthy garden. I usually try to keep documentation geared toward someone who may be a novice at DIY projects.

I will look a the code in the next few days.
Your plugin has the potential to be a very useful one, especially because it makes adding a large number of stations easy and very low cost if someone is using one of the I2C boards on the market. This would be especially useful for the small farmer type user.

Have a safe trip. Looking forward a completed plugin.

Dan
<p><br></p>
Reply
#15
Hi Dan,

Good point about the users. I will make the docs easy enough that almost anyone can setup the system. In fact this is, next to my own wishes, also the reason why I thought about this type of module and plugin. For non electronic tinkerers as you call them (us) the shift register setup on a breadboard is too complex and very difficult to create a reliable system.

Next to the users you mention, I was thinking of (home) greenhouses where the stations can not only drive water valves but also periodically add nutrition's or other fluids. For our house I want to (almost individually) water the inhouse plants with very small valves and tubes. So having many stations would be very helpful as well. Multiple masters would also be necessary but that's another topic... along with a lot of other ideas.

--Gerard
Reply
#16
Hi Dan,

From a sunny place Cool I started with some documentation. I'm not that familiar with the SIP audience so may be you can have a look if the doc is going the right way. It is not complete yet, some items are stil missing.

For the time being the doc is placed at my Gitlab 

No hurry but when you have a minute it would be great to hear your opinion.

--Gerard
Reply
#17
Hi Gerard,

Your documentation looks good so far.

The audience of SIP users is quite broad. About the only thing they have in common is that they are people who are building some sort of irrigation related system. Some are knowledgeable about electronics or software development but some are building a system out of necessity and may have limited technical knowledge and perhaps limited English skills.

I try to keep documentation as self explanatory and simple as possible. One strategy I have used is to first list the steps of what needs to be done and then go into detail for each step. That way an experienced user can get a quick grasp of the procedures and a novice will have as much information as they might need. No one has ever complained about the documentation being overly simplified.

I want to thank you for the work you are doing on this project. It is the sort of thing that will make using SIP quicker, easier less expensive, and simpler for many users around the world.

Dan
<p><br></p>
Reply
#18
Hi Dan,

For now I have updated some parts of the documentation but once I'm back in the country I will rearrange some topics and add a more logical sequence of readable parts. I know less is better but I'm also afraid of leaving out a tiny detail that might dissapoint the user or create magic smoke.
Hopefully in time there will be some (beta)testers willing to share their experience with this plugin.

--Gerard
Reply
#19
Hi Dan,

The plugin is working for some time now. I have tested it on multiple Pi's and haven't had any serious issues.
It would be great if more users are willing to test the plugin but for now I assume it either has to be included in the plugin repo or the user should do a manual install.
May be it should be another feature request but I was wandering how difficult it is to add custom repo's to the main program, or make a plugin to install custom plugin's :-)  In that case it would be possible to add beta-plugins a bit easier. I'm sure you also will have some thoughts about this.

For now, what steps could we take to offer this (beta) plugin to the broader audience? 

--Gerard
Reply
#20
Hi Gerard,

Thank you for your work on this.

Due to the open source nature of SIP and the plugins I consider it to always be in a sort of beta test. If a user finds a bug they will usually report it here or raise an issue on GhiHub.

I think we could just add your plugin to the SIP plugins repository and announce it here and on the SIP GitHub repository in the Discussions section:
https://github.com/Dan-in-CA/SIP/discussions

I would also like to add a reference to your plugin on the SIP documentation wiki if that is OK with you.

I have cloned your plugin to my test Pi and will do some testing and then see about posting it to the plugin repo on GitHub.

One thing that might be helpful for users might be to rename the plugin to something a bit more descriptive of what it does such as i2c_port_expander. The chip name is kind of obscure to someone like me who is not as familiar with electronic components as you are.

As far as adding custom plugin repositories to SIP, I think that is possible. It would require some changes to SIP's plugin manager which is itself a plugin.

Dan
<p><br></p>
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)