platformio / platformio-core

Your Gateway to Embedded Software Development Excellence :alien:
https://platformio.org
Apache License 2.0
7.84k stars 789 forks source link

How to download packages manually? #3835

Closed Gianthard-cyh closed 3 years ago

Gianthard-cyh commented 3 years ago

I am a user from China and the speed of downloading packages is extremely low. I've found the comment from @jiladahe1997 in #3425 :

If it's slow with downloading platformio packages (like stm32HAL library, gcctools, which platformio will download automatically after you create a new project). you could download it manually here:http://dl.bintray.com/platformio/ . And then just copy them to .platformio\packages\ .

the speed of http://dl.bintray.com/platformio/ is high. However, after I downloaded the tar.gz file and unzipped it, I started building and get this: image It seems that PIO didn't recognize the package and still tries to download it. So how do I install the package manually from http://dl.bintray.com/platformio/? image

Gianthard-cyh commented 3 years ago

我是一个来自中国的用户。PIO自带的包管理器下载速度很慢。我在 #3425 中找到了 @jiladahe1997 的回复:

If it's slow with downloading platformio packages (like stm32HAL library, gcctools, which platformio will download automatically after you create a new project). you could download it manually here:http://dl.bintray.com/platformio/ . And then just copy them to .platformio\packages\

所以我从http://dl.bintray.com/platformio/ 下载了.tar.gz文件放在了.platformio\packages\目录下,但是我再次运行生成任务的时候,PIO的包管理器又开始下载我已经下好的包。 所以如何正确地手动安装PIO包?

ivankravets commented 3 years ago

Could you try these links from our own CDNs?

So, where is a good speed?

Gianthard-cyh commented 3 years ago

Could you try these links from our own CDNs?

So, where is a good speed?

the first one. How do I change the CDN to it? @ivankravets

ivankravets commented 3 years ago

We changed the priority for China on our side. So, please run pio system prune -f and try building project.

Does it download fast automatically now?

Gianthard-cyh commented 3 years ago

We changed the priority for China on our side. So, please run pio system prune -f and try building project.

Does it download fast automatically now?

image It looks nice now. Thank you very much. @ivankravets

ivankravets commented 3 years ago

Thanks for the report! Happy coding with PlatformIO!

Gianthard-cyh commented 3 years ago

I'm sorry to say that, but the speed when I init a project for the first time is really low. Have you changed the CDN when init a project for the first time to CDN 2?

ivankravets commented 3 years ago

What is the speed for https://dl.registry.nm1.platformio.org/tools/c9/17/f2c97dab926bb74d65343a647d20b75450201aface6a1ab6071556a640a1/toolchain-xtensa-windows_amd64-2.100100.200706.tar.gz ?

Gianthard-cyh commented 3 years ago

What is the speed for https://dl.registry.nm1.platformio.org/tools/c9/17/f2c97dab926bb74d65343a647d20b75450201aface6a1ab6071556a640a1/toolchain-xtensa-windows_amd64-2.100100.200706.tar.gz ?

It's slow. About 30kB/s

ivankravets commented 3 years ago

Do you have a Linux machine? Please provide an output of the next commands:

1

traceroute platformio.org

2

traceroute nm1.platformio.org
Gianthard-cyh commented 3 years ago

Do you have a Linux machine? Please provide an output of the next commands:

1

traceroute platformio.org

2

traceroute nm1.platformio.org

image image

ivankravets commented 3 years ago

How about a speed for this package?

Gianthard-cyh commented 3 years ago

How about a speed for this package?

about 1MB/s.

Gianthard-cyh commented 3 years ago

However , the speeds of all the CDNs are swinging. They are different between machines ,even from time to time,

Gianthard-cyh commented 3 years ago

However , the speeds of all the CDNs are swinging. They are different between machines ,even from time to time,

maybe a speed test of usable CDNs is needed before downloading.

ivankravets commented 3 years ago

What is the right solution for this case? Is it possible to contact your government and ask them to unblock our servers? I don't see another option here. We tried 3 different data centers and all are blocked and speed is limited.

ivankravets commented 3 years ago

I also know that China government blocked https://pypi.org/. I don't have any words on how to explain this reason.

Gianthard-cyh commented 3 years ago

What is the right solution for this case? Is it possible to contact your government and ask them to unblock our servers? I don't see another option here. We tried 3 different data centers and all are blocked and speed is limited.

Thank you very much for your reply. I'm so sorry that China government has blocked your servers. I do not have the right to ask the government to unblock it . Although the speeds are swinging, some of them have acceptable speed at a certain time. Set up a mirror server in China may be a long time goal. So Focus on the present, just choose the CDN with better speed automatically before every download. It will increase user experience. Thank you for making PIO better!

ivankravets commented 3 years ago

Could you advise us of a few VPS providers in China that work with non-Chinese customers?

Gianthard-cyh commented 3 years ago

Could you advise us of a few VPS providers in China that work with non-Chinese customers?

https://www.alibabacloud.com/ https://intl.cloud.tencent.com/

