Difference between revisions of "Command line/fr"

From GIMX
Jump to: navigation, search
(Updating to match new version of source page)
Line 6: Line 6:
 
C'est aussi utile pour d'autres applications comme l'automatisation.
 
C'est aussi utile pour d'autres applications comme l'automatisation.
  
 +
<span class="mw-translate-fuzzy">
 
==Linux + bluetooth==
 
==Linux + bluetooth==
 +
</span>
  
 
===Ecrire l'adresse du dongle===
 
===Ecrire l'adresse du dongle===
Line 32: Line 34:
 
===Lancer GIMX===
 
===Lancer GIMX===
  
 +
<span class="mw-translate-fuzzy">
 
Dans un terminal:<br />
 
Dans un terminal:<br />
 
   emu ps3_bt_address bt_device_index sixaxis_index
 
   emu ps3_bt_address bt_device_index sixaxis_index
 +
</span>
  
 +
<span class="mw-translate-fuzzy">
 
* ps3_bt_address
 
* ps3_bt_address
 
:Cet argument est obligatoire.
 
:Cet argument est obligatoire.
Line 43: Line 48:
 
:L'index du sixaxis (ex : 0 pour le sixaxis 1, 1 pour le sixaxis 2, etc).<br />
 
:L'index du sixaxis (ex : 0 pour le sixaxis 1, 1 pour le sixaxis 2, etc).<br />
 
:Cet argument est optionnel, l'index par défaut est 0.
 
:Cet argument est optionnel, l'index par défaut est 0.
 +
</span>
  
Dans un  autre terminal:<br />
+
==Linux + bluetooth + PS4==
  emuclient --config file_name
 
  
* file_name
+
===Setup===
:Le nom du fichier de config, dans le répertoire ~/.emuclient/config directory (ex : toto.xml).<br />
+
 
:Cet argument est obligatoire.<br />
+
The setup performs the bluetooth pairing between the PS4 and the dongle, and between the dongle and the DS4.<br />
:Utiliser des backslashs pour échaper les espaces.
+
It has to be run again if the DS4 is reused (i.e. paired again) with the PS4.
 +
 
 +
Download the helper script:
 +
 
 +
  wget <nowiki>https://raw.github.com/matlo/GIMX-tools/master/PS4/gimx-ps4-helper.sh</nowiki> -O gimx-ps4-helper.sh
 +
 
 +
Make it executable:
 +
 
 +
  chmod +x gimx-ps4-helper.sh
 +
 
 +
Run it:
 +
 
 +
  sudo ./gimx-ps4-helper.sh
 +
 
 +
Simply follow the instructions. A successful output should look like this:
 +
 
 +
  $ sudo ./gimx-ps4-setup.sh
 +
  Unplug any Dualshock 4.
 +
  Unplug any teensy.
 +
  Unpug the bluetooth dongle.
 +
  Then press enter.
 +
 
 +
  Plug the bluetooth dongle.
 +
  The bluetooth dongle address is XX:XX:XX:XX:XX:XX.
 +
  The bluetooth hci number is 1.
 +
  Plug the DS4 with a USB cable.
 +
  The DS4 address is YY:YY:YY:YY:YY:YY.
 +
  Unplug the DS4.
 +
  Plug the teensy.
 +
  Unplug the teensy.
 +
  Plug the teensy to the PS4, and wait a few seconds.
 +
  Then plug the teensy back to the PC.
 +
  The PS4 address is ZZ:ZZ:ZZ:ZZ:ZZ:ZZ.
 +
  Everything was successful: setting dongle link keys.
 +
  To run gimx, type:
 +
  gimx -t DS4 -c config.xml -h 1 -b ZZ:ZZ:ZZ:ZZ:ZZ:ZZ
 +
 
 +
===Run GIMX===
 +
 
 +
1. The bluetooth service has to be stopped before starting GIMX (this allows GIMX to get incoming connections):
 +
  sudo service bluetooth stop
 +
You may also have to deactivate the bluetooth service if your system starts it automatically.
 +
 
 +
2. Start GIMX:
 +
  gimx -t DS4 -c <config file> -h <hci number> -b <PS4 bdaddr>
 +
 
 +
