Given symptoms seen, I do not know whether to call it a restriction or a bug.
## Current Behaviour Four parts each with 2 pins one pair male and one pair fâŠ
Given symptoms seen, I do not know whether to call it a restriction or a bug.
I am not sure what is the exact problem with the buses. Is there an open bug in Github?
The advantage of combining all the GND and power pins in the schematic view is that we can reuse the symbol for other physical packages. However, in the current implementation, the svg of the schematic still needs individual connectors. For example, the GND has three connectors (6, 8, and 18). Thus, the symbols are not reusable.
I would prefer to show all of them in the schematic symbol. I think it would be less confusing to newbies. Additionally, there could be cases where the designer wants to not connect all together. For example, sometimes you want to generate different grounds for the analog and digital circuits or add filters to some power supply pins. And finally, depending on where you are with the mouse when hovering over the GND connector, you see different info, see below:
Finally, I would remove the different numbers of the GND or other connections in the name (I am not sure if this is possible). It feels strange to have names as GND6 or GND8. I would call all of them GND. In any case, I am not sure if we should start counting the connectors in 1 and not in 0. It seems weird that the name does not match the pin number, see below:
It is a problem with inhibit not working correctly (I donât think it works at all in fact) in schematic. If inhibit let you suppress pins then the buses would connect to the correct place of a single pin (from multiple pins in other views). I donât know if there is an issue open on github or not.
I think this is a much more complex change and perhaps not possible. Even if inhibit worked, the pins would need to be in the fzp and in the bus (just inhibited in schematic) for this to work. The pin numbers of the part you want to share the schematic with would need to match the current part in the fzp, breadboard and pcb views (and in the pins showing in schematic as well) which I donât think will usually be practical.
That can be done, but as noted has the disadvantage that if you have a connection to another pin on the same net it wonât connect (although right now I canât reproduce the issue, as I donât think this should work!)
The second connection to ground should refuse to connect (I have seen it do so before but donât remember what part it was!) as there is already a connection to that net and it wonât create a second one. Not sure what Iâm missing here perhaps @microMerlin will know.
The reason for the pin numbers (which can be fixed by using the pin number rather than the connector number) is that the name field in the fzp file should be unique (so a name of GND should not be repeated in the name field in the same fzp file.) The reason was said to be that the code will use the name field to try and differentiate a part or perhaps it is this (from the parts file format file)
"But sometimes the replacement connector does not have the same id. In this case you can use the replacedby attribute on the obsolete connector, with the value being either the id or name of the replacement connector. Here is an example using the name:
<connector id='connector15' name='D0RX' type='female' replacedby='RX/D0'>"
the parts file format document used to say something to the effect âthe name should be uniqueâ but it looks like that has been removed in an update. I expect the code will screw up on the above replacedby if the name is not unique in the fzp file and that may have been the reason for the original warning. FritzingCheckPart.py will (if you enable the option which I do) issue a warning for duplicate name values and I usually try and avoid them. As noted the easy way out in this case is use the real world pin number starting at pin1 which is what I usually do. I can change this one to use that convention too.
Peter
The symptom (at least one case) is that with some (all but one) connectors of a bus suppressed (inhibited) in schematic, a wire on breadboard view to one of the inhibited connector pins would not show up as a ratsnest in schematic. The final connector on the bus should be âequivalentâ in schematic, and the ratsnest should go there. I donât know if that is in a bug report either, but it is probably not tagged as a bus problem. It is inhibit that is broken.
Iâve only seen the ârefuseâ case. Not the apparently working case you show.
For some of the rest, it looks like there might be some overlap in the wording used which mixes together the connector id, name, and description. I think all of the common (bussed) ground connectors can have âGNDâ as the description. As noted in some versions of the documentation, duplicate name values might be a problem, especially if the name is used for replacedby references. I think I posted a question about that awhile ago. I did not get a definitive answer about how it actually works, and did not do the research needed to either test several cases, or find the references in the code base that needed unique values for reliable operation.
My bad for not including the sketch. The grounds are all bused and I donât think the second ground connection to the header should work.
schematic-test.fzz (27.6 KB)
Peter
That part and sketch seem to work as they should with my various test sequences. I may need to try some of my previous cases as well for hybrid connectors. Here is my bug report (though it was never tagged as a bug) from a couple years ago around most of this. With multiple follow up scenarios and test cases. Maybe a version update has fixed this.
Here are my own notes about a possible solution:
WIth that, the functionality seems to be the same as not using hybrid, making all of the bussed connectors except one invisible, and stacking them all on top of each other in schematic view. There is still some oddities about what information hover will display for the visible pin.
I do not think an issue with this sketch.
Maybe this has been fixed? Have you tried to reproduce it in an old version?
I guess that this is not the feature that only allows one connection between two connectors. You cannot duplicate traces between connectors already connected by a direct trace. I do not think this should be an issue for multiple connectors bussed together.
It seems that this is mostly a documentation issue.
If there is only a non-hybrid connector and the rest are hybrid connectors, I made a fix not to show the information of the hybrid connectors. In any case, this still has some weakness as it will show the info of just one connector instead of listing all the pin numbers in that bus. For example, it the example of the VNH2SP30 before, it will show just âGND6:Ground (7)â when it is actually representing all the GND connections in pins 7, 9 and 19.
Of course, if there are several ânon-hybridâ connectors, the program will show one for them which could change depending on the position of the mouse, which is not good either.
I would definitely use the pin number, which is what the user sees. I think it makes it less confusing.
The rule that forces names to be unique is still in the Wiki:
âThe <description>
element and name attributes seem self-explanatory. But it is important to note that within a part, a connectorâs name and id attributes must be uniqueâthat is, no two connectors in a given part should have the same id or the same name .â
For me seems very strange that the name needs to be unique (from a philosophical point of view). If there is an id, the id needs to be unique but the name can be reused. It seems weird to have different names for pins that are in the same net. I would restrict the replacementBy to only use ids. But of course, we should explore that this does not cause issues other than when obsoleting. @KjellM , any input on this?
Yes, I missed that part of the wiki.
I believe (but havenât checked the code) that if a part has identical family variant and properties the code will eventually use the pin names to differentiate between two parts. In practice it is normally fine to duplicate names, nothing bad appears to happen in most cases, but that doesnât mean there isnât an edge case where it matters. I didnât know before that obsoleting could obsolete by pin name and that is likely another (or perhaps the only?) reason for no duplicate names. The original text used to say something to the effect of " names should be unique" leaving the impression it wasnât a hard rule, but if there are cases where the code depends on the name being unique then it should be enforced as unique.
Peter
It acts the same on 9.3b so it doesnât look like a fix, rather that I am doing something different. Unfortunately I donât remember which part I made where I saw this problem to try and reproduce it. I know I have a part somewhere where you can not make a connection to a pin that already has a connection in schematic I just donât remember which part that is. In any case here is a new version of the part with the name field replaced with pin numbers. The grounds are still common because they are bused. If the grounds donât all connect together internally (which I am assuming they do) then they should not be bused and indeed all the grounds should be on separate pins (which is a requirement for filters on the grounds or separate traces to avoid ground voltage drops to work anyway!) The problem is I donât have a board to see if the pins connect together internally or not. If you can verify if the various grounds are all or only some connected together internally Iâll change the part to match the board.
Dual_VNH2SP30_Motor_Driver.fzpz (8.8 KB)
edit: I found another issue while making a test sketch to try obsoleting. Here is the test sketch and images showing the issue.
Dual_VNH2SP30_Motor_Driver.fzz (11.5 KB)
breadboard (correct)
schematic (wires reversed, mis labeled)
pcb (correct)
I think it would be useful to have a real sketch that uses this part to test with as well as this contrived test case, does anyone have such a sketch that they could upload?
Peter
I found the open pr on this and the example in there is still broken. It is more complex than just two buses (which is what I didnât remember!), the fault looks to be between male and female connectors (which my example above doesnât have.) The details are here along with a .fzz file that breaks. It presumably wonât apply to this part as it doesnât have female connectors.
## Current Behaviour Four parts each with 2 pins one pair male and one pair fâŠ
edit:
The obsoleting appears to be a bust. It doesnât seem to work at all and I donât know why. I used the obsolete.py script and set replacedby items to change the pin numbers but it doesnât appear to work. The part in the parts bin appears to point to the obsoleted part not the new part, confirmed by starting a new sketch (which gets the obsoleted part rather than the new part.) Letting it update the obsolete part in the test sketch turns out badly (although it does seem to upgrade to the new part, just not correctly.)
and not much of the upgrade of the part appears to work. The bottom 5 connectors had rats nest lines and clicking on those is why the connections are green all the others are unconnected. The other two views are similar (breadboard being the worst.)
Iâll poke at it for a while longer, but I donât think there is much hope of getting it to work properly. This is a simplified version where the only change is the pin numbering (where pins start at 0 instead of 129) in the hope this would work, but it is as bad as the original attempt and I donât know why.
Peter
I found the open pr on this and the example in there is still broken. It is more complex than just two buses (which is what I didnât remember!), the fault looks to be between male and female connectors (which my example above doesnât have.) The details are here along with a .fzz file that breaks. It presumably wonât apply to this part as it doesnât have female connectors.
Thanks! I have analyzed the issue regarding the rejected connections and I was able to reproduce it with parts in the core too. I made another issue more focused on that: Part-to-part connections in BB causes connectivity issues in other views · Issue #3974 · fritzing/fritzing-app · GitHub
However, it seems fixable in the code and only happens in part-to-part connections (which are only allowed in the BB).
If the grounds donât all connect together internally (which I am assuming they do) then they should not be bused and indeed all the grounds should be on separate pins (which is a requirement for filters on the grounds or separate traces to avoid ground voltage drops to work anyway!) The problem is I donât have a board to see if the pins connect together internally or not. If you can verify if the various grounds are all or only some connected together internally Iâll change the part to match the board.
Unfortunately, I do not have any of them either (I have several versions of the L298 boards, but not of the VNH2SP30).
I think it would be useful to have a real sketch that uses this part to test with as well as this contrived test case, does anyone have such a sketch that they could upload?
I do not have any
The obsoleting appears to be a bust. It doesnât seem to work at all and I donât know why. I used the obsolete.py script and set replacedby items to change the pin numbers but it doesnât appear to work. The part in the parts bin appears to point to the obsoleted part not the new part, confirmed by starting a new sketch (which gets the obsoleted part rather than the new part.) Letting it update the obsolete part in the test sketch turns out badly (although it does seem to upgrade to the new part, just not correctly.)
I never used the replaceBy for pins. For parts works well.
The parts in the core bin need to be updated to use the new one. You need to change the file /fritzing-parts/bins/core.fzb
Right now, I do not have much time now to test/debug the obsoleting mechanism when replacing connectors.
edit:
Maybe we wait on improving all these parts and focus on developing the tools to do this work easily. E.g., improving the hybrid connectors, fixing the bug with part-to-part connections, and improving the code to obsolete the parts. Or at least, start with parts that do not need to replace connectors.
The parts in the core bin need to be updated to use the new one. You need to change the file /fritzing-parts/bins/core.fzb
I eventually discovered this by grepping for the moduleId in the parts repo. So far I used the same modelIndex and that seems to work but Iâm not sure it is correct. Its on my list of things to document (along with a number of changes to the obsolete.py script.) At the moment Iâm trying to figure out what breaks the obsolete, I have a part that basically the original part with the pin numbers changed that works and am about to try changing the svgâs scales to see if that is what causes the failure (if not Iâll keep making changes til it dies ) If anyone has the Pololu boards (which is no longer made by the way) it would be great to know if the grounds and battery connections are all connected together in the board, from the schematic on the Pololu site it certainly looks like it which means the current part is incorrect. There is a new board available (although it is listed as rationed) so perhaps a new version is in order. In any case Iâll keep poking at obsoleting to see what work needs to be done and documenting the process.
Peter
OK I have identified (and will report) the bug. It is changing a connector from female to male in the fzp file. Doing that causes this on upgrade:
in the obsoleted part all the pins are female, changing them to male causes the above on upgrade. A temporary workaround is to leave the pins as female (as it is relatively unimportant although desirable to fix inmy view!) Iâm thinking I may make a new part for the upgraded board that replaced this one as well since Iâm making changes anyway and maybe move a bunch more of the h bridge motor driver parts in to the same family (ignoring for now the question of whether a family should have the same number of pins to be swappable without problems which is still open!) At least I now know enough to create some documentation on obsoleting parts I think.
Peter
Hi @vanepp !
Finally, I pushed the L298N module to the fritzing parts repository, pull request: added L298N module (motor driver) from the forum by failiz · Pull Request #361 · fritzing/fritzing-parts · GitHub
Regarding the other one, I guess we will have to wait until there are clear guidelines (and scripts) for obsoleting parts. I saw your PR, but I guess that developers are busy trying to publish the next release. Hopefully, we will be able to fix and organize the parts soon.
It is easy enough to submit a pull request to change the female pins to male and once that is committed do the obsolete from the now male pins (which doesnât break) as Iâm not sure the male to female pin fix is going to be all that easy.
Peter
That 2 step sequence might make it through the process, but I suspect could break existing sketches. Any sketch with the problem part that does not get opened after the first commit will probably have the same problem currently identified when the ârealâ fix is done with step 2.
Good point! I hadnât thought of that one. I probably need to try it and see what happens first. Thanks!
edit: Yes as far as I can see that is a problem. So on to plan B. Make the changes except for the female pins (leave them female which wonât hurt anything) and make a pull request for the Dual VNH2SP30 Motor Driver. As that board is now obsolete I may make a new one for the current board (which wonât have obsoleting problems) as well.
Edit2:
Here is the promised new part for the replacement for the Dual_VNH2SP30_Motor_Driver (fighting bugs in obsoleting got old so I decided to make a part which i am usually successful at )
Dual_VNH5019_motor_driver.fzpz (22.4 KB)
and here is a new version (with some more bug fixes!) of the Dual_VNH2SP30_Motor_Driver which is having obsoleting problems.
Dual_VNH2SP30_Motor_Driver.fzpz (13.8 KB)
and its test sketch for obsolete testing (which I just realized wonât be useful without its obsoleteing fzp file
so here it is (from
obsolete/Dual_VNH2SP30_Motor_Driver.fzp
Dual_VNH2SP30_Motor_Driver.fzp (16.0 KB)
in the parts repo with the files from the fzpz installed in the core and svg/core directories. As well you will need this copy of bins/core.fzb as it needs a change too
core.fzb (49.8 KB)
So far the problems I have seen are that obsoleting doesnât update the version field correctly (it leaves the version as the original (details in this issue on github)
## Current Behaviour Load a sketch with an obsoleted part (Dual_VNH2SP30_MotoâŠ
and it appears to not update the url field in the upgraded part (the resulting file doesnât have the url in it. Iâll continue poking at the obsoleting issues and see what I can find out, but if someone else wants to have a bash, go for it!
Peter
OK, I have made pull requests for both the Dual_VNH2SP30_Motor_Driver obsoleting the old one and the replacement Dual_VNH5019_motor_driver (the VNH2SP30 is no longer available) as a new part.
Peter
OK, Iâm writing off github. I tried to modify a pull request to correct some problems and github tells me:
$ git push GitHub - vanepp/fritzing-parts: Electronic components for use in the Fritzing app (aka the parts library)
Username for âhttps://github.comâ:
Password for âhttps://vanepp@github.comâ:
To GitHub - vanepp/fritzing-parts: Electronic components for use in the Fritzing app (aka the parts library)
! [rejected] Dual_VNH2SP30_Motor_Driver_2 â Dual_VNH2SP30_Motor_Driver_2 (non-fast-forward)
error: failed to push some refs to âGitHub - vanepp/fritzing-parts: Electronic components for use in the Fritzing app (aka the parts library)â
hint: Updates were rejected because the tip of your current branch is behind
hint: its remote counterpart. Integrate the remote changes (e.g.
hint: âgit pull âŠâ) before pushing again.
hint: See the âNote about fast-forwardsâ in âgit push --helpâ for details.
So I give up, github is too much for me. I think I managed to get the Dual_VNH5019_motor_driver part (which is a new part) up in a pull request, and I deleted a pull request for obsolete.py and the Dual_VNH2SP30_Motor_Driver_2 pull request above. I may try and redo the obsolete.py one again, but other than that I donât know how to update parts on github and Iâm going to stop trying. This is a zipped copy of the files for Dual_VNH2SP30_Motor_Driver_2 with its obsoleing information and the .fzz file that tests it, so perhaps you can get a pull request for it to work (Iâd advise checking that the .fzz file works correctly to make sure I didnât miss any files when copying the changed files from the repository though.)
Dual_VNH2SP30_Motor_Driver-files.fzpz (44.7 KB)
frustrated Peter
Hi Peter,
I am sorry to hear your frustration. I have been there too. Sometimes, git is annoying.
When I make a pull request, you are asking to merge one brach with another branch. Thus, once is open in github, you do need to anything else. The next commits and pulls to your vannep/fritzing-parts (on that branch) will be automatically added to the pull request. I guess that you are doing that too.
I cannot see your computer, and it is difficult to see what is going on. Are you using any program or just the terminal? I usually use SourceTree which allows to visualize the changes and branches. If you are using the terminal, could you write all the git commands that you used?