Thank you very much for your reply. According to the law, websites in China must be registered, including VPS and CDN, and must use Chinese ID card, so you should find a person in charge in China to apply for the record. Otherwise, ports 80 and 443 will be blocked when resolving the domain name, and testpage184 will be displayed. So if you want to use a domain name and want to use port 80, the only solution is to choose a person in charge in China. If not, you can use another port. If you just want to build an image for storing files in China, a more affordable way is to use OSS (object storage service). It will provide a storage space, as well as a default domain name, so that you can access the above files. However, if you want to use other domain names, you still need to apply for the record. Also, servers in China Hongkong is an option, and they don't need record.

I'm still asking my friends for the providers they advise.

ivankravets commented 3 years ago

Sounds crazy strange. Can't imagine how to resolve this issue in the 21st century.

P.S: I tried to register at Tencent and their service works "well". See a picture below. It seems they block people outside China as well.

Screen Shot 2021-04-05 at 14 51 54

Gianthard-cyh commented 3 years ago

Sounds crazy strange. Can't imagine how to resolve this issue in the 21st century.

P.S: I tried to register at Tencent and their service works "well". See a picture below. It seems they block people outside China as well.

Screen Shot 2021-04-05 at 14 51 54

nodecache.com This may be a good choice, which doesn't need record in China.

ivankravets commented 3 years ago

@Gianthard-cyh do you mean if use direct IP on a non HTTP port your government will not block us?

Gianthard-cyh commented 3 years ago

@Gianthard-cyh do you mean if use direct IP on a non HTTP port your government will not block us?

Just for servers in China. This can avoid record. But for your servers outside China, They block IPs, which means that there is no way except setting up a server in China.

ivankravets commented 3 years ago

Should be fixed on our side. Please try to install any package. Does it work fast now?

dkwiqmd commented 2 years ago

so vpn

ivankravets commented 1 year ago

@dkwiqmd , do experience ay problems with downloading packages?

developer-ken commented 1 year ago

Is it possible to configure which mirror should pio use, just like source.list for apt? It would be great that we can mirror pio packages in our school lab and make it easier for students to learn and use pio.

I now providing them with a compressed file of my ~/.platformio folder, but when any package got an update, pio will download them again, at a very slow speed. Actually we can have a whole afternoon doing no work just downloading packages. It will be great if we can just have a local mirror, then we only need to download it once and fast distribute them to local computers.

I am in China, 'Inter'net is not quite international here and developers have to eventually figure out a way to got a proxy. We can hardly view github without a proxy. There is actually someone selling pio packages here because they are not so easy to get by official mirror. Tha's awful.

radonyl commented 1 year ago

According to https://docs.platformio.org/en/latest/core/userguide/pkg/cmd_install.html#local-folder Since version 6.0, pio pkg install can install packages manually from directories, archive files or custom links.

@Gianthard-cyh a package will only be recongized when there is a .piopm file in its directory which is generate locally, so directly copy and paste downloaded packagse will not work. Use the pio pkg install file://path_to_directory instead.

developer-ken commented 1 year ago

Is it possible to configure which mirror should pio use, just like source.list for apt? It would be great that we can mirror pio packages in our school lab and make it easier for students to learn and use pio.

I now providing them with a compressed file of my ~/.platformio folder, but when any package got an update, pio will download them again, at a very slow speed. Actually we can have a whole afternoon doing no work just downloading packages. It will be great if we can just have a local mirror, then we only need to download it once and fast distribute them to local computers.

I am in China, 'Inter'net is not quite international here and developers have to eventually figure out a way to got a proxy. We can hardly view github without a proxy. There is actually someone selling pio packages here because they are not so easy to get by official mirror. Tha's awful.

I am now running a reverse proxy in China with my registered domain, which works well for me and most students in the lab. Also I noticed the official server got a huge download speed increase now, installing packages is possible even without special tricks. I guess the problem is solved somehow.
Can't understand why our gov block those download servers which contains absolutely legal contents.

nikito7 commented 11 months ago

Slow again. Europe

ivankravets commented 11 months ago

@nikito7 , what is your country? What is your download speed for https://dl.registry.platformio.org/download/espressif/tool/toolchain-xtensa-esp32/12.2.0+20230208/toolchain-xtensa-esp32-darwin_arm64-12.2.0+20230208.tar.gz ?

nikito7 commented 11 months ago

@nikito7 , what is your country? What is your download speed for https://dl.registry.platformio.org/download/espressif/tool/toolchain-xtensa-esp32/12.2.0+20230208/toolchain-xtensa-esp32-darwin_arm64-12.2.0+20230208.tar.gz ?

It's ok now. But it happen sometimes.

Screenshot_20231002_092055

dizjis commented 4 months ago

So slow, very slow. Russia image

https://dl.registry.platformio.org/download/espressif/tool/toolchain-xtensa-esp32/12.2.0+20230208/toolchain-xtensa-esp32-darwin_arm64-12.2.0+20230208.tar.gz ?

on this link the speed is 15kb/s image

tracert platformio.org

image

ivankravets commented 4 months ago

Could you try again?

dizjis commented 4 months ago

Could you try again?

its ok.Thank you very much