Ying-Chun Liu (PaulLiu) | bfce0ca | 2022-11-08 14:17:30 +0800 | [diff] [blame] | 1 | .. SPDX-License-Identifier: GPL-2.0+: |
| 2 | |
| 3 | wget command |
| 4 | ============ |
| 5 | |
| 6 | Synopsis |
| 7 | -------- |
| 8 | |
| 9 | :: |
Heinrich Schuchardt | 159dbe1 | 2022-12-22 11:32:03 +0100 | [diff] [blame] | 10 | |
Ying-Chun Liu (PaulLiu) | bfce0ca | 2022-11-08 14:17:30 +0800 | [diff] [blame] | 11 | wget address [[hostIPaddr:]path] |
| 12 | |
| 13 | Description |
| 14 | ----------- |
| 15 | |
| 16 | The wget command is used to download a file from an HTTP server. |
| 17 | |
| 18 | wget command will use HTTP over TCP to download files from an HTTP server. |
| 19 | Currently it can only download image from an HTTP server hosted on port 80. |
| 20 | |
| 21 | address |
| 22 | memory address for the data downloaded |
| 23 | |
| 24 | hostIPaddr |
| 25 | IP address of the HTTP server, defaults to the value of environment |
| 26 | variable *serverip* |
| 27 | |
| 28 | path |
| 29 | path of the file to be downloaded. |
| 30 | |
| 31 | Example |
| 32 | ------- |
| 33 | |
| 34 | In the example the following steps are executed: |
| 35 | |
| 36 | * setup client network address |
| 37 | * download a file from the HTTP server |
| 38 | |
| 39 | :: |
| 40 | |
| 41 | => setenv autoload no |
| 42 | => dhcp |
| 43 | BOOTP broadcast 1 |
| 44 | *** Unhandled DHCP Option in OFFER/ACK: 23 |
| 45 | *** Unhandled DHCP Option in OFFER/ACK: 23 |
| 46 | DHCP client bound to address 192.168.1.105 (210 ms) |
| 47 | => wget ${loadaddr} 192.168.1.254:/index.html |
| 48 | HTTP/1.0 302 Found |
| 49 | Packets received 4, Transfer Successful |
| 50 | |
| 51 | Configuration |
| 52 | ------------- |
| 53 | |
| 54 | The command is only available if CONFIG_CMD_WGET=y. |
| 55 | |
Heinrich Schuchardt | 159dbe1 | 2022-12-22 11:32:03 +0100 | [diff] [blame] | 56 | TCP Selective Acknowledgments can be enabled via CONFIG_PROT_TCP_SACK=y. |
| 57 | This will improve the download speed. |
Ying-Chun Liu (PaulLiu) | bfce0ca | 2022-11-08 14:17:30 +0800 | [diff] [blame] | 58 | |
| 59 | Return value |
| 60 | ------------ |
| 61 | |
| 62 | The return value $? is 0 (true) on success and 1 (false) otherwise. |