<config file> is the name of the config file to use.<br />
 +
<hci number> is the bluetooth hci number, for example 0 if there is only one bluetooth adapter (internal or external). Run 'hciconfig' if you're not sure about this value.<br />
 +
<PS4 bdaddr> is the address of the PS4.<br />
 +
 
 +
3. Start the DS4. It should connect to GIMX, which in turn should connect to the PS4.
  
 
==Linux ou Windows + DIY USB adapter ou GPP==
 
==Linux ou Windows + DIY USB adapter ou GPP==
Line 56: Line 111:
 
Dans un terminal:<br />
 
Dans un terminal:<br />
  
 +
<span class="mw-translate-fuzzy">
 
GIMX 1.10 ou plus récent :
 
GIMX 1.10 ou plus récent :
 
   emuclient --config file_name --port /dev/ttyUSBX
 
   emuclient --config file_name --port /dev/ttyUSBX
 
  ou
 
  ou
 
   emuclient -c file_name -p /dev/ttyUSBX
 
   emuclient -c file_name -p /dev/ttyUSBX
 +
</span>
  
<span style="color:#808080">GIMX 0.51 ou antérieur :
+
<span class="mw-translate-fuzzy">
  emuclient --config file_name --serial --port /dev/ttyUSBX --joystick --precision 16 --refresh 4</span>
 
 
 
<span style="color:#808080">GIMX plus récent que la 0.51 :
 
  emuclient --config file_name --port /dev/ttyUSBX --type joystick --refresh 4
 
ou
 
  emuclient -c file_name -p /dev/ttyUSBX -t joystick -r 4</span>
 
 
 
 
options pour emuclient :
 
options pour emuclient :
 
* --config file_name
 
* --config file_name
Line 99: Line 149:
 
:<span style="color:#808080">La précision des axes. Joystick: 16, Autres adaptateurs: 8.</span>
 
:<span style="color:#808080">La précision des axes. Joystick: 16, Autres adaptateurs: 8.</span>
 
:<span style="color:#808080">Cette option n'est applicable que pour GIMX 0.51 ou antérieur.</span>
 
:<span style="color:#808080">Cette option n'est applicable que pour GIMX 0.51 ou antérieur.</span>
 +
</span>
  
 +
==Linux or Windows + Remote GIMX==
 +
 +
In a terminal:<br />
 +
 +
  gimx --config file_name --dst IP:port
 +
or
 +
  gimx -c file_name -d IP:port
 +
 +
gimx options:
 +
* --config file_name
 +
:The name of the config file, in the ~/.gimx/config directory (ex : toto.xml).<br />
 +
:This argument is mandatory.
 +
* --dst IP:port
 +
:The destination IP+port. Ex: 127.0.0.1:51914.<br />
 +
:The remote GIMX has to be started with the --src argument, with the same IP:port value.
  
 +
<span class="mw-translate-fuzzy">
 
==Options générales pour emuclient==
 
==Options générales pour emuclient==
 +
</span>
  
 +
<span class="mw-translate-fuzzy">
 
* --curses
 
* --curses
 
