Difference between revisions of "Command line"

From GIMX
Jump to: navigation, search
(Marked this version for translation)
(Start update for GIMX 2.xx.)
Line 7: Line 7:
 
It's also useful for other stuff like automation.
 
It's also useful for other stuff like automation.
  
==Linux + bluetooth== <!--T:3-->
+
==Linux + bluetooth + PS3== <!--T:3-->
  
 
===Set the dongle address=== <!--T:14-->
 
===Set the dongle address=== <!--T:14-->
Line 40: Line 40:
 
<!--T:4-->
 
<!--T:4-->
 
In a terminal:<br />
 
In a terminal:<br />
  emu ps3_bt_address bt_device_index sixaxis_index
+
  gimx --type Sixaxis --config filename --hci bt_device_index --bdaddr ps3_bt_address
  
 
<!--T:5-->
 
<!--T:5-->
* ps3_bt_address
 
:This argument is mandatory.
 
* bt_device_index
 
:The bluetooth device index (ex : 0 for hci0, 1 for hci1, etc).<br />
 
:This argument is optional, default device index is 0.
 
* sixaxis_index
 
:The sixaxis index (ex : 0 for sixaxis 1, 1 for sixaxis 2, etc).<br />
 
:This argument is optional, default sixaxis index is 0.
 
 
<!--T:6-->
 
In another terminal:<br />
 
emuclient --config file_name
 
 
<!--T:7-->
 
 
* file_name
 
* file_name
 
:The name of the config file, in the ~/.emuclient/config directory (ex : toto.xml).<br />
 
:The name of the config file, in the ~/.emuclient/config directory (ex : toto.xml).<br />
 
:This argument is mandatory.<br />
 
:This argument is mandatory.<br />
 
:Use backslashes to escape spaces.
 
:Use backslashes to escape spaces.
 +
* bt_device_index
 +
:The bluetooth device index (ex : 0 for hci0, 1 for hci1, etc).<br />
 +
:This argument is optional, default device index is 0.
 +
* ps3_bt_address
 +
:This argument is mandatory.
  
 
==Linux or Windows + DIY USB adapter or GPP== <!--T:8-->
 
==Linux or Windows + DIY USB adapter or GPP== <!--T:8-->

Revision as of 10:12, 19 July 2014

Other languages:
English • ‎français

Motivation

GIMX can be run from a Linux terminal without having to run a windowing system.
This improves performances, especially on small targets like the Raspberry Pi or thin clients.
It's also useful for other stuff like automation.

Linux + bluetooth + PS3

Set the dongle address

It is highly recommended to use a CSR Bluecore4-rom dongle. Check the compatibility list.

Plug a Sixaxis previously paired with the target PS3.

Type in a terminal:

sixaddr

Result:

Current Bluetooth master: ps3_bt_address
Current Bluetooth Device Address: sixaxis_bt_address

Get the current dongle address:

bdaddr -i hciN

where N is the dongle index (type "hciconfig -a" to see all dongles).

Write it down so as to be able to restore it later.

Set the dongle address:

bdaddr -r -i hciN sixaxis_bt_address

Check the result:

bdaddr -i hciN

Run GIMX

In a terminal:

gimx --type Sixaxis --config filename --hci bt_device_index --bdaddr ps3_bt_address
  • file_name
The name of the config file, in the ~/.emuclient/config directory (ex : toto.xml).
This argument is mandatory.
Use backslashes to escape spaces.
  • bt_device_index
The bluetooth device index (ex : 0 for hci0, 1 for hci1, etc).
This argument is optional, default device index is 0.
  • ps3_bt_address
This argument is mandatory.

Linux or Windows + DIY USB adapter or GPP

In a terminal:

GIMX 1.10 and later:

 emuclient --config file_name --port /dev/ttyUSBX
or
 emuclient -c file_name -p /dev/ttyUSBX
GIMX 0.51 or older:
 emuclient --config file_name --serial --port /dev/ttyUSBX --joystick --precision 16 --refresh 4
GIMX later than 0.51:
 emuclient --config file_name --port /dev/ttyUSBX --type joystick --refresh 4
or
 emuclient -c file_name -p /dev/ttyUSBX -t joystick -r 4

emuclient options:

  • --config file_name
The name of the config file, in the ~/.emuclient/config directory (ex : toto.xml).
This argument is mandatory.
  • --port /dev/ttyUSB0
The serial port. Ex: /dev/ttyUSB0 in Linux, COM4 in windows.
Only mandatory for the DIY USB adapter.
  • --type joystick/GPP/360pad/Sixaxis/PS2pad
The type of USB adapter.
joystick is for the DIY USB adapter with the joystick firmware
Sixaxis is for the DIY USB adapter with the sixaxis firmware
This option is only applicable for GIMX later than 0.51.
Optional since GIMX 1.10.
  • --refresh 4
The refresh period, in ms.
Recommended values:
joystick/GPP/360pad/Sixaxis: 4 (250Hz)
PS2pad: 16 (62.5Hz)
Optional since GIMX 1.10.
  • --serial
Only mandatory for the DIY USB adapter.
This option is only applicable for GIMX 0.51 and older.
  • --joystick / --GPP / --360pad / --PS2pad
The type of USB adapter.
--joystick is for the DIY USB adapter
This option is only applicable for GIMX 0.51 and older.
  • --precision 16
The axis precision. Joystick: 16, Other adapters: 8.
This option is only applicable for GIMX 0.51 and older.


General emuclient options

  • --curses
curses terminal display.
Mouse calibration is available through this interface.
  • --status
Display controls in the terminal.
  • --nograb
Do not grab the mouse cursor.
  • --force-updates
Send button+axis status even if there is no change (for compatibility with games like DNF).
  • --subpos
Improve stick precision (counteract rounding issues).
  • --keygen key
Generate a key press at emuclient startup.
The main use case for this is the automation of macro's execution.
Events that are not generated by macros are ignored.
For GIMX older than 1.10: the only way to quit is to add KEYDOWN LSHIFT and KEYDOWN ESCAPE at the end of the macro, or use --nograb and press ctrl+c into the terminal.
Another use case is the sending of a single command (it requires to use a macro as no key up event is generated).
  • --event "control(value)"
Since GIMX 1.10 it's possible to send controls to the console from the command line, without having to create a configuration and macros to use with the --keygen argument.
Example:
 emuclient -p /dev/ttyUSB0 --event "lstick x(127)" --event "rstick y(-128)" --event "circle(255)" --event "square(0)"
This moves the left stick right, the right stick forward, fully presses the circle button, and releases the square button.
The state of all other controls is cleared, i.e. all other buttons and axes are released (in the above command, --event "square(0)" is not necessary).
emuclient should complete in about 10ms.
Names and value ranges:
"lstick x", "lstick y", "rstick x", "rstick y": [-128,127]
"acc x", "acc y", "acc z", "gyro": [-512,511]
"select", "start", "PS", "l3", "r3": {0, 255} (only two values as these buttons are not pressure-sensitive)
"up", "right", "down", "left", "triangle", "circle", "cross", "square", "l1", "r1", "l2", "r2": [0,255]