Closed nikolai2111 closed 2 months ago
Hello @nikolai2111
I'm not able to reproduce your issue but I do see the local path to the datasheet may be posing a problem: C:\\Users\\nikol\\kintree\\cache\\datasheets\\suppproductinfo.tsp?distId=10&gotoUrl=http%253A%252F%252Fwww.ti.com%252Flit%252Fgpn%252Ftps61322.pdf
It's unfortunate but Texas Instruments parts on Digi-Key have a redirect/long URL which Ki-nTree can't download from... Please try replacing the URL before creating the part. For example for this part, replace the Datasheet field with: https://www.ti.com/lit/ds/symlink/tps61322.pdf
This works for me, please let me know!
EDIT: Reference https://github.com/sparkmicro/Ki-nTree/issues/177#issuecomment-1893854604
Hmmm, that's special.
I tried your short link today and it works perfectly. It is indeed the case that the TI links are very long. Could there be an algorithm that fixes the problem directly in software?
EDIT: I tried it with another TI, first with the crypic datasheet link -> failed. Then I added the link https://www.ti.com/lit/ds/symlink/
before the lower case part number and ended with the sufix .pdf
and it worked fine.
@eeintech do you think it would be a good idea to detect the TI links and replace them with the symlinks if they follow the outlined syntax?
@T0jan I am not sure if there is a generic way.
Either by detecting the "gotoUrl" pattern: "gotoUrl=http%253A%252F%252Fwww.ti.com%252Flit%252Fgpn%252FABC123.pdf" (eg. "gotoUrl=http://www.ti.com/lit/gpn/tps61322.pdf")
But then that URL returns 404 so we would have to fix it up to https://www.ti.com/lit/ds/symlink/ABC123.pdf
and hope it works?
Or skip this entirely and append the lower case part number like @nikolai2111 mentioned, but would it work always?
Also would we introduce a lookup for Digi-Key (supplier) and Texas Instruments (manufacturer) and tie it by a toggle in the settings? Should it be a field for the base URL to TI's website in case they change it in the future?
Any better idea?
@eeintech I wouldn't tie it to the supplier, as e.g. mouser also has this redirect thing to TI sometimes and I think other manufacturers do that as well. Instead I would go for some mechanism in the download-function to deal with these kinds of redirects, also for images etc. If we only want to do it for datasheets I would do it in the upload_datasheets function.
I also don't really see the reason to make it a user setting. There are so many other things going on in the background where the code would need an adjustment if the manufacturers/distributors change something on their websites (e.g. the headers for the html download request) and the user doesn't really care if it is a redirect or not.
Or skip this entirely and append the lower case part number like @nikolai2111 mentioned, but would it work always?
This won't work for all parts either (e.g. SN74LVC2G17DBVR). I think the best bet is to detect the part number in the goToUrl and then construct the symlink URL with this. AT least with my limited library of TI parts this worked for 100% while the other ideas always had some error cases.
I think the best bet is to detect the part number in the goToUrl and then construct the symlink URL with this. AT least with my limited library of TI parts this worked for 100% while the other ideas always had some error cases.
That was also my preferred option, so we can try to add this to the next minor release.
@eeintech I wouldn't tie it to the supplier, as e.g. mouser also has this redirect thing to TI sometimes and I think other manufacturers do that as well. Instead I would go for some mechanism in the download-function to deal with these kinds of redirects, also for images etc. If we only want to do it for datasheets I would do it in the upload_datasheets function.
So you would use a generic lookup table that would find the "goToUrl" keyword and translate http://www.ti.com/lit/gpn/ABC123.pdf
to https://www.ti.com/lit/ds/symlink/ABC123.pdf
, is that the idea here?
@eeintech yeah exactly.
fixed with v1.1.1
Hello everyone,
First of all, thank you very much for the great tool! It makes a lot of work easier.
I have a problem with the integration of the TPS613222ADBVR component from Digikey. I have already been able to integrate two components, 1x a resistor and 1x a crystal.
The following errors are displayed in the PowerShell:
Edit 1:
Ah and by the way how can the data sheets also be downloaded and saved in InvenTree? What needs to be configured for this?Edit 2: If I deactivate the upload of the data sheet to InvenTree then the component is recorded correctly.