:[http://en.wikipedia.org/wiki/Curses_%28programming_library%29 curses] Affiche l'état du contrôleur avec ncurses.<br />
 
:[http://en.wikipedia.org/wiki/Curses_%28programming_library%29 curses] Affiche l'état du contrôleur avec ncurses.<br />
Line 132: Line 201:
 
:"select", "start", "PS", "l3", "r3": {0, 255} (seulement deux valeurs car ces boutons ne sont pas "analogiques")
 
:"select", "start", "PS", "l3", "r3": {0, 255} (seulement deux valeurs car ces boutons ne sont pas "analogiques")
 
:"up", "right", "down", "left", "triangle", "circle", "cross", "square", "l1", "r1", "l2", "r2": [0,255]
 
:"up", "right", "down", "left", "triangle", "circle", "cross", "square", "l1", "r1", "l2", "r2": [0,255]
 +
</span>

Revision as of 10:26, 3 September 2014

Other languages:
English • ‎français

Motivation

GIMX peut s'exécuter depuis un terminal Linux sans nécessiter d'environnement graphique.
Cela améliore les performances, en particulier sur les petites matériels comme le raspberry pi ou les clients légers.
C'est aussi utile pour d'autres applications comme l'automatisation.

Linux + bluetooth

Ecrire l'adresse du dongle

Il est hautement recommandé d'utiliser un dongle CSR Bluecore4-rom. Voir la liste de compatibilité.

Connecter un Sixaxis précédemment appairé avec la PS3 cible.

Taper dans un terminal :

sixaddr

Résultat:

Current Bluetooth master: ps3_bt_address
Current Bluetooth Device Address: sixaxis_bt_address

Afficher l'adresse actuelle :

bdaddr -i hciN

où N est l'index du dongle (taper "hciconfig -a" pour voir tous les dongles).

La noter pour pouvoir la restaurer plus tard.

Ecrire l'adresse du dongle :

bdaddr -r -i hciN sixaxis_bt_address

Vérifier le résultat :

bdaddr -i hciN

Lancer GIMX

Dans un terminal:

 emu ps3_bt_address bt_device_index sixaxis_index

  • ps3_bt_address
Cet argument est obligatoire.
  • bt_device_index
L'index du périphérique bluetooth (ex : 0 pour hci0, 1 pour hci1, etc).

Cet argument est optionnel, l'index par défaut est 0.

  • sixaxis_index
L'index du sixaxis (ex : 0 pour le sixaxis 1, 1 pour le sixaxis 2, etc).
Cet argument est optionnel, l'index par défaut est 0.

Linux + bluetooth + PS4

Setup

The setup performs the bluetooth pairing between the PS4 and the dongle, and between the dongle and the DS4.
It has to be run again if the DS4 is reused (i.e. paired again) with the PS4.

Download the helper script:

 wget https://raw.github.com/matlo/GIMX-tools/master/PS4/gimx-ps4-helper.sh -O gimx-ps4-helper.sh

Make it executable:

 chmod +x gimx-ps4-helper.sh

Run it:

 sudo ./gimx-ps4-helper.sh

Simply follow the instructions. A successful output should look like this:

 $ sudo ./gimx-ps4-setup.sh
 Unplug any Dualshock 4.
 Unplug any teensy.
 Unpug the bluetooth dongle.
 Then press enter.
 
 Plug the bluetooth dongle.
 The bluetooth dongle address is XX:XX:XX:XX:XX:XX.
 The bluetooth hci number is 1.
 Plug the DS4 with a USB cable.
 The DS4 address is YY:YY:YY:YY:YY:YY.
 Unplug the DS4.
 Plug the teensy.
 Unplug the teensy.
 Plug the teensy to the PS4, and wait a few seconds.
 Then plug the teensy back to the PC.
 The PS4 address is ZZ:ZZ:ZZ:ZZ:ZZ:ZZ.
 Everything was successful: setting dongle link keys.
 To run gimx, type:
 gimx -t DS4 -c config.xml -h 1 -b ZZ:ZZ:ZZ:ZZ:ZZ:ZZ

Run GIMX

1. The bluetooth service has to be stopped before starting GIMX (this allows GIMX to get incoming connections):

 sudo service bluetooth stop

You may also have to deactivate the bluetooth service if your system starts it automatically.

2. Start GIMX:

 gimx -t DS4 -c <config file> -h <hci number> -b <PS4 bdaddr>

<config file> is the name of the config file to use.
<hci number> is the bluetooth hci number, for example 0 if there is only one bluetooth adapter (internal or external). Run 'hciconfig' if you're not sure about this value.
<PS4 bdaddr> is the address of the PS4.

3. Start the DS4. It should connect to GIMX, which in turn should connect to the PS4.

Linux ou Windows + DIY USB adapter ou GPP

Dans un terminal:

GIMX 1.10 ou plus récent :

 emuclient --config file_name --port /dev/ttyUSBX
ou
 emuclient -c file_name -p /dev/ttyUSBX

options pour emuclient :

  • --config file_name
Le nom du fichier de config, dans le répertoire ~/.emuclient/config directory (ex : toto.xml).
Cet argument est obligatoire.
  • --port /dev/ttyUSB0
Le port série. Ex: /dev/ttyUSB0 sous Linux, COM4 sous windows.
Seulement obligatoire avec un adaptateur USB DIY.
  • --type joystick/GPP/360pad/Sixaxis/PS2pad
Le type d'adaptateur USB.
joystick pour l'adaptateur USB DIY avec le firmware joystick
Sixaxis pour l'adaptateur USB DIY avec le firmware sixaxis.
Cette option n'est applicable que pour GIMX ultérieur à 0.51.
Optionnel depuis GIMX 1.10.
  • --refresh 4
La période de rafraîchissement, en ms.
Valeurs recommandées:
joystick/GPP/360pad/Sixaxis: 4 (250Hz)
PS2pad: 16 (62.5Hz)
Optionnel depuis GIMX 1.10.
  • --serial
Seulement obligatoire avec un adaptateur USB DIY.
Cette option n'est applicable que pour GIMX 0.51 ou antérieur.
  • --joystick / --GPP / --360pad / --Sixaxis / --PS2pad
Le type d'adaptateur USB.
--joystick pour l'adaptateur USB avec le firmware joystick
--Sixaxis pour le dongle bluetooth, ou pour l'adaptateur USB avec le firmware sixaxis
Cette option n'est applicable que pour GIMX 0.51 ou antérieur.
  • --precision 16
La précision des axes. Joystick: 16, Autres adaptateurs: 8.
Cette option n'est applicable que pour GIMX 0.51 ou antérieur.

Linux or Windows + Remote GIMX

In a terminal:

 gimx --config file_name --dst IP:port
or
 gimx -c file_name -d IP:port

gimx options:

  • --config file_name
The name of the config file, in the ~/.gimx/config directory (ex : toto.xml).
This argument is mandatory.
  • --dst IP:port
The destination IP+port. Ex: 127.0.0.1:51914.
The remote GIMX has to be started with the --src argument, with the same IP:port value.

Options générales pour emuclient

  • --curses
curses Affiche l'état du contrôleur avec ncurses.
La calibration de la souris est disponible par cette interface.
  • --status
Affiche l'état du contrôleur dans un terminal.
  • --nograb
Ne pas capturer le pointeur de la souris.
  • --force-updates
Envoyer l'état des axes et boutons même en cas d'inactivité (pour une compatibilité avec les jeux comme DNF).
  • --subpos
Améliorer la précision des sticks (compense les arrondis).
  • --keygen key
Générer un événement au démarrage d'emuclient.
La principale utilisation est l'automatisation de l'exécution de macros.
Les événements non générés par des macros sont ignorés.
GIMX antérieur à 1.10 : le seul moyen de quitter est d'ajouter KEYDOWN SHIFT et KEYDOWN ESCAPE à la fin de la macro, ou d'utiliser --nograb et de taper ctrl+c dans le terminal.
Un autre cas d'utilisation est l'envoi d'une commande unique (requiert l'utilisation d'une macro car la touche n'est pas relâchée).
  • --event "control(value)"
Depuis GIMX 1.10 il est possible d'envoyer des contrôles à la console depuis la ligne de commande, sans avoir à créer de configuration et de macros à utiliser avec l'argument --keygen.
Exemple:
 emuclient -p /dev/ttyUSB0 --event "lstick x(127)" --event "rstick y(-128)" --event "circle(255)" --event "square(0)"
Cette commande déplace le stick gauche à droite, le stick droit vers l'avant, appuie sur le bouton cercle à fond, et relâche le bouton carré.
L'état des autres contrôles est réinitialisé, c'est-à-dire que tous les autres boutons et axes sont relâchés (dans la commande ci-dessus, --event "square(0)" est inutile).
emuclient devrait terminer son exécution en environ 10ms.
Noms et plages de valeurs:
"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} (seulement deux valeurs car ces boutons ne sont pas "analogiques")
"up", "right", "down", "left", "triangle", "circle", "cross", "square", "l1", "r1", "l2", "r2": [0,255]