Mokucli 'download' command
Learn about the download command provided by mokucli
For Windows users:
Explanations of mokucli download:
Mokucli offers a range of functions accessible through the command window. Try executing the following command:
mokucli --help
The output of this command reveals several options and commands such as stream
, list
, and download
. This Knowledge Base article specifically focuses on providing a detailed explanation of the download
command. (Note that the download
command in mokucli
and the moku download
command in APIs perform identical tasks, thus users only need to make a one-time execution of either command.)
To help understand the functionality of the download
command, you can try inputting:
mokucli download --help
This command downloads the bitstreams for a specific firmware version. Additionally, it allows users to specify the destination for the bitstream file and offers an option for forced rewriting of bitstreams.
To download the bitstreams for a particular FIRMWARE_VERSION to the TARGET_PATH, execute the following command:
mokucli download --target TARGET_PATH FIRMWARE_VERSION
In case the bitstreams have already been downloaded, this command will prompt an error indicating their existing presence. However, you can enforce the completion of the download process by using:
mokucli download --target TARGET_PATH --force FIRMWARE_VERSION
For MATLAB APIs, the bitstream needs to be extracted before use. Extract the .tar.gz file using the following commands:
cd TARGET_PATH
tar -xzvf mokudata-FIRMWARE_VERSION.tar.gz
The successful extraction of the bitstreams folder and files can be confirmed by the displayed screenshot.
Next, assign the file path of the bitstreams to an environment variable to enable their utilization within APIs.
Configure system variable:
To add a new environment variable to the system variables for the target bitstreams path, follow these steps:
First of all, Open the ‘Edit the system environment variables’ panel.
Then, click on the ‘Environment Variable’ tab:
After that, click on the ‘New’ tab to create a new system variable:
Enter the Variable name as ‘MOKU_DATA_PATH’ and input the target bitstreams path as the Variable value:
It is now ready for Python and MATLAB API usage.
For MacOS users:
Explanations of mokucli download:
Mokucli offers a range of functions accessible through the command window. Try executing the following command:
mokucli --help
The output of this command reveals several options and commands such as stream
, list
, and download
. This Knowledge Base article specifically focuses on providing a detailed explanation of the download
command. (Note that the download
command in mokucli
and the moku download
command in APIs perform identical tasks, thus users only need to make a one-time execution of either command.)
To help understand the functionality of the download
command, you can try inputting:
mokucli download --help
This command downloads the bitstreams for a specific firmware version. Additionally, it allows users to specify the destination for the bitstream file and offers an option for forced rewriting of bitstreams.
To download the bitstreams for a particular FIRMWARE_VERSION to the TARGET_PATH, execute the following command:
mokucli download --target TARGET_PATH FIRMWARE_VERSION
In case the bitstreams have already been downloaded, this command will prompt an error indicating their existing presence. However, you can enforce the completion of the download process by using:
mokucli download --target TARGET_PATH --force FIRMWARE_VERSION
For MATLAB APIs, the bitstream needs to be extracted before use. Extract the .tar.gz file using the following commands:
cd TARGET_PATH
tar -xzvf mokudata-FIRMWARE_VERSION.tar.gz
Next, assign the file path of the bitstreams to an environment variable to facilitate their utilization within APIs.
Configure system variable:
Enter the Variable name as ‘MOKU_DATA_PATH’ and input the target bitstreams path as the Variable value:
sudo echo ‘export MOKU_DATA_PATH=/Users/heyanglong/Desktop/bitstreams’ >> ~/.zshrc
source ~/.zshrc
echo $MOKU_DATA_PATH
It is now ready for API usage.