pcb-rnd knowledge pool


fp_wget: remote HTTP footprint libs

fp_wget by Tibor 'Igor2' Palinkas on 2016-04-19

Tags:announcement, footprint, library, lib, cloud, remote, download, wget, http, network

node source



Abstract: Footprint lib accessor over HTTP using wget; download footprints on demand from the "cloud" into local cache.


How to use fp_wget to integrate edakrill or gedasymbols in the lib window

Since version 1.0.10, pcb-rnd implements a new footprint mechanism (see pcblib and library_t ). The new code allows footprint backend plugins to get a library from anywhere. The [fp_wget] plugin is an implementation that:

This is all transparent, the user experience is that the remote library is like a read-only local library reachable from the library window. Since version 1.2.2, automatic index update is controlled by a configuration setting and a selective, per website mechanism for manual triggered update.

A web site used as a library should be able to:

The plugin uses external program wget to communicate on the web.

How to configure for edakrill: Add wget@edakrill in the library search path (e.g. in preferences as library path).

How to configure for gedasymbols.org: Add wget@gedasymbols in the library search path (e.g. in preferences as library path).

Refresh When configured run-time, the user needs to trigger a refresh explicitly, using the library reload action (or the refresh button in the library window on the gtk HID).

Further plans: Better feedback on progress, refresh in the background.

Library roots displayed, refresh

Imported from the mailing list archives.

Instead of merging all directories into a big common fs/ subtree, we now keep them separate, under the name they appeared on the library search path in the library window.

This has two advantages:

1. the user always knows where a footprint is coming from

2. now that it is possible to refresh/reload/rescan the root directories of the libraries, we don't need to rescan the whole fs subtree with all directories, but only the one the user clicked on. (Note: global rescan that does a full rescan on all libs is still available in the file/maintenance menu).

Another change is how we handle remote libraries (wget, gedasymbols and soon edakrill). Until now the remote library index was queried on every rescan (this included startup). This is not a good idea if someone wants to work offline or the remote server is slow/unstable (like gedasymbols.org is, lately). To prevent these problems without runining anyone's use case:

1. I've added a new config setting plugins/fp_wget/auto_update_gedasymbols - it is disabled by default. When enabled, it is the old behavior: always fetch the index-checksum (a ~40 bytes long file) to determine if the index needs to be updated (a larger file), including on startup. When disabled, no download is attempted until explicit user request.

2. Explicit user request is possible via the library window's refresh icon

3. It is also possible via an action: fp_rehash(wget@gedasymbols)

4. If gedasymbols is added on the search path with auto update disabled, wget@gedasymbols will appear as an empty directory in the library window and even the initial mapping is done only on explicit user request.