The command application is available for download in a built executable package and in a source code package.
The pre-build package contains the ykushcmd executable and the hidapi DLL. The ykuscmd is a console application that can be run as a command to interact and control YKUSH boards functionality.
Using this package is the easiest way to get working with the YKUSH 3 board full functionality as the ykushcmd.exe is already built and executable. The Windows executable package is available for download at the YKUSH 3 product page in the Documents and Resources section. Download it and extract the files to a folder of your choice to get started with controlling the YKUSH 3 board.
You can now proceed to Connect the board section.
The command application can also be built from the source code which is available as an open source software from Yepkit/ykush GitHub repository.
To build the application follow the instructions detailed in the Yepkit/ykush GitHub repository README file.
Note: If errors occur during the build process it may be the case that the hidapi library should be built for your system. To do so the sources and build instructions can be found here.
Important: The hidapi.dll file should be placed in the same folder as the ykushcmd.exe executable file.
The basic connections to operate the board are the Upstream connection to the Host port (tipicaly a PC USB port) and optionally the external power input connection.
If only low power devices will be connected to YKUSH 3, the Bus-powered mode can be used. To connect the board using the Bus-powered mode start by ensuring that the on-board jumper is in the VBUS position, then connect the upstream port (the Micro USB 3.0 terminal) to the host USB port (eg, the USB port of a PC). And that's it.
If higher power devices are to be connected (e.g., USB drives, wireless dongles, etc) the use of the Self-powered mode for YKUSH 3 is recommended. In this mode the YKUSH 3 board will source the power from the external power input. To connect the board using the Self-powered mode start start by ensuring that the on-board jumper is in the VEXT position, next connect the PWR 5V to a 5V power supply and finish by connecting the upstream to the Host USB port.
At this point the YKUSH 3 board is ready to use.
Use the following commands to control the On/Off of the devices connected to the YKUSH 3 board downstream ports.
Power down a device connected to YKUSH 3 board downstream port 1:
Power up a device connected to YKUSH 3 board downstream port 1:
Power down a device connected to YKUSH 3 board downstream port 2:
Power up a device connected to YKUSH 3 board downstream port 2:
Power down a device connected to YKUSH 3 board downstream port 3:
Power up a device connected to YKUSH 3 board downstream port 3:
When more than one YKUSH 3 board is connected to the host, the action option in the command should be preceded by -s serial_number option. The serial_number is the serial number of the YKUSH 3 board where the action is to be executed.
To find out the serial number of a YKUSH 3 board, connect it to the host and execute the command:
This command will output the serial number of the connected YKUSH 3 boards. Note that if more than one board is connected when this command is executed the serial number of all connected YKUSH boards will be listed.
As an example, assuming that two YKUSH boards are connected with the following serial numbers:
To switch ON the downstream port 3 of YKUSH 3 board 1 we execute the command:
To get the current switching status (UP/DOWN) of a downstream port use a command with the following format.
For example, if you want to get the status of downstream port 1 the command is the following.
Again, if more than one YKUSH 3 board is connected to the host "-g" option should be preceded by the "-s serial_number" option to address the command to the board with the specified serial number.
To switch ON the 5V output port the command is the following.
To switch OFF the 5V output port the command is the following.
The board has three digital GPIO ports which can be written and read with the ykushcmd application. If the user writes the value 1 to a GPIO it will be set to logical High level (aprox 3.3V). If the user writes the value 0 to a GPIO it will be set to logical Low level (aprox 0V). Similarly, when reading from a GPIO a logical Low will be represented by a 0 value and a logical High by a 1 value.
For example, to set the GPIO 1 to logical High we should write the value 1 to it and the command is the following.
To set the GPIO 3 to logical High the command is the following.
To set the GPIO 2 to logical Low the command is the following.
To Read the GPIO 1 the command is the following.
The board factory default configuration is to have all downstream ports at ON state on power-on, which means that every time the board is rebooted it will reset all downstream ports to the ON state. The user can change this behavior by altering the configuration parameters. Please refer to the documentation for detailed information about the available configuration parameters. Bellow we present some examples of configuration commands to change the default state of the downstream ports.
To configure the default state of the downstream port 1 to be OFF at power-on (boot) the command is the following.
To configure the default state of the downstream port 2 to be OFF at power-on (boot) the command is the following.
To configure the default state of the downstream port 3 to be OFF at power-on (boot) the command is the following.
To configure the default state of the downstream port 1 to be persistent, in other words, to maintain after reboot the state it had before the reboot, the command is the following.
To reset the board the command is the following.
For additional support, you can reach us through the form in our support page.
For more information and resources for the YKUSH 3 board please visit the product page.