<?xml version="1.0"?>
<feed xmlns="http://www.w3.org/2005/Atom" xml:lang="en">
	<id>https://gimx.fr/wiki/api.php?action=feedcontributions&amp;feedformat=atom&amp;user=Steel+3d</id>
	<title>GIMX - User contributions [en]</title>
	<link rel="self" type="application/atom+xml" href="https://gimx.fr/wiki/api.php?action=feedcontributions&amp;feedformat=atom&amp;user=Steel+3d"/>
	<link rel="alternate" type="text/html" href="https://gimx.fr/wiki/index.php?title=Special:Contributions/Steel_3d"/>
	<updated>2026-05-01T14:29:42Z</updated>
	<subtitle>User contributions</subtitle>
	<generator>MediaWiki 1.31.7</generator>
	<entry>
		<id>https://gimx.fr/wiki/index.php?title=RPi&amp;diff=5843</id>
		<title>RPi</title>
		<link rel="alternate" type="text/html" href="https://gimx.fr/wiki/index.php?title=RPi&amp;diff=5843"/>
		<updated>2017-06-02T19:24:55Z</updated>

		<summary type="html">&lt;p&gt;Steel 3d: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&amp;lt;languages /&amp;gt;&lt;br /&gt;
&amp;lt;translate&amp;gt;&lt;br /&gt;
&amp;lt;!--T:1--&amp;gt;&lt;br /&gt;
'''Warning: RPi support should be considered as experimental. Be prepared to face issues if you try GIMX on the RPi.'''&lt;br /&gt;
&lt;br /&gt;
GIMX can run on many Linux targets, and the [http://www.raspberrypi.org/ the Raspberry Pi] is one of them!&lt;br /&gt;
&lt;br /&gt;
== Setup using pre-made image == &amp;lt;!--T:23--&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:24--&amp;gt;&lt;br /&gt;
The simplest way to set up GIMX on a Raspberry Pi is by flashing a pre-made image. See forum user steel_3d's instructions on getting up and running: [http://www.steve-marton.com/gimx/?p=462 Build your own Plug n Play GIMX emulator using Raspberry Pi] &lt;br /&gt;
&lt;br /&gt;
== Hardware considerations == &amp;lt;!--T:23--&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:24--&amp;gt;&lt;br /&gt;
Use a USB HUB only if there are no ports available on the RPi.&amp;lt;br /&amp;gt;&lt;br /&gt;
It is highly recommended to use a HUB with an external power supply.&lt;br /&gt;
&lt;br /&gt;
== Firmware update == &amp;lt;!--T:5--&amp;gt;&lt;br /&gt;
As early firmwares had severe USB issues it is recommended to update the firmware before using GIMX.&amp;lt;br /&amp;gt;&lt;br /&gt;
Updating the firmware may also be useful if you plan to use a Logitech force feedback wheel (the uhid kernel module was missing in earlier firmwares).&amp;lt;br /&amp;gt;&lt;br /&gt;
Type the following command:&lt;br /&gt;
&amp;lt;pre&amp;gt;sudo rpi-update&lt;br /&gt;
sudo reboot&amp;lt;/pre&amp;gt;&lt;br /&gt;
If you have issues with the latest firmware, install the following instead:&lt;br /&gt;
&amp;lt;pre&amp;gt;sudo rpi-update 771a503cfc2a1130e2df2a4ddfc45ffa0f592b3f&lt;br /&gt;
sudo reboot&amp;lt;/pre&amp;gt;&lt;br /&gt;
Tested Rpi firmware:&lt;br /&gt;
&amp;lt;pre&amp;gt;pi@raspberrypi ~ $ uname -a&lt;br /&gt;
Linux raspberrypi 4.1.21+ #873 Mon Apr 11 18:00:37 BST 2016 armv6l GNU/Linux&amp;lt;/pre&amp;gt;&lt;br /&gt;
&amp;lt;!--== UHID kernel module ==&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:27--&amp;gt;&lt;br /&gt;
If you plan to use a Logitech force feedback wheel, you will have to build the uhid.ko module for your kernel.&amp;lt;br /&amp;gt;&lt;br /&gt;
Install the right version of gcc, as explained here: [https://github.com/notro/rpi-source/wiki link].&amp;lt;br /&amp;gt;&lt;br /&gt;
Update your kernel:&lt;br /&gt;
&amp;lt;pre&amp;gt;sudo rpi-update&amp;lt;/pre&amp;gt;&lt;br /&gt;
In case the kernel was updated, reboot:&lt;br /&gt;
&amp;lt;pre&amp;gt;sudo reboot&amp;lt;/pre&amp;gt;&lt;br /&gt;
Install the rpi-source tool:&lt;br /&gt;
&amp;lt;pre&amp;gt;sudo wget https://raw.githubusercontent.com/notro/rpi-source/master/rpi-source -O /usr/bin/rpi-source &amp;amp;&amp;amp; sudo chmod +x /usr/bin/rpi-source &amp;amp;&amp;amp; /usr/bin/rpi-source -q --tag-update&amp;lt;/pre&amp;gt;&lt;br /&gt;
Run rpi-source:&lt;br /&gt;
&amp;lt;pre&amp;gt;rpi-source&amp;lt;/pre&amp;gt;&lt;br /&gt;
This step may take a while to complete.&amp;lt;br /&amp;gt;&lt;br /&gt;
Install ncurses:&lt;br /&gt;
&amp;lt;pre&amp;gt;sudo apt-get install libncurses5-dev&amp;lt;/pre&amp;gt;&lt;br /&gt;
Enable the UHID module compilation:&lt;br /&gt;
&amp;lt;pre&amp;gt;cd linux&lt;br /&gt;
make menuconfig&amp;lt;/pre&amp;gt;&lt;br /&gt;
Select Device Drivers&amp;gt;HID support&amp;gt;User-space I/O driver support for HID subsystem. The line should start with '&amp;lt;M&amp;gt;'.&amp;lt;br /&amp;gt;&lt;br /&gt;
To speed up the compilation, you can disable all other modules in the HID support section and subsections.&amp;lt;br /&amp;gt;&lt;br /&gt;
Save the config to the default location and exit.&amp;lt;br /&amp;gt;&lt;br /&gt;
Build the module:&lt;br /&gt;
&amp;lt;pre&amp;gt;make prepare&lt;br /&gt;
make scripts&lt;br /&gt;
make M=drivers/hid&amp;lt;/pre&amp;gt;&lt;br /&gt;
Install it:&lt;br /&gt;
&amp;lt;pre&amp;gt;sudo cp drivers/hid/uhid.ko /lib/modules/`uname -r`/kernel/drivers/hid/&lt;br /&gt;
sudo depmod -a&amp;lt;/pre&amp;gt;--&amp;gt;&lt;br /&gt;
&amp;lt;!--mkdir dest&lt;br /&gt;
make INSTALL_HDR_PATH=dest headers_install&lt;br /&gt;
sudo cp dest/include/linux/uhid.h /usr/include/linux/--&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== USB adapter using the on-board UART interface == &amp;lt;!--T:6--&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Hardware requirements === &amp;lt;!--T:25--&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:26--&amp;gt;&lt;br /&gt;
The on-board UART runs at 0V/3.3V levels, and the AVR USB board has to run at 5V to operate at 16MHz (running at 3.3V would only allow to operate at 8MHz).&amp;lt;br /&amp;gt;&lt;br /&gt;
Connecting the RPi and the AVR USB board directly may damage the hardware!&amp;lt;br /&amp;gt;&lt;br /&gt;
One cheap solution is to use a voltage divider:&amp;lt;br /&amp;gt;&lt;br /&gt;
* Connect both GNDs&lt;br /&gt;
* It's safe to connect the TXD pin of the RPi to the Rx pin of the AVR USB board (the GIMX firmwares configure the Rx pin as an input)&lt;br /&gt;
* To connect the Tx pin of the AVR USB board to the RXD pin of the RPi, you'll need to convert the voltage level from 0..5V to 0..3.3V.&amp;lt;br /&amp;gt;&lt;br /&gt;
This can be done with a simple resistive divider:&lt;br /&gt;
&amp;lt;div class=&amp;quot;image200px&amp;quot;&amp;gt;[https://gimx.fr/img/wiki/Resistive_divider.png https://gimx.fr/img/wiki/Resistive_divider.png]&amp;lt;/div&amp;gt;&lt;br /&gt;
Vin is the Tx pin of the AVR USB board, Vout is the RXD pin of the RPi, R1=2.2kΩ , R2=3.3kΩ&lt;br /&gt;
* Do not connect any other pin!&lt;br /&gt;
&lt;br /&gt;
=== Sotware adjustments === &amp;lt;!--T:15--&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:17--&amp;gt;&lt;br /&gt;
By default, the RPi UART is configured as a serial console.&amp;lt;br /&amp;gt;&lt;br /&gt;
Disable this serial console using raspi-config:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
sudo raspi-config &lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
Then select:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
&amp;quot;Advanced Options&amp;quot;, &amp;quot;Serial&amp;quot;, &amp;quot;No&amp;quot;, &amp;quot;Finish&amp;quot;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
The default configuration does not allow high baudrates.&amp;lt;br /&amp;gt;&lt;br /&gt;
Enable high baudrates editing /boot/config.txt:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
sudo nano /boot/config.txt&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
Add the following line at the end of the file:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
init_uart_clock=8000000 &lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
Reboot to apply the changes:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
sudo reboot&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== GIMX installation == &amp;lt;!--T:7--&amp;gt;&lt;br /&gt;
&amp;lt;pre&amp;gt;wget https://gimx.fr/download/gimx-raspbian -O gimx.deb&lt;br /&gt;
sudo dpkg -i gimx.deb&lt;br /&gt;
sudo apt-get -f install&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:8--&amp;gt;&lt;br /&gt;
If you get a &amp;quot;Dependency is not satisfiable: ...&amp;quot; error message, upgrade Raspbian:&lt;br /&gt;
&amp;lt;pre&amp;gt;sudo apt-get update &amp;amp;&amp;amp; sudo apt-get upgrade&lt;br /&gt;
sudo apt-get -f install&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Stop/disable triggerhappy service == &amp;lt;!--T:9--&amp;gt;&lt;br /&gt;
[https://github.com/wertarbyte/triggerhappy/blob/master/README Triggerhappy] is a daemon that opens every input device for reading, and that consumes a few percent of the CPU time.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:10--&amp;gt;&lt;br /&gt;
It seems a good idea to stop it while running GIMX.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:11--&amp;gt;&lt;br /&gt;
To stop triggerhappy:&lt;br /&gt;
 sudo service triggerhappy stop&lt;br /&gt;
To disable triggerhappy:&lt;br /&gt;
 sudo update-rc.d triggerhappy disable&lt;br /&gt;
&lt;br /&gt;
== Run GIMX == &amp;lt;!--T:12--&amp;gt;&lt;br /&gt;
Read the [[Quick_Start|Quick start page]] to learn how to run GIMX through the GUI.&amp;lt;br /&amp;gt;&lt;br /&gt;
&lt;br /&gt;
A good idea is to run GIMX directly from a terminal, without starting a graphical session, which can be done over the network, using a ssh client, or you can [[#Autostart GIMX at boot without GUI]]&amp;lt;br /&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Ideally, GIMX should be launched without using the Ethernet port (because it is connected on the USB bus). However, this doesn't seem to cause any issues generally.&amp;lt;br /&amp;gt;&lt;br /&gt;
&lt;br /&gt;
More details on command line options on [[Command_line|this page]].&amp;lt;br /&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The GUI will help you download the config xmls. If you never run the GUI, you MUST grab the Linux config xmls from here: https://github.com/matlo/GIMX-configurations/tree/master/Linux  The Windows xmls are NOT compatible!&amp;lt;br /&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Autostart GIMX at boot without GUI == &amp;lt;!--T:28--&amp;gt;&lt;br /&gt;
Simply create a file /etc/systemd/system/gimx.service (as root): &lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
sudo nano /etc/systemd/system/gimx.service&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
With the following contents:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:29--&amp;gt;&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
[Unit]&lt;br /&gt;
Description=GIMX  &lt;br /&gt;
After=syslog.target network.target&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:30--&amp;gt;&lt;br /&gt;
[Service]&lt;br /&gt;
User=pi  &lt;br /&gt;
Type=simple  &lt;br /&gt;
# Replace /dev/ttyUSB0 with /dev/ttyAMA0 when using the on-board UART interface&lt;br /&gt;
ExecStart=/usr/bin/gimx -p /dev/ttyUSB0 -c LogitechDrivingForceGT_G29.xml --nograb  &lt;br /&gt;
Restart=always  &lt;br /&gt;
RestartSec=5&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:31--&amp;gt;&lt;br /&gt;
[Install]&lt;br /&gt;
WantedBy=multi-user.target&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:32--&amp;gt;&lt;br /&gt;
Replace ttyUSB0 with your device (/dev/ttyAMA0 when using the on-board UART interface) and LogitechDrivingForceGT_G29.xml with your mapping file (which should be available in the pi home directory as /home/pi/.gimx/config/LogitechDrivingForceGT_G29.xml)&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:33--&amp;gt;&lt;br /&gt;
Run &amp;lt;pre&amp;gt;sudo systemctl daemon-reload&amp;lt;/pre&amp;gt; to notify systemd about the new file and &amp;lt;pre&amp;gt;sudo systemctl enable gimx &amp;amp;&amp;amp; sudo systemctl start gimx&amp;lt;/pre&amp;gt; to enable the gimx service start at boot and start it in the same line.&lt;br /&gt;
&lt;br /&gt;
== Notify when GIMX is running using a led == &amp;lt;!--T:34--&amp;gt;&lt;br /&gt;
In order to have a proper confirmation about if the gimx service is up and running, you can add a simple python script that turns a led on if the gimx service is running.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:35--&amp;gt;&lt;br /&gt;
The file will be located at /home/pi/blink.py:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;sudo nano blink.py&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
With the following contents:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:36--&amp;gt;&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
#!/usr/bin/python&lt;br /&gt;
import os  &lt;br /&gt;
import time  &lt;br /&gt;
import RPi.GPIO as GPIO&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:37--&amp;gt;&lt;br /&gt;
led = 23  &lt;br /&gt;
button = 18  &lt;br /&gt;
GPIO.setmode(GPIO.BCM)  &lt;br /&gt;
GPIO.setup(led, GPIO.OUT)  &lt;br /&gt;
GPIO.setup(button, GPIO.IN, pull_up_down = GPIO.PUD_UP)&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:38--&amp;gt;&lt;br /&gt;
def Shutdown(channel):  &lt;br /&gt;
  GPIO.output(led, True)&lt;br /&gt;
  time.sleep(0.2)&lt;br /&gt;
  GPIO.output(led, False)&lt;br /&gt;
  time.sleep(0.2)&lt;br /&gt;
  GPIO.output(led, True)&lt;br /&gt;
  time.sleep(0.2)&lt;br /&gt;
  GPIO.output(led, False)&lt;br /&gt;
  os.system(&amp;quot;sudo shutdown -h now&amp;quot;)&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:39--&amp;gt;&lt;br /&gt;
GPIO.add_event_detect(18, GPIO.FALLING, callback = Shutdown, bouncetime = 2000)&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:40--&amp;gt;&lt;br /&gt;
while True:  &lt;br /&gt;
  found = False&lt;br /&gt;
  time.sleep(5)&lt;br /&gt;
  pids = [pid for pid in os.listdir('/proc') if pid.isdigit()]&lt;br /&gt;
  for pid in pids:&lt;br /&gt;
    try:&lt;br /&gt;
      cmd = open(os.path.join('/proc', pid, 'cmdline'), 'rb').read()&lt;br /&gt;
      if &amp;quot;gimx&amp;quot; in cmd:&lt;br /&gt;
        found = True&lt;br /&gt;
    except IOError: # proc has already terminated&lt;br /&gt;
      continue&lt;br /&gt;
  if found == True:&lt;br /&gt;
    GPIO.output(led, True)&lt;br /&gt;
  else:&lt;br /&gt;
    GPIO.output(led, False)&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:41--&amp;gt;&lt;br /&gt;
As a bonus, you can add a button so when it is pressed, there is a little blink effect, and the pi is shutted down.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:42--&amp;gt;&lt;br /&gt;
&amp;lt;div class=&amp;quot;image200px&amp;quot;&amp;gt;[https://gimx.fr/img/wiki/PiButtonLed.png https://gimx.fr/img/wiki/PiButtonLed.png]&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:43--&amp;gt;&lt;br /&gt;
To start at boot, simply add it to the pi user crontab (crontab -e) as &amp;lt;pre&amp;gt;@reboot python /home/pi/blink.py &amp;amp;&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Powering on AVR and RPi simultaneously using the on-board UART interface  == &amp;lt;!--T:44--&amp;gt;&lt;br /&gt;
In case you want to power up AVR (Tested on Pro Micro ATmega32u4) and RPi at once (i.e. using PS4 USB port and a USB Y Splitter) using the on-board UART interface, you will need the adjust shown below in order to reset the AVR board from RPi once started.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:45--&amp;gt;&lt;br /&gt;
It is planned to solve this issue on next GIMX 7 version [https://github.com/matlo/GIMX/issues/426]&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:46--&amp;gt;&lt;br /&gt;
More details on support forum thread [https://gimx.fr/forum/viewtopic.php?f=5&amp;amp;t=1672]&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:47--&amp;gt;&lt;br /&gt;
'''Physically'''&lt;br /&gt;
* RPi's PIN40 / GPIO21 connected to ATmega32u4 RST pin directly. (Any RPi GPIO pin should works)&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:48--&amp;gt;&lt;br /&gt;
'''Logically'''&lt;br /&gt;
* New bash script created /home/pi/resetArduino.sh with content shown below:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
#!/bin/bash&lt;br /&gt;
&lt;br /&gt;
echo 21 &amp;gt; /sys/class/gpio/export&lt;br /&gt;
sleep 1&lt;br /&gt;
echo out &amp;gt; /sys/class/gpio/gpio21/direction&lt;br /&gt;
sleep 1&lt;br /&gt;
echo 1 &amp;gt; /sys/class/gpio/gpio21/value&lt;br /&gt;
sleep 1&lt;br /&gt;
echo 0 &amp;gt; /sys/class/gpio/gpio21/value&lt;br /&gt;
sleep 1&lt;br /&gt;
echo 1 &amp;gt; /sys/class/gpio/gpio21/value&lt;br /&gt;
&lt;br /&gt;
exit 0&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
* Grant execution permissions&lt;br /&gt;
&amp;lt;pre&amp;gt;chmod +x /home/pi/resetArduino.sh&amp;lt;/pre&amp;gt;&lt;br /&gt;
* Add the new script to boot sequence (like we do with blink.py program)&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
pi@raspberrypi:~ $ crontab -l&lt;br /&gt;
@reboot /home/pi/resetArduino.sh &amp;amp;&amp;amp; python /home/pi/blink.py &amp;amp;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Using this configuration, GIMX is able to start correctly on its first attempt when RPi and ATmega32u4 are powered on from PS4 simultaneously using GPIO instead of CP2102 USB UART.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/translate&amp;gt;&lt;/div&gt;</summary>
		<author><name>Steel 3d</name></author>
		
	</entry>
	<entry>
		<id>https://gimx.fr/wiki/index.php?title=RPi&amp;diff=5842</id>
		<title>RPi</title>
		<link rel="alternate" type="text/html" href="https://gimx.fr/wiki/index.php?title=RPi&amp;diff=5842"/>
		<updated>2017-06-02T19:23:06Z</updated>

		<summary type="html">&lt;p&gt;Steel 3d: Added instructions on using pre-made image.&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&amp;lt;languages /&amp;gt;&lt;br /&gt;
&amp;lt;translate&amp;gt;&lt;br /&gt;
&amp;lt;!--T:1--&amp;gt;&lt;br /&gt;
'''Warning: RPi support should be considered as experimental. Be prepared to face issues if you try GIMX on the RPi.'''&lt;br /&gt;
&lt;br /&gt;
GIMX can run on many Linux targets, and the [http://www.raspberrypi.org/ the Raspberry Pi] is one of them!&lt;br /&gt;
&lt;br /&gt;
== Setup using pre-made image == &amp;lt;!--T:23--&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:24--&amp;gt;&lt;br /&gt;
The simplest way to set up GIMX on a Raspberry Pi is by flashing a pre-made image. See forum user steel_3d's instructions on getting up and running: &amp;lt;a href =&amp;quot;http://www.steve-marton.com/gimx/?p=462&amp;quot;&amp;gt;Build your own Plug n Play GIMX emulator using Raspberry Pi&amp;lt;/a&amp;gt; &lt;br /&gt;
&lt;br /&gt;
== Hardware considerations == &amp;lt;!--T:23--&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:24--&amp;gt;&lt;br /&gt;
Use a USB HUB only if there are no ports available on the RPi.&amp;lt;br /&amp;gt;&lt;br /&gt;
It is highly recommended to use a HUB with an external power supply.&lt;br /&gt;
&lt;br /&gt;
== Firmware update == &amp;lt;!--T:5--&amp;gt;&lt;br /&gt;
As early firmwares had severe USB issues it is recommended to update the firmware before using GIMX.&amp;lt;br /&amp;gt;&lt;br /&gt;
Updating the firmware may also be useful if you plan to use a Logitech force feedback wheel (the uhid kernel module was missing in earlier firmwares).&amp;lt;br /&amp;gt;&lt;br /&gt;
Type the following command:&lt;br /&gt;
&amp;lt;pre&amp;gt;sudo rpi-update&lt;br /&gt;
sudo reboot&amp;lt;/pre&amp;gt;&lt;br /&gt;
If you have issues with the latest firmware, install the following instead:&lt;br /&gt;
&amp;lt;pre&amp;gt;sudo rpi-update 771a503cfc2a1130e2df2a4ddfc45ffa0f592b3f&lt;br /&gt;
sudo reboot&amp;lt;/pre&amp;gt;&lt;br /&gt;
Tested Rpi firmware:&lt;br /&gt;
&amp;lt;pre&amp;gt;pi@raspberrypi ~ $ uname -a&lt;br /&gt;
Linux raspberrypi 4.1.21+ #873 Mon Apr 11 18:00:37 BST 2016 armv6l GNU/Linux&amp;lt;/pre&amp;gt;&lt;br /&gt;
&amp;lt;!--== UHID kernel module ==&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:27--&amp;gt;&lt;br /&gt;
If you plan to use a Logitech force feedback wheel, you will have to build the uhid.ko module for your kernel.&amp;lt;br /&amp;gt;&lt;br /&gt;
Install the right version of gcc, as explained here: [https://github.com/notro/rpi-source/wiki link].&amp;lt;br /&amp;gt;&lt;br /&gt;
Update your kernel:&lt;br /&gt;
&amp;lt;pre&amp;gt;sudo rpi-update&amp;lt;/pre&amp;gt;&lt;br /&gt;
In case the kernel was updated, reboot:&lt;br /&gt;
&amp;lt;pre&amp;gt;sudo reboot&amp;lt;/pre&amp;gt;&lt;br /&gt;
Install the rpi-source tool:&lt;br /&gt;
&amp;lt;pre&amp;gt;sudo wget https://raw.githubusercontent.com/notro/rpi-source/master/rpi-source -O /usr/bin/rpi-source &amp;amp;&amp;amp; sudo chmod +x /usr/bin/rpi-source &amp;amp;&amp;amp; /usr/bin/rpi-source -q --tag-update&amp;lt;/pre&amp;gt;&lt;br /&gt;
Run rpi-source:&lt;br /&gt;
&amp;lt;pre&amp;gt;rpi-source&amp;lt;/pre&amp;gt;&lt;br /&gt;
This step may take a while to complete.&amp;lt;br /&amp;gt;&lt;br /&gt;
Install ncurses:&lt;br /&gt;
&amp;lt;pre&amp;gt;sudo apt-get install libncurses5-dev&amp;lt;/pre&amp;gt;&lt;br /&gt;
Enable the UHID module compilation:&lt;br /&gt;
&amp;lt;pre&amp;gt;cd linux&lt;br /&gt;
make menuconfig&amp;lt;/pre&amp;gt;&lt;br /&gt;
Select Device Drivers&amp;gt;HID support&amp;gt;User-space I/O driver support for HID subsystem. The line should start with '&amp;lt;M&amp;gt;'.&amp;lt;br /&amp;gt;&lt;br /&gt;
To speed up the compilation, you can disable all other modules in the HID support section and subsections.&amp;lt;br /&amp;gt;&lt;br /&gt;
Save the config to the default location and exit.&amp;lt;br /&amp;gt;&lt;br /&gt;
Build the module:&lt;br /&gt;
&amp;lt;pre&amp;gt;make prepare&lt;br /&gt;
make scripts&lt;br /&gt;
make M=drivers/hid&amp;lt;/pre&amp;gt;&lt;br /&gt;
Install it:&lt;br /&gt;
&amp;lt;pre&amp;gt;sudo cp drivers/hid/uhid.ko /lib/modules/`uname -r`/kernel/drivers/hid/&lt;br /&gt;
sudo depmod -a&amp;lt;/pre&amp;gt;--&amp;gt;&lt;br /&gt;
&amp;lt;!--mkdir dest&lt;br /&gt;
make INSTALL_HDR_PATH=dest headers_install&lt;br /&gt;
sudo cp dest/include/linux/uhid.h /usr/include/linux/--&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== USB adapter using the on-board UART interface == &amp;lt;!--T:6--&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Hardware requirements === &amp;lt;!--T:25--&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:26--&amp;gt;&lt;br /&gt;
The on-board UART runs at 0V/3.3V levels, and the AVR USB board has to run at 5V to operate at 16MHz (running at 3.3V would only allow to operate at 8MHz).&amp;lt;br /&amp;gt;&lt;br /&gt;
Connecting the RPi and the AVR USB board directly may damage the hardware!&amp;lt;br /&amp;gt;&lt;br /&gt;
One cheap solution is to use a voltage divider:&amp;lt;br /&amp;gt;&lt;br /&gt;
* Connect both GNDs&lt;br /&gt;
* It's safe to connect the TXD pin of the RPi to the Rx pin of the AVR USB board (the GIMX firmwares configure the Rx pin as an input)&lt;br /&gt;
* To connect the Tx pin of the AVR USB board to the RXD pin of the RPi, you'll need to convert the voltage level from 0..5V to 0..3.3V.&amp;lt;br /&amp;gt;&lt;br /&gt;
This can be done with a simple resistive divider:&lt;br /&gt;
&amp;lt;div class=&amp;quot;image200px&amp;quot;&amp;gt;[https://gimx.fr/img/wiki/Resistive_divider.png https://gimx.fr/img/wiki/Resistive_divider.png]&amp;lt;/div&amp;gt;&lt;br /&gt;
Vin is the Tx pin of the AVR USB board, Vout is the RXD pin of the RPi, R1=2.2kΩ , R2=3.3kΩ&lt;br /&gt;
* Do not connect any other pin!&lt;br /&gt;
&lt;br /&gt;
=== Sotware adjustments === &amp;lt;!--T:15--&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:17--&amp;gt;&lt;br /&gt;
By default, the RPi UART is configured as a serial console.&amp;lt;br /&amp;gt;&lt;br /&gt;
Disable this serial console using raspi-config:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
sudo raspi-config &lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
Then select:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
&amp;quot;Advanced Options&amp;quot;, &amp;quot;Serial&amp;quot;, &amp;quot;No&amp;quot;, &amp;quot;Finish&amp;quot;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
The default configuration does not allow high baudrates.&amp;lt;br /&amp;gt;&lt;br /&gt;
Enable high baudrates editing /boot/config.txt:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
sudo nano /boot/config.txt&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
Add the following line at the end of the file:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
init_uart_clock=8000000 &lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
Reboot to apply the changes:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
sudo reboot&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== GIMX installation == &amp;lt;!--T:7--&amp;gt;&lt;br /&gt;
&amp;lt;pre&amp;gt;wget https://gimx.fr/download/gimx-raspbian -O gimx.deb&lt;br /&gt;
sudo dpkg -i gimx.deb&lt;br /&gt;
sudo apt-get -f install&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:8--&amp;gt;&lt;br /&gt;
If you get a &amp;quot;Dependency is not satisfiable: ...&amp;quot; error message, upgrade Raspbian:&lt;br /&gt;
&amp;lt;pre&amp;gt;sudo apt-get update &amp;amp;&amp;amp; sudo apt-get upgrade&lt;br /&gt;
sudo apt-get -f install&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Stop/disable triggerhappy service == &amp;lt;!--T:9--&amp;gt;&lt;br /&gt;
[https://github.com/wertarbyte/triggerhappy/blob/master/README Triggerhappy] is a daemon that opens every input device for reading, and that consumes a few percent of the CPU time.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:10--&amp;gt;&lt;br /&gt;
It seems a good idea to stop it while running GIMX.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:11--&amp;gt;&lt;br /&gt;
To stop triggerhappy:&lt;br /&gt;
 sudo service triggerhappy stop&lt;br /&gt;
To disable triggerhappy:&lt;br /&gt;
 sudo update-rc.d triggerhappy disable&lt;br /&gt;
&lt;br /&gt;
== Run GIMX == &amp;lt;!--T:12--&amp;gt;&lt;br /&gt;
Read the [[Quick_Start|Quick start page]] to learn how to run GIMX through the GUI.&amp;lt;br /&amp;gt;&lt;br /&gt;
&lt;br /&gt;
A good idea is to run GIMX directly from a terminal, without starting a graphical session, which can be done over the network, using a ssh client, or you can [[#Autostart GIMX at boot without GUI]]&amp;lt;br /&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Ideally, GIMX should be launched without using the Ethernet port (because it is connected on the USB bus). However, this doesn't seem to cause any issues generally.&amp;lt;br /&amp;gt;&lt;br /&gt;
&lt;br /&gt;
More details on command line options on [[Command_line|this page]].&amp;lt;br /&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The GUI will help you download the config xmls. If you never run the GUI, you MUST grab the Linux config xmls from here: https://github.com/matlo/GIMX-configurations/tree/master/Linux  The Windows xmls are NOT compatible!&amp;lt;br /&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Autostart GIMX at boot without GUI == &amp;lt;!--T:28--&amp;gt;&lt;br /&gt;
Simply create a file /etc/systemd/system/gimx.service (as root): &lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
sudo nano /etc/systemd/system/gimx.service&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
With the following contents:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:29--&amp;gt;&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
[Unit]&lt;br /&gt;
Description=GIMX  &lt;br /&gt;
After=syslog.target network.target&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:30--&amp;gt;&lt;br /&gt;
[Service]&lt;br /&gt;
User=pi  &lt;br /&gt;
Type=simple  &lt;br /&gt;
# Replace /dev/ttyUSB0 with /dev/ttyAMA0 when using the on-board UART interface&lt;br /&gt;
ExecStart=/usr/bin/gimx -p /dev/ttyUSB0 -c LogitechDrivingForceGT_G29.xml --nograb  &lt;br /&gt;
Restart=always  &lt;br /&gt;
RestartSec=5&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:31--&amp;gt;&lt;br /&gt;
[Install]&lt;br /&gt;
WantedBy=multi-user.target&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:32--&amp;gt;&lt;br /&gt;
Replace ttyUSB0 with your device (/dev/ttyAMA0 when using the on-board UART interface) and LogitechDrivingForceGT_G29.xml with your mapping file (which should be available in the pi home directory as /home/pi/.gimx/config/LogitechDrivingForceGT_G29.xml)&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:33--&amp;gt;&lt;br /&gt;
Run &amp;lt;pre&amp;gt;sudo systemctl daemon-reload&amp;lt;/pre&amp;gt; to notify systemd about the new file and &amp;lt;pre&amp;gt;sudo systemctl enable gimx &amp;amp;&amp;amp; sudo systemctl start gimx&amp;lt;/pre&amp;gt; to enable the gimx service start at boot and start it in the same line.&lt;br /&gt;
&lt;br /&gt;
== Notify when GIMX is running using a led == &amp;lt;!--T:34--&amp;gt;&lt;br /&gt;
In order to have a proper confirmation about if the gimx service is up and running, you can add a simple python script that turns a led on if the gimx service is running.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:35--&amp;gt;&lt;br /&gt;
The file will be located at /home/pi/blink.py:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;sudo nano blink.py&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
With the following contents:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:36--&amp;gt;&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
#!/usr/bin/python&lt;br /&gt;
import os  &lt;br /&gt;
import time  &lt;br /&gt;
import RPi.GPIO as GPIO&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:37--&amp;gt;&lt;br /&gt;
led = 23  &lt;br /&gt;
button = 18  &lt;br /&gt;
GPIO.setmode(GPIO.BCM)  &lt;br /&gt;
GPIO.setup(led, GPIO.OUT)  &lt;br /&gt;
GPIO.setup(button, GPIO.IN, pull_up_down = GPIO.PUD_UP)&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:38--&amp;gt;&lt;br /&gt;
def Shutdown(channel):  &lt;br /&gt;
  GPIO.output(led, True)&lt;br /&gt;
  time.sleep(0.2)&lt;br /&gt;
  GPIO.output(led, False)&lt;br /&gt;
  time.sleep(0.2)&lt;br /&gt;
  GPIO.output(led, True)&lt;br /&gt;
  time.sleep(0.2)&lt;br /&gt;
  GPIO.output(led, False)&lt;br /&gt;
  os.system(&amp;quot;sudo shutdown -h now&amp;quot;)&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:39--&amp;gt;&lt;br /&gt;
GPIO.add_event_detect(18, GPIO.FALLING, callback = Shutdown, bouncetime = 2000)&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:40--&amp;gt;&lt;br /&gt;
while True:  &lt;br /&gt;
  found = False&lt;br /&gt;
  time.sleep(5)&lt;br /&gt;
  pids = [pid for pid in os.listdir('/proc') if pid.isdigit()]&lt;br /&gt;
  for pid in pids:&lt;br /&gt;
    try:&lt;br /&gt;
      cmd = open(os.path.join('/proc', pid, 'cmdline'), 'rb').read()&lt;br /&gt;
      if &amp;quot;gimx&amp;quot; in cmd:&lt;br /&gt;
        found = True&lt;br /&gt;
    except IOError: # proc has already terminated&lt;br /&gt;
      continue&lt;br /&gt;
  if found == True:&lt;br /&gt;
    GPIO.output(led, True)&lt;br /&gt;
  else:&lt;br /&gt;
    GPIO.output(led, False)&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:41--&amp;gt;&lt;br /&gt;
As a bonus, you can add a button so when it is pressed, there is a little blink effect, and the pi is shutted down.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:42--&amp;gt;&lt;br /&gt;
&amp;lt;div class=&amp;quot;image200px&amp;quot;&amp;gt;[https://gimx.fr/img/wiki/PiButtonLed.png https://gimx.fr/img/wiki/PiButtonLed.png]&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:43--&amp;gt;&lt;br /&gt;
To start at boot, simply add it to the pi user crontab (crontab -e) as &amp;lt;pre&amp;gt;@reboot python /home/pi/blink.py &amp;amp;&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Powering on AVR and RPi simultaneously using the on-board UART interface  == &amp;lt;!--T:44--&amp;gt;&lt;br /&gt;
In case you want to power up AVR (Tested on Pro Micro ATmega32u4) and RPi at once (i.e. using PS4 USB port and a USB Y Splitter) using the on-board UART interface, you will need the adjust shown below in order to reset the AVR board from RPi once started.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:45--&amp;gt;&lt;br /&gt;
It is planned to solve this issue on next GIMX 7 version [https://github.com/matlo/GIMX/issues/426]&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:46--&amp;gt;&lt;br /&gt;
More details on support forum thread [https://gimx.fr/forum/viewtopic.php?f=5&amp;amp;t=1672]&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:47--&amp;gt;&lt;br /&gt;
'''Physically'''&lt;br /&gt;
* RPi's PIN40 / GPIO21 connected to ATmega32u4 RST pin directly. (Any RPi GPIO pin should works)&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:48--&amp;gt;&lt;br /&gt;
'''Logically'''&lt;br /&gt;
* New bash script created /home/pi/resetArduino.sh with content shown below:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
#!/bin/bash&lt;br /&gt;
&lt;br /&gt;
echo 21 &amp;gt; /sys/class/gpio/export&lt;br /&gt;
sleep 1&lt;br /&gt;
echo out &amp;gt; /sys/class/gpio/gpio21/direction&lt;br /&gt;
sleep 1&lt;br /&gt;
echo 1 &amp;gt; /sys/class/gpio/gpio21/value&lt;br /&gt;
sleep 1&lt;br /&gt;
echo 0 &amp;gt; /sys/class/gpio/gpio21/value&lt;br /&gt;
sleep 1&lt;br /&gt;
echo 1 &amp;gt; /sys/class/gpio/gpio21/value&lt;br /&gt;
&lt;br /&gt;
exit 0&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
* Grant execution permissions&lt;br /&gt;
&amp;lt;pre&amp;gt;chmod +x /home/pi/resetArduino.sh&amp;lt;/pre&amp;gt;&lt;br /&gt;
* Add the new script to boot sequence (like we do with blink.py program)&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
pi@raspberrypi:~ $ crontab -l&lt;br /&gt;
@reboot /home/pi/resetArduino.sh &amp;amp;&amp;amp; python /home/pi/blink.py &amp;amp;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Using this configuration, GIMX is able to start correctly on its first attempt when RPi and ATmega32u4 are powered on from PS4 simultaneously using GPIO instead of CP2102 USB UART.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/translate&amp;gt;&lt;/div&gt;</summary>
		<author><name>Steel 3d</name></author>
		
	</entry>
	<entry>
		<id>https://gimx.fr/wiki/index.php?title=RPi&amp;diff=5272</id>
		<title>RPi</title>
		<link rel="alternate" type="text/html" href="https://gimx.fr/wiki/index.php?title=RPi&amp;diff=5272"/>
		<updated>2016-12-14T10:53:22Z</updated>

		<summary type="html">&lt;p&gt;Steel 3d: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&amp;lt;languages /&amp;gt;&lt;br /&gt;
&amp;lt;translate&amp;gt;&lt;br /&gt;
&amp;lt;!--T:1--&amp;gt;&lt;br /&gt;
'''Warning: RPi support should be considered as experimental. Be prepared to face issues if you try GIMX on the RPi.'''&lt;br /&gt;
&lt;br /&gt;
GIMX can run on many Linux targets, and the [http://www.raspberrypi.org/ the Raspberry Pi] is one of them!&lt;br /&gt;
== Hardware considerations == &amp;lt;!--T:23--&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:24--&amp;gt;&lt;br /&gt;
Use a USB HUB only if there are no ports available on the RPi.&amp;lt;br /&amp;gt;&lt;br /&gt;
It is highly recommended to use a HUB with an external power supply.&lt;br /&gt;
&lt;br /&gt;
== Firmware update == &amp;lt;!--T:5--&amp;gt;&lt;br /&gt;
As early firmwares had severe USB issues it is recommended to update the firmware before using GIMX.&amp;lt;br /&amp;gt;&lt;br /&gt;
Updating the firmware may also be useful if you plan to use a Logitech force feedback wheel (the uhid kernel module was missing in earlier firmwares).&amp;lt;br /&amp;gt;&lt;br /&gt;
Type the following command:&lt;br /&gt;
&amp;lt;pre&amp;gt;sudo rpi-update&lt;br /&gt;
sudo reboot&amp;lt;/pre&amp;gt;&lt;br /&gt;
If you have issues with the latest firmware, install the following instead:&lt;br /&gt;
&amp;lt;pre&amp;gt;sudo rpi-update 771a503cfc2a1130e2df2a4ddfc45ffa0f592b3f&lt;br /&gt;
sudo reboot&amp;lt;/pre&amp;gt;&lt;br /&gt;
Tested Rpi firmware:&lt;br /&gt;
&amp;lt;pre&amp;gt;pi@raspberrypi ~ $ uname -a&lt;br /&gt;
Linux raspberrypi 4.1.21+ #873 Mon Apr 11 18:00:37 BST 2016 armv6l GNU/Linux&amp;lt;/pre&amp;gt;&lt;br /&gt;
&amp;lt;!--== UHID kernel module ==&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:27--&amp;gt;&lt;br /&gt;
If you plan to use a Logitech force feedback wheel, you will have to build the uhid.ko module for your kernel.&amp;lt;br /&amp;gt;&lt;br /&gt;
Install the right version of gcc, as explained here: [https://github.com/notro/rpi-source/wiki link].&amp;lt;br /&amp;gt;&lt;br /&gt;
Update your kernel:&lt;br /&gt;
&amp;lt;pre&amp;gt;sudo rpi-update&amp;lt;/pre&amp;gt;&lt;br /&gt;
In case the kernel was updated, reboot:&lt;br /&gt;
&amp;lt;pre&amp;gt;sudo reboot&amp;lt;/pre&amp;gt;&lt;br /&gt;
Install the rpi-source tool:&lt;br /&gt;
&amp;lt;pre&amp;gt;sudo wget https://raw.githubusercontent.com/notro/rpi-source/master/rpi-source -O /usr/bin/rpi-source &amp;amp;&amp;amp; sudo chmod +x /usr/bin/rpi-source &amp;amp;&amp;amp; /usr/bin/rpi-source -q --tag-update&amp;lt;/pre&amp;gt;&lt;br /&gt;
Run rpi-source:&lt;br /&gt;
&amp;lt;pre&amp;gt;rpi-source&amp;lt;/pre&amp;gt;&lt;br /&gt;
This step may take a while to complete.&amp;lt;br /&amp;gt;&lt;br /&gt;
Install ncurses:&lt;br /&gt;
&amp;lt;pre&amp;gt;sudo apt-get install libncurses5-dev&amp;lt;/pre&amp;gt;&lt;br /&gt;
Enable the UHID module compilation:&lt;br /&gt;
&amp;lt;pre&amp;gt;cd linux&lt;br /&gt;
make menuconfig&amp;lt;/pre&amp;gt;&lt;br /&gt;
Select Device Drivers&amp;gt;HID support&amp;gt;User-space I/O driver support for HID subsystem. The line should start with '&amp;lt;M&amp;gt;'.&amp;lt;br /&amp;gt;&lt;br /&gt;
To speed up the compilation, you can disable all other modules in the HID support section and subsections.&amp;lt;br /&amp;gt;&lt;br /&gt;
Save the config to the default location and exit.&amp;lt;br /&amp;gt;&lt;br /&gt;
Build the module:&lt;br /&gt;
&amp;lt;pre&amp;gt;make prepare&lt;br /&gt;
make scripts&lt;br /&gt;
make M=drivers/hid&amp;lt;/pre&amp;gt;&lt;br /&gt;
Install it:&lt;br /&gt;
&amp;lt;pre&amp;gt;sudo cp drivers/hid/uhid.ko /lib/modules/`uname -r`/kernel/drivers/hid/&lt;br /&gt;
sudo depmod -a&amp;lt;/pre&amp;gt;--&amp;gt;&lt;br /&gt;
&amp;lt;!--mkdir dest&lt;br /&gt;
make INSTALL_HDR_PATH=dest headers_install&lt;br /&gt;
sudo cp dest/include/linux/uhid.h /usr/include/linux/--&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== USB adapter using the on-board UART interface == &amp;lt;!--T:6--&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Hardware requirements === &amp;lt;!--T:25--&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:26--&amp;gt;&lt;br /&gt;
The on-board UART runs at 0V/3.3V levels, and the AVR USB board has to run at 5V to operate at 16MHz (running at 3.3V would only allow to operate at 8MHz).&amp;lt;br /&amp;gt;&lt;br /&gt;
Connecting the RPi and the AVR USB board directly may damage the hardware!&amp;lt;br /&amp;gt;&lt;br /&gt;
One cheap solution is to use a voltage divider:&amp;lt;br /&amp;gt;&lt;br /&gt;
* Connect both GNDs&lt;br /&gt;
* It's safe to connect the TXD pin of the RPi to the Rx pin of the AVR USB board (the GIMX firmwares configure the Rx pin as an input)&lt;br /&gt;
* To connect the Tx pin of the AVR USB board to the RXD pin of the RPi, you'll need to convert the voltage level from 0..5V to 0..3.3V.&amp;lt;br /&amp;gt;&lt;br /&gt;
This can be done with a simple resistive divider:&lt;br /&gt;
&amp;lt;div class=&amp;quot;image200px&amp;quot;&amp;gt;[https://gimx.fr/img/wiki/Resistive_divider.png https://gimx.fr/img/wiki/Resistive_divider.png]&amp;lt;/div&amp;gt;&lt;br /&gt;
Vin is the Tx pin of the AVR USB board, Vout is the RXD pin of the RPi, R1=2.2kΩ , R2=3.3kΩ&lt;br /&gt;
* Do not connect any other pin!&lt;br /&gt;
&lt;br /&gt;
=== Sotware adjustments === &amp;lt;!--T:15--&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:17--&amp;gt;&lt;br /&gt;
By default, the RPi UART is configured as a serial console.&amp;lt;br /&amp;gt;&lt;br /&gt;
Disable this serial console using raspi-config:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
sudo raspi-config &lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
Then select:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
&amp;quot;Advanced Options&amp;quot;, &amp;quot;Serial&amp;quot;, &amp;quot;No&amp;quot;, &amp;quot;Finish&amp;quot;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
The default configuration does not allow high baudrates.&amp;lt;br /&amp;gt;&lt;br /&gt;
Enable high baudrates editing /boot/config.txt:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
sudo nano /boot/config.txt&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
Add the following line at the end of the file:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
init_uart_clock=8000000 &lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
Reboot to apply the changes:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
sudo reboot&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== GIMX installation == &amp;lt;!--T:7--&amp;gt;&lt;br /&gt;
&amp;lt;pre&amp;gt;wget https://gimx.fr/download/gimx-raspbian -O gimx.deb&lt;br /&gt;
sudo dpkg -i gimx.deb&lt;br /&gt;
sudo apt-get -f install&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:8--&amp;gt;&lt;br /&gt;
If you get a &amp;quot;Dependency is not satisfiable: ...&amp;quot; error message, upgrade Raspbian:&lt;br /&gt;
&amp;lt;pre&amp;gt;sudo apt-get update &amp;amp;&amp;amp; sudo apt-get upgrade&lt;br /&gt;
sudo apt-get -f install&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Stop/disable triggerhappy service == &amp;lt;!--T:9--&amp;gt;&lt;br /&gt;
[https://github.com/wertarbyte/triggerhappy/blob/master/README Triggerhappy] is a daemon that opens every input device for reading, and that consumes a few percent of the CPU time.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:10--&amp;gt;&lt;br /&gt;
It seems a good idea to stop it while running GIMX.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:11--&amp;gt;&lt;br /&gt;
To stop triggerhappy:&lt;br /&gt;
 sudo service triggerhappy stop&lt;br /&gt;
To disable triggerhappy:&lt;br /&gt;
 sudo update-rc.d triggerhappy disable&lt;br /&gt;
&lt;br /&gt;
== Run GIMX == &amp;lt;!--T:12--&amp;gt;&lt;br /&gt;
Read the [[Quick_Start|Quick start page]] to learn how to run GIMX through the GUI.&amp;lt;br /&amp;gt;&lt;br /&gt;
&lt;br /&gt;
A good idea is to run GIMX directly from a terminal, without starting a graphical session, which can be done over the network, using a ssh client, or you can [[#Autostart GIMX at boot without GUI]]&amp;lt;br /&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Ideally, GIMX should be launched without using the Ethernet port (because it is connected on the USB bus). However, this doesn't seem to cause any issues generally.&amp;lt;br /&amp;gt;&lt;br /&gt;
&lt;br /&gt;
More details on command line options on [[Command_line|this page]].&amp;lt;br /&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The GUI will help you download the config xmls. If you never run the GUI, you MUST grab the Linux config xmls from here: https://github.com/matlo/GIMX-configurations/tree/master/Linux  The Windows xmls are NOT compatible!&amp;lt;br /&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Autostart GIMX at boot without GUI == &amp;lt;!--T:28--&amp;gt;&lt;br /&gt;
Simply create a file /etc/systemd/system/gimx.service (as root): &lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
sudo nano /etc/systemd/system/gimx.service&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
With the following contents:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:29--&amp;gt;&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
[Unit]&lt;br /&gt;
Description=GIMX  &lt;br /&gt;
After=syslog.target network.target&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:30--&amp;gt;&lt;br /&gt;
[Service]&lt;br /&gt;
User=pi  &lt;br /&gt;
Type=simple  &lt;br /&gt;
# Replace /dev/ttyUSB0 with /dev/ttyAMA0 when using the on-board UART interface&lt;br /&gt;
ExecStart=/usr/bin/gimx -p /dev/ttyUSB0 -c LogitechDrivingForceGT_G29.xml --nograb  &lt;br /&gt;
Restart=always  &lt;br /&gt;
RestartSec=5&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:31--&amp;gt;&lt;br /&gt;
[Install]&lt;br /&gt;
WantedBy=multi-user.target&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:32--&amp;gt;&lt;br /&gt;
Replace ttyUSB0 with your device (/dev/ttyAMA0 when using the on-board UART interface) and LogitechDrivingForceGT_G29.xml with your mapping file (which should be available in the pi home directory as /home/pi/.gimx/config/LogitechDrivingForceGT_G29.xml)&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:33--&amp;gt;&lt;br /&gt;
Run &amp;lt;pre&amp;gt;sudo systemctl daemon-reload&amp;lt;/pre&amp;gt; to notify systemd about the new file and &amp;lt;pre&amp;gt;sudo systemctl enable gimx &amp;amp;&amp;amp; sudo systemctl start gimx&amp;lt;/pre&amp;gt; to enable the gimx service start at boot and start it in the same line.&lt;br /&gt;
&lt;br /&gt;
== Notify when GIMX is running using a led == &amp;lt;!--T:34--&amp;gt;&lt;br /&gt;
In order to have a proper confirmation about if the gimx service is up and running, you can add a simple python script that turns a led on if the gimx service is running.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:35--&amp;gt;&lt;br /&gt;
The file will be located at /home/pi/blink.py:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;sudo nano blink.py&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
With the following contents:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:36--&amp;gt;&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
#!/usr/bin/python&lt;br /&gt;
import os  &lt;br /&gt;
import time  &lt;br /&gt;
import RPi.GPIO as GPIO&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:37--&amp;gt;&lt;br /&gt;
led = 23  &lt;br /&gt;
button = 18  &lt;br /&gt;
GPIO.setmode(GPIO.BCM)  &lt;br /&gt;
GPIO.setup(led, GPIO.OUT)  &lt;br /&gt;
GPIO.setup(button, GPIO.IN, pull_up_down = GPIO.PUD_UP)&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:38--&amp;gt;&lt;br /&gt;
def Shutdown(channel):  &lt;br /&gt;
  GPIO.output(led, True)&lt;br /&gt;
  time.sleep(0.2)&lt;br /&gt;
  GPIO.output(led, False)&lt;br /&gt;
  time.sleep(0.2)&lt;br /&gt;
  GPIO.output(led, True)&lt;br /&gt;
  time.sleep(0.2)&lt;br /&gt;
  GPIO.output(led, False)&lt;br /&gt;
  os.system(&amp;quot;sudo shutdown -h now&amp;quot;)&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:39--&amp;gt;&lt;br /&gt;
GPIO.add_event_detect(18, GPIO.FALLING, callback = Shutdown, bouncetime = 2000)&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:40--&amp;gt;&lt;br /&gt;
while True:  &lt;br /&gt;
  found = False&lt;br /&gt;
  time.sleep(5)&lt;br /&gt;
  pids = [pid for pid in os.listdir('/proc') if pid.isdigit()]&lt;br /&gt;
  for pid in pids:&lt;br /&gt;
    try:&lt;br /&gt;
      cmd = open(os.path.join('/proc', pid, 'cmdline'), 'rb').read()&lt;br /&gt;
      if &amp;quot;gimx&amp;quot; in cmd:&lt;br /&gt;
        found = True&lt;br /&gt;
    except IOError: # proc has already terminated&lt;br /&gt;
      continue&lt;br /&gt;
  if found == True:&lt;br /&gt;
    GPIO.output(led, True)&lt;br /&gt;
  else:&lt;br /&gt;
    GPIO.output(led, False)&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:41--&amp;gt;&lt;br /&gt;
As a bonus, you can add a button so when it is pressed, there is a little blink effect, and the pi is shutted down.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:42--&amp;gt;&lt;br /&gt;
&amp;lt;div class=&amp;quot;image200px&amp;quot;&amp;gt;[https://gimx.fr/img/wiki/PiButtonLed.png https://gimx.fr/img/wiki/PiButtonLed.png]&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:43--&amp;gt;&lt;br /&gt;
To start at boot, simply add it to the pi user crontab (crontab -e) as &amp;lt;pre&amp;gt;@reboot python /home/pi/blink.py &amp;amp;&amp;lt;/pre&amp;gt;&lt;br /&gt;
&amp;lt;/translate&amp;gt;&lt;/div&gt;</summary>
		<author><name>Steel 3d</name></author>
		
	</entry>
	<entry>
		<id>https://gimx.fr/wiki/index.php?title=RPi&amp;diff=5271</id>
		<title>RPi</title>
		<link rel="alternate" type="text/html" href="https://gimx.fr/wiki/index.php?title=RPi&amp;diff=5271"/>
		<updated>2016-12-14T10:52:21Z</updated>

		<summary type="html">&lt;p&gt;Steel 3d: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&amp;lt;languages /&amp;gt;&lt;br /&gt;
&amp;lt;translate&amp;gt;&lt;br /&gt;
&amp;lt;!--T:1--&amp;gt;&lt;br /&gt;
'''Warning: RPi support should be considered as experimental. Be prepared to face issues if you try GIMX on the RPi.'''&lt;br /&gt;
&lt;br /&gt;
GIMX can run on many Linux targets, and the [http://www.raspberrypi.org/ the Raspberry Pi] is one of them!&lt;br /&gt;
== Hardware considerations == &amp;lt;!--T:23--&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:24--&amp;gt;&lt;br /&gt;
Use a USB HUB only if there are no ports available on the RPi.&amp;lt;br /&amp;gt;&lt;br /&gt;
It is highly recommended to use a HUB with an external power supply.&lt;br /&gt;
&lt;br /&gt;
== Firmware update == &amp;lt;!--T:5--&amp;gt;&lt;br /&gt;
As early firmwares had severe USB issues it is recommended to update the firmware before using GIMX.&amp;lt;br /&amp;gt;&lt;br /&gt;
Updating the firmware may also be useful if you plan to use a Logitech force feedback wheel (the uhid kernel module was missing in earlier firmwares).&amp;lt;br /&amp;gt;&lt;br /&gt;
Type the following command:&lt;br /&gt;
&amp;lt;pre&amp;gt;sudo rpi-update&lt;br /&gt;
sudo reboot&amp;lt;/pre&amp;gt;&lt;br /&gt;
If you have issues with the latest firmware, install the following instead:&lt;br /&gt;
&amp;lt;pre&amp;gt;sudo rpi-update 771a503cfc2a1130e2df2a4ddfc45ffa0f592b3f&lt;br /&gt;
sudo reboot&amp;lt;/pre&amp;gt;&lt;br /&gt;
Tested Rpi firmware:&lt;br /&gt;
&amp;lt;pre&amp;gt;pi@raspberrypi ~ $ uname -a&lt;br /&gt;
Linux raspberrypi 4.1.21+ #873 Mon Apr 11 18:00:37 BST 2016 armv6l GNU/Linux&amp;lt;/pre&amp;gt;&lt;br /&gt;
&amp;lt;!--== UHID kernel module ==&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:27--&amp;gt;&lt;br /&gt;
If you plan to use a Logitech force feedback wheel, you will have to build the uhid.ko module for your kernel.&amp;lt;br /&amp;gt;&lt;br /&gt;
Install the right version of gcc, as explained here: [https://github.com/notro/rpi-source/wiki link].&amp;lt;br /&amp;gt;&lt;br /&gt;
Update your kernel:&lt;br /&gt;
&amp;lt;pre&amp;gt;sudo rpi-update&amp;lt;/pre&amp;gt;&lt;br /&gt;
In case the kernel was updated, reboot:&lt;br /&gt;
&amp;lt;pre&amp;gt;sudo reboot&amp;lt;/pre&amp;gt;&lt;br /&gt;
Install the rpi-source tool:&lt;br /&gt;
&amp;lt;pre&amp;gt;sudo wget https://raw.githubusercontent.com/notro/rpi-source/master/rpi-source -O /usr/bin/rpi-source &amp;amp;&amp;amp; sudo chmod +x /usr/bin/rpi-source &amp;amp;&amp;amp; /usr/bin/rpi-source -q --tag-update&amp;lt;/pre&amp;gt;&lt;br /&gt;
Run rpi-source:&lt;br /&gt;
&amp;lt;pre&amp;gt;rpi-source&amp;lt;/pre&amp;gt;&lt;br /&gt;
This step may take a while to complete.&amp;lt;br /&amp;gt;&lt;br /&gt;
Install ncurses:&lt;br /&gt;
&amp;lt;pre&amp;gt;sudo apt-get install libncurses5-dev&amp;lt;/pre&amp;gt;&lt;br /&gt;
Enable the UHID module compilation:&lt;br /&gt;
&amp;lt;pre&amp;gt;cd linux&lt;br /&gt;
make menuconfig&amp;lt;/pre&amp;gt;&lt;br /&gt;
Select Device Drivers&amp;gt;HID support&amp;gt;User-space I/O driver support for HID subsystem. The line should start with '&amp;lt;M&amp;gt;'.&amp;lt;br /&amp;gt;&lt;br /&gt;
To speed up the compilation, you can disable all other modules in the HID support section and subsections.&amp;lt;br /&amp;gt;&lt;br /&gt;
Save the config to the default location and exit.&amp;lt;br /&amp;gt;&lt;br /&gt;
Build the module:&lt;br /&gt;
&amp;lt;pre&amp;gt;make prepare&lt;br /&gt;
make scripts&lt;br /&gt;
make M=drivers/hid&amp;lt;/pre&amp;gt;&lt;br /&gt;
Install it:&lt;br /&gt;
&amp;lt;pre&amp;gt;sudo cp drivers/hid/uhid.ko /lib/modules/`uname -r`/kernel/drivers/hid/&lt;br /&gt;
sudo depmod -a&amp;lt;/pre&amp;gt;--&amp;gt;&lt;br /&gt;
&amp;lt;!--mkdir dest&lt;br /&gt;
make INSTALL_HDR_PATH=dest headers_install&lt;br /&gt;
sudo cp dest/include/linux/uhid.h /usr/include/linux/--&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== USB adapter using the on-board UART interface == &amp;lt;!--T:6--&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Hardware requirements === &amp;lt;!--T:25--&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:26--&amp;gt;&lt;br /&gt;
The on-board UART runs at 0V/3.3V levels, and the AVR USB board has to run at 5V to operate at 16MHz (running at 3.3V would only allow to operate at 8MHz).&amp;lt;br /&amp;gt;&lt;br /&gt;
Connecting the RPi and the AVR USB board directly may damage the hardware!&amp;lt;br /&amp;gt;&lt;br /&gt;
One cheap solution is to use a voltage divider:&amp;lt;br /&amp;gt;&lt;br /&gt;
* Connect both GNDs&lt;br /&gt;
* It's safe to connect the TXD pin of the RPi to the Rx pin of the AVR USB board (the GIMX firmwares configure the Rx pin as an input)&lt;br /&gt;
* To connect the Tx pin of the AVR USB board to the RXD pin of the RPi, you'll need to convert the voltage level from 0..5V to 0..3.3V.&amp;lt;br /&amp;gt;&lt;br /&gt;
This can be done with a simple resistive divider:&lt;br /&gt;
&amp;lt;div class=&amp;quot;image200px&amp;quot;&amp;gt;[https://gimx.fr/img/wiki/Resistive_divider.png https://gimx.fr/img/wiki/Resistive_divider.png]&amp;lt;/div&amp;gt;&lt;br /&gt;
Vin is the Tx pin of the AVR USB board, Vout is the RXD pin of the RPi, R1=2.2kΩ , R2=3.3kΩ&lt;br /&gt;
* Do not connect any other pin!&lt;br /&gt;
&lt;br /&gt;
=== Sotware adjustments === &amp;lt;!--T:15--&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:17--&amp;gt;&lt;br /&gt;
By default, the RPi UART is configured as a serial console.&amp;lt;br /&amp;gt;&lt;br /&gt;
Disable this serial console using raspi-config:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
sudo raspi-config &lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
Then select:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
&amp;quot;Advanced Options&amp;quot;, &amp;quot;Serial&amp;quot;, &amp;quot;No&amp;quot;, &amp;quot;Finish&amp;quot;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
The default configuration does not allow high baudrates.&amp;lt;br /&amp;gt;&lt;br /&gt;
Enable high baudrates editing /boot/config.txt:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
sudo nano /boot/config.txt&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
Add the following line at the end of the file:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
init_uart_clock=8000000 &lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
Reboot to apply the changes:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
sudo reboot&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== GIMX installation == &amp;lt;!--T:7--&amp;gt;&lt;br /&gt;
&amp;lt;pre&amp;gt;wget https://gimx.fr/download/gimx-raspbian -O gimx.deb&lt;br /&gt;
sudo dpkg -i gimx.deb&lt;br /&gt;
sudo apt-get -f install&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:8--&amp;gt;&lt;br /&gt;
If you get a &amp;quot;Dependency is not satisfiable: ...&amp;quot; error message, upgrade Raspbian:&lt;br /&gt;
&amp;lt;pre&amp;gt;sudo apt-get update &amp;amp;&amp;amp; sudo apt-get upgrade&lt;br /&gt;
sudo apt-get -f install&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Stop/disable triggerhappy service == &amp;lt;!--T:9--&amp;gt;&lt;br /&gt;
[https://github.com/wertarbyte/triggerhappy/blob/master/README Triggerhappy] is a daemon that opens every input device for reading, and that consumes a few percent of the CPU time.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:10--&amp;gt;&lt;br /&gt;
It seems a good idea to stop it while running GIMX.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:11--&amp;gt;&lt;br /&gt;
To stop triggerhappy:&lt;br /&gt;
 sudo service triggerhappy stop&lt;br /&gt;
To disable triggerhappy:&lt;br /&gt;
 sudo update-rc.d triggerhappy disable&lt;br /&gt;
&lt;br /&gt;
== Run GIMX == &amp;lt;!--T:12--&amp;gt;&lt;br /&gt;
Read the [[Quick_Start|Quick start page]] to learn how to run GIMX through the GUI.&amp;lt;br /&amp;gt;&lt;br /&gt;
&lt;br /&gt;
A good idea is to run GIMX directly from a terminal, without starting a graphical session, which can be done over the network, using a ssh client, or you can [[#Autostart GIMX at boot without GUI]]&amp;lt;br /&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Ideally, GIMX should be launched without using the Ethernet port (because it is connected on the USB bus). However, this doesn't seem to cause any issues generally.&amp;lt;br /&amp;gt;&lt;br /&gt;
&lt;br /&gt;
More details on command line options on [[Command_line|this page]].&amp;lt;br /&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The GUI will help you download the config xmls. If you never run the GUI, you MUST grab the Linux config xmls from here: https://github.com/matlo/GIMX-configurations/tree/master/Linux  The Windows xmls are NOT compatible!&amp;lt;br /&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Autostart GIMX at boot without GUI == &amp;lt;!--T:28--&amp;gt;&lt;br /&gt;
Simply create a file /etc/systemd/system/gimx.service (as root): &lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
sudo nano /etc/systemd/system/gimx.service&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
With the following contents:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:29--&amp;gt;&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
[Unit]&lt;br /&gt;
Description=GIMX  &lt;br /&gt;
After=syslog.target network.target&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:30--&amp;gt;&lt;br /&gt;
[Service]&lt;br /&gt;
User=pi  &lt;br /&gt;
Type=simple  &lt;br /&gt;
# Replace /dev/ttyUSB0 with /dev/ttyAMA0 when using the on-board UART interface&lt;br /&gt;
ExecStart=/usr/bin/gimx -p /dev/ttyUSB0 -c LogitechDrivingForceGT_G29.xml --nograb  &lt;br /&gt;
Restart=always  &lt;br /&gt;
RestartSec=5&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:31--&amp;gt;&lt;br /&gt;
[Install]&lt;br /&gt;
WantedBy=multi-user.target&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:32--&amp;gt;&lt;br /&gt;
Replace ttyUSB0 with your device (/dev/ttyAMA0 when using the on-board UART interface) and LogitechDrivingForceGT_G29.xml with your mapping file (which should be available in the pi home directory as /home/pi/.gimx/config/LogitechDrivingForceGT_G29.xml)&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:33--&amp;gt;&lt;br /&gt;
Run &amp;lt;pre&amp;gt;sudo systemctl daemon-reload&amp;lt;/pre&amp;gt; to notify systemd about the new file and &amp;lt;pre&amp;gt;sudo systemctl enable gimx &amp;amp;&amp;amp; sudo systemctl start gimx&amp;lt;/pre&amp;gt; to enable the gimx service start at boot and start it in the same line.&lt;br /&gt;
&lt;br /&gt;
== Notify when GIMX is running using a led == &amp;lt;!--T:34--&amp;gt;&lt;br /&gt;
In order to have a proper confirmation about if the gimx service is up and running, you can add a simple python script that turns a led on if the gimx service is running.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:35--&amp;gt;&lt;br /&gt;
The file will be located at /home/pi/blink.py:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;sudo nano blink.py&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:36--&amp;gt;&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
#!/usr/bin/python&lt;br /&gt;
import os  &lt;br /&gt;
import time  &lt;br /&gt;
import RPi.GPIO as GPIO&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:37--&amp;gt;&lt;br /&gt;
led = 23  &lt;br /&gt;
button = 18  &lt;br /&gt;
GPIO.setmode(GPIO.BCM)  &lt;br /&gt;
GPIO.setup(led, GPIO.OUT)  &lt;br /&gt;
GPIO.setup(button, GPIO.IN, pull_up_down = GPIO.PUD_UP)&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:38--&amp;gt;&lt;br /&gt;
def Shutdown(channel):  &lt;br /&gt;
  GPIO.output(led, True)&lt;br /&gt;
  time.sleep(0.2)&lt;br /&gt;
  GPIO.output(led, False)&lt;br /&gt;
  time.sleep(0.2)&lt;br /&gt;
  GPIO.output(led, True)&lt;br /&gt;
  time.sleep(0.2)&lt;br /&gt;
  GPIO.output(led, False)&lt;br /&gt;
  os.system(&amp;quot;sudo shutdown -h now&amp;quot;)&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:39--&amp;gt;&lt;br /&gt;
GPIO.add_event_detect(18, GPIO.FALLING, callback = Shutdown, bouncetime = 2000)&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:40--&amp;gt;&lt;br /&gt;
while True:  &lt;br /&gt;
  found = False&lt;br /&gt;
  time.sleep(5)&lt;br /&gt;
  pids = [pid for pid in os.listdir('/proc') if pid.isdigit()]&lt;br /&gt;
  for pid in pids:&lt;br /&gt;
    try:&lt;br /&gt;
      cmd = open(os.path.join('/proc', pid, 'cmdline'), 'rb').read()&lt;br /&gt;
      if &amp;quot;gimx&amp;quot; in cmd:&lt;br /&gt;
        found = True&lt;br /&gt;
    except IOError: # proc has already terminated&lt;br /&gt;
      continue&lt;br /&gt;
  if found == True:&lt;br /&gt;
    GPIO.output(led, True)&lt;br /&gt;
  else:&lt;br /&gt;
    GPIO.output(led, False)&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:41--&amp;gt;&lt;br /&gt;
As a bonus, you can add a button so when it is pressed, there is a little blink effect, and the pi is shutted down.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:42--&amp;gt;&lt;br /&gt;
&amp;lt;div class=&amp;quot;image200px&amp;quot;&amp;gt;[https://gimx.fr/img/wiki/PiButtonLed.png https://gimx.fr/img/wiki/PiButtonLed.png]&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:43--&amp;gt;&lt;br /&gt;
To start at boot, simply add it to the pi user crontab (crontab -e) as &amp;lt;pre&amp;gt;@reboot python /home/pi/blink.py &amp;amp;&amp;lt;/pre&amp;gt;&lt;br /&gt;
&amp;lt;/translate&amp;gt;&lt;/div&gt;</summary>
		<author><name>Steel 3d</name></author>
		
	</entry>
	<entry>
		<id>https://gimx.fr/wiki/index.php?title=RPi&amp;diff=5270</id>
		<title>RPi</title>
		<link rel="alternate" type="text/html" href="https://gimx.fr/wiki/index.php?title=RPi&amp;diff=5270"/>
		<updated>2016-12-14T10:49:25Z</updated>

		<summary type="html">&lt;p&gt;Steel 3d: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&amp;lt;languages /&amp;gt;&lt;br /&gt;
&amp;lt;translate&amp;gt;&lt;br /&gt;
&amp;lt;!--T:1--&amp;gt;&lt;br /&gt;
'''Warning: RPi support should be considered as experimental. Be prepared to face issues if you try GIMX on the RPi.'''&lt;br /&gt;
&lt;br /&gt;
GIMX can run on many Linux targets, and the [http://www.raspberrypi.org/ the Raspberry Pi] is one of them!&lt;br /&gt;
== Hardware considerations == &amp;lt;!--T:23--&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:24--&amp;gt;&lt;br /&gt;
Use a USB HUB only if there are no ports available on the RPi.&amp;lt;br /&amp;gt;&lt;br /&gt;
It is highly recommended to use a HUB with an external power supply.&lt;br /&gt;
&lt;br /&gt;
== Firmware update == &amp;lt;!--T:5--&amp;gt;&lt;br /&gt;
As early firmwares had severe USB issues it is recommended to update the firmware before using GIMX.&amp;lt;br /&amp;gt;&lt;br /&gt;
Updating the firmware may also be useful if you plan to use a Logitech force feedback wheel (the uhid kernel module was missing in earlier firmwares).&amp;lt;br /&amp;gt;&lt;br /&gt;
Type the following command:&lt;br /&gt;
&amp;lt;pre&amp;gt;sudo rpi-update&lt;br /&gt;
sudo reboot&amp;lt;/pre&amp;gt;&lt;br /&gt;
If you have issues with the latest firmware, install the following instead:&lt;br /&gt;
&amp;lt;pre&amp;gt;sudo rpi-update 771a503cfc2a1130e2df2a4ddfc45ffa0f592b3f&lt;br /&gt;
sudo reboot&amp;lt;/pre&amp;gt;&lt;br /&gt;
Tested Rpi firmware:&lt;br /&gt;
&amp;lt;pre&amp;gt;pi@raspberrypi ~ $ uname -a&lt;br /&gt;
Linux raspberrypi 4.1.21+ #873 Mon Apr 11 18:00:37 BST 2016 armv6l GNU/Linux&amp;lt;/pre&amp;gt;&lt;br /&gt;
&amp;lt;!--== UHID kernel module ==&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:27--&amp;gt;&lt;br /&gt;
If you plan to use a Logitech force feedback wheel, you will have to build the uhid.ko module for your kernel.&amp;lt;br /&amp;gt;&lt;br /&gt;
Install the right version of gcc, as explained here: [https://github.com/notro/rpi-source/wiki link].&amp;lt;br /&amp;gt;&lt;br /&gt;
Update your kernel:&lt;br /&gt;
&amp;lt;pre&amp;gt;sudo rpi-update&amp;lt;/pre&amp;gt;&lt;br /&gt;
In case the kernel was updated, reboot:&lt;br /&gt;
&amp;lt;pre&amp;gt;sudo reboot&amp;lt;/pre&amp;gt;&lt;br /&gt;
Install the rpi-source tool:&lt;br /&gt;
&amp;lt;pre&amp;gt;sudo wget https://raw.githubusercontent.com/notro/rpi-source/master/rpi-source -O /usr/bin/rpi-source &amp;amp;&amp;amp; sudo chmod +x /usr/bin/rpi-source &amp;amp;&amp;amp; /usr/bin/rpi-source -q --tag-update&amp;lt;/pre&amp;gt;&lt;br /&gt;
Run rpi-source:&lt;br /&gt;
&amp;lt;pre&amp;gt;rpi-source&amp;lt;/pre&amp;gt;&lt;br /&gt;
This step may take a while to complete.&amp;lt;br /&amp;gt;&lt;br /&gt;
Install ncurses:&lt;br /&gt;
&amp;lt;pre&amp;gt;sudo apt-get install libncurses5-dev&amp;lt;/pre&amp;gt;&lt;br /&gt;
Enable the UHID module compilation:&lt;br /&gt;
&amp;lt;pre&amp;gt;cd linux&lt;br /&gt;
make menuconfig&amp;lt;/pre&amp;gt;&lt;br /&gt;
Select Device Drivers&amp;gt;HID support&amp;gt;User-space I/O driver support for HID subsystem. The line should start with '&amp;lt;M&amp;gt;'.&amp;lt;br /&amp;gt;&lt;br /&gt;
To speed up the compilation, you can disable all other modules in the HID support section and subsections.&amp;lt;br /&amp;gt;&lt;br /&gt;
Save the config to the default location and exit.&amp;lt;br /&amp;gt;&lt;br /&gt;
Build the module:&lt;br /&gt;
&amp;lt;pre&amp;gt;make prepare&lt;br /&gt;
make scripts&lt;br /&gt;
make M=drivers/hid&amp;lt;/pre&amp;gt;&lt;br /&gt;
Install it:&lt;br /&gt;
&amp;lt;pre&amp;gt;sudo cp drivers/hid/uhid.ko /lib/modules/`uname -r`/kernel/drivers/hid/&lt;br /&gt;
sudo depmod -a&amp;lt;/pre&amp;gt;--&amp;gt;&lt;br /&gt;
&amp;lt;!--mkdir dest&lt;br /&gt;
make INSTALL_HDR_PATH=dest headers_install&lt;br /&gt;
sudo cp dest/include/linux/uhid.h /usr/include/linux/--&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== USB adapter using the on-board UART interface == &amp;lt;!--T:6--&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Hardware requirements === &amp;lt;!--T:25--&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:26--&amp;gt;&lt;br /&gt;
The on-board UART runs at 0V/3.3V levels, and the AVR USB board has to run at 5V to operate at 16MHz (running at 3.3V would only allow to operate at 8MHz).&amp;lt;br /&amp;gt;&lt;br /&gt;
Connecting the RPi and the AVR USB board directly may damage the hardware!&amp;lt;br /&amp;gt;&lt;br /&gt;
One cheap solution is to use a voltage divider:&amp;lt;br /&amp;gt;&lt;br /&gt;
* Connect both GNDs&lt;br /&gt;
* It's safe to connect the TXD pin of the RPi to the Rx pin of the AVR USB board (the GIMX firmwares configure the Rx pin as an input)&lt;br /&gt;
* To connect the Tx pin of the AVR USB board to the RXD pin of the RPi, you'll need to convert the voltage level from 0..5V to 0..3.3V.&amp;lt;br /&amp;gt;&lt;br /&gt;
This can be done with a simple resistive divider:&lt;br /&gt;
&amp;lt;div class=&amp;quot;image200px&amp;quot;&amp;gt;[https://gimx.fr/img/wiki/Resistive_divider.png https://gimx.fr/img/wiki/Resistive_divider.png]&amp;lt;/div&amp;gt;&lt;br /&gt;
Vin is the Tx pin of the AVR USB board, Vout is the RXD pin of the RPi, R1=2.2kΩ , R2=3.3kΩ&lt;br /&gt;
* Do not connect any other pin!&lt;br /&gt;
&lt;br /&gt;
=== Sotware adjustments === &amp;lt;!--T:15--&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:17--&amp;gt;&lt;br /&gt;
By default, the RPi UART is configured as a serial console.&amp;lt;br /&amp;gt;&lt;br /&gt;
Disable this serial console using raspi-config:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
sudo raspi-config &lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
Then select:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
&amp;quot;Advanced Options&amp;quot;, &amp;quot;Serial&amp;quot;, &amp;quot;No&amp;quot;, &amp;quot;Finish&amp;quot;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
The default configuration does not allow high baudrates.&amp;lt;br /&amp;gt;&lt;br /&gt;
Enable high baudrates editing /boot/config.txt:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
sudo nano /boot/config.txt&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
Add the following line at the end of the file:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
init_uart_clock=8000000 &lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
Reboot to apply the changes:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
sudo reboot&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== GIMX installation == &amp;lt;!--T:7--&amp;gt;&lt;br /&gt;
&amp;lt;pre&amp;gt;wget https://gimx.fr/download/gimx-raspbian -O gimx.deb&lt;br /&gt;
sudo dpkg -i gimx.deb&lt;br /&gt;
sudo apt-get -f install&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:8--&amp;gt;&lt;br /&gt;
If you get a &amp;quot;Dependency is not satisfiable: ...&amp;quot; error message, upgrade Raspbian:&lt;br /&gt;
&amp;lt;pre&amp;gt;sudo apt-get update &amp;amp;&amp;amp; sudo apt-get upgrade&lt;br /&gt;
sudo apt-get -f install&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Stop/disable triggerhappy service == &amp;lt;!--T:9--&amp;gt;&lt;br /&gt;
[https://github.com/wertarbyte/triggerhappy/blob/master/README Triggerhappy] is a daemon that opens every input device for reading, and that consumes a few percent of the CPU time.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:10--&amp;gt;&lt;br /&gt;
It seems a good idea to stop it while running GIMX.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:11--&amp;gt;&lt;br /&gt;
To stop triggerhappy:&lt;br /&gt;
 sudo service triggerhappy stop&lt;br /&gt;
To disable triggerhappy:&lt;br /&gt;
 sudo update-rc.d triggerhappy disable&lt;br /&gt;
&lt;br /&gt;
== Run GIMX == &amp;lt;!--T:12--&amp;gt;&lt;br /&gt;
Read the [[Quick_Start|Quick start page]] to learn how to run GIMX through the GUI.&amp;lt;br /&amp;gt;&lt;br /&gt;
&lt;br /&gt;
A good idea is to run GIMX directly from a terminal, without starting a graphical session, which can be done over the network, using a ssh client, or you can [[#Autostart GIMX at boot without GUI]]&amp;lt;br /&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Ideally, GIMX should be launched without using the Ethernet port (because it is connected on the USB bus). However, this doesn't seem to cause any issues generally.&amp;lt;br /&amp;gt;&lt;br /&gt;
&lt;br /&gt;
More details on command line options on [[Command_line|this page]].&amp;lt;br /&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The GUI will help you download the config xmls. If you never run the GUI, you MUST grab the Linux config xmls from here: https://github.com/matlo/GIMX-configurations/tree/master/Linux  The Windows xmls are NOT compatible!&amp;lt;br /&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Autostart GIMX at boot without GUI == &amp;lt;!--T:28--&amp;gt;&lt;br /&gt;
Simply create a file /etc/systemd/system/gimx.service (as root): &lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
sudo nano /etc/systemd/system/gimx.service&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
With the following contents:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:29--&amp;gt;&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
[Unit]&lt;br /&gt;
Description=GIMX  &lt;br /&gt;
After=syslog.target network.target&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:30--&amp;gt;&lt;br /&gt;
[Service]&lt;br /&gt;
User=pi  &lt;br /&gt;
Type=simple  &lt;br /&gt;
# Replace /dev/ttyUSB0 with /dev/ttyAMA0 when using the on-board UART interface&lt;br /&gt;
ExecStart=/usr/bin/gimx -p /dev/ttyUSB0 -c LogitechDrivingForceGT_G29.xml --nograb  &lt;br /&gt;
Restart=always  &lt;br /&gt;
RestartSec=5&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:31--&amp;gt;&lt;br /&gt;
[Install]&lt;br /&gt;
WantedBy=multi-user.target&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:32--&amp;gt;&lt;br /&gt;
Replace ttyUSB0 with your device (/dev/ttyAMA0 when using the on-board UART interface) and LogitechDrivingForceGT_G29.xml with your mapping file (which should be available in the pi home directory as /home/pi/.gimx/config/LogitechDrivingForceGT_G29.xml)&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:33--&amp;gt;&lt;br /&gt;
Run &amp;lt;pre&amp;gt;sudo systemctl daemon-reload&amp;lt;/pre&amp;gt; to notify systemd about the new file and &amp;lt;pre&amp;gt;sudo systemctl enable gimx &amp;amp;&amp;amp; sudo systemctl start gimx&amp;lt;/pre&amp;gt; to enable the gimx service start at boot and start it in the same line.&lt;br /&gt;
&lt;br /&gt;
== Notify when GIMX is running using a led == &amp;lt;!--T:34--&amp;gt;&lt;br /&gt;
In order to have a proper confirmation about if the gimx service is up and running, you can add a simple python script that turns a led on if the gimx service is running.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:35--&amp;gt;&lt;br /&gt;
The file will be located at /home/pi/blink.py:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:36--&amp;gt;&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
#!/usr/bin/python&lt;br /&gt;
import os  &lt;br /&gt;
import time  &lt;br /&gt;
import RPi.GPIO as GPIO&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:37--&amp;gt;&lt;br /&gt;
led = 23  &lt;br /&gt;
button = 18  &lt;br /&gt;
GPIO.setmode(GPIO.BCM)  &lt;br /&gt;
GPIO.setup(led, GPIO.OUT)  &lt;br /&gt;
GPIO.setup(button, GPIO.IN, pull_up_down = GPIO.PUD_UP)&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:38--&amp;gt;&lt;br /&gt;
def Shutdown(channel):  &lt;br /&gt;
  GPIO.output(led, True)&lt;br /&gt;
  time.sleep(0.2)&lt;br /&gt;
  GPIO.output(led, False)&lt;br /&gt;
  time.sleep(0.2)&lt;br /&gt;
  GPIO.output(led, True)&lt;br /&gt;
  time.sleep(0.2)&lt;br /&gt;
  GPIO.output(led, False)&lt;br /&gt;
  os.system(&amp;quot;sudo shutdown -h now&amp;quot;)&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:39--&amp;gt;&lt;br /&gt;
GPIO.add_event_detect(18, GPIO.FALLING, callback = Shutdown, bouncetime = 2000)&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:40--&amp;gt;&lt;br /&gt;
while True:  &lt;br /&gt;
  found = False&lt;br /&gt;
  time.sleep(5)&lt;br /&gt;
  pids = [pid for pid in os.listdir('/proc') if pid.isdigit()]&lt;br /&gt;
  for pid in pids:&lt;br /&gt;
    try:&lt;br /&gt;
      cmd = open(os.path.join('/proc', pid, 'cmdline'), 'rb').read()&lt;br /&gt;
      if &amp;quot;gimx&amp;quot; in cmd:&lt;br /&gt;
        found = True&lt;br /&gt;
    except IOError: # proc has already terminated&lt;br /&gt;
      continue&lt;br /&gt;
  if found == True:&lt;br /&gt;
    GPIO.output(led, True)&lt;br /&gt;
  else:&lt;br /&gt;
    GPIO.output(led, False)&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:41--&amp;gt;&lt;br /&gt;
As a bonus, you can add a button so when it is pressed, there is a little blink effect, and the pi is shutted down.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:42--&amp;gt;&lt;br /&gt;
&amp;lt;div class=&amp;quot;image200px&amp;quot;&amp;gt;[https://gimx.fr/img/wiki/PiButtonLed.png https://gimx.fr/img/wiki/PiButtonLed.png]&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:43--&amp;gt;&lt;br /&gt;
To start at boot, simply add it to the pi user crontab (crontab -e) as &amp;lt;pre&amp;gt;@reboot python /home/pi/blink.py &amp;amp;&amp;lt;/pre&amp;gt;&lt;br /&gt;
&amp;lt;/translate&amp;gt;&lt;/div&gt;</summary>
		<author><name>Steel 3d</name></author>
		
	</entry>
	<entry>
		<id>https://gimx.fr/wiki/index.php?title=DIY_USB_adapter&amp;diff=5269</id>
		<title>DIY USB adapter</title>
		<link rel="alternate" type="text/html" href="https://gimx.fr/wiki/index.php?title=DIY_USB_adapter&amp;diff=5269"/>
		<updated>2016-12-14T05:35:53Z</updated>

		<summary type="html">&lt;p&gt;Steel 3d: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&amp;lt;languages /&amp;gt;&lt;br /&gt;
&amp;lt;translate&amp;gt;&amp;lt;!--T:1--&amp;gt;&lt;br /&gt;
This page explains how to build a GIMX DIY USB adapter.&amp;lt;br /&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:22--&amp;gt;&lt;br /&gt;
'''A much easier but less complete tutorial is also available: [[DIY_USB_adapter_for_dummies|DIY USB Adapter for dummies]].'''&amp;lt;br /&amp;gt;&lt;br /&gt;
A German translation of a previous version is also available on the forum: [https://forum.gimx.fr/viewtopic.php?f=4&amp;amp;t=362 old German translation].&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:2--&amp;gt;&lt;br /&gt;
Warning: you are responsible for the hardware you buy, and anything right or wrong you do with this.&lt;br /&gt;
&lt;br /&gt;
==Required hardware parts== &amp;lt;!--T:3--&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== USB to serial TTL converter === &amp;lt;!--T:4--&amp;gt;&lt;br /&gt;
Make sure it works at '''500kbps''' and that it is '''5V tolerant'''.&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
| chip || CP2102 || FT232R || PL2303HX || CH340 || FT230X&lt;br /&gt;
|-&lt;br /&gt;
| 5V tolerant&lt;br /&gt;
| style=&amp;quot;background: green; color: white;&amp;quot; | yes&lt;br /&gt;
| style=&amp;quot;background: orange; color: white;&amp;quot; | (1)&lt;br /&gt;
| style=&amp;quot;background: orange; color: white;&amp;quot; | (1)&lt;br /&gt;
| style=&amp;quot;background: orange; color: white;&amp;quot; | (1)&lt;br /&gt;
| style=&amp;quot;background: green; color: white;&amp;quot; | yes&lt;br /&gt;
|-&lt;br /&gt;
| 500 kbps&lt;br /&gt;
| style=&amp;quot;background: green; color: white;&amp;quot; | yes&lt;br /&gt;
| style=&amp;quot;background: green; color: white;&amp;quot; | yes&lt;br /&gt;
| style=&amp;quot;background: orange; color: white;&amp;quot; | (2)&lt;br /&gt;
| style=&amp;quot;background: red; color: white;&amp;quot; | no&lt;br /&gt;
| style=&amp;quot;background: green; color: white;&amp;quot; | yes&lt;br /&gt;
|-&lt;br /&gt;
|&lt;br /&gt;
|-&lt;br /&gt;
| compatible&lt;br /&gt;
| style=&amp;quot;background: green; color: white;&amp;quot; | yes&lt;br /&gt;
| style=&amp;quot;background: orange; color: white;&amp;quot; | (1)&lt;br /&gt;
| style=&amp;quot;background: orange; color: white;&amp;quot; | (1)(2)&lt;br /&gt;
| style=&amp;quot;background: red; color: white;&amp;quot; | no&lt;br /&gt;
| style=&amp;quot;background: green; color: white;&amp;quot; | yes&lt;br /&gt;
|}&lt;br /&gt;
(1) depends on the board&amp;lt;br /&amp;gt;&lt;br /&gt;
(2) only on Linux&amp;lt;br /&amp;gt;&lt;br /&gt;
Examples:&lt;br /&gt;
* [http://jim.sh/ftx/ MicroFTX (10$ excl. shipping costs)]&lt;br /&gt;
* [http://www.ebay.com/sch/i.html?_odkw=cp2102&amp;amp;LH_BIN=1&amp;amp;_sop=15&amp;amp;_osacat=0&amp;amp;_from=R40&amp;amp;LH_PrefLoc=2&amp;amp;_from=R40&amp;amp;_trksid=p2045573.m570.l1313.TR0.TRC0.H0.Xcp2102+-pl2303&amp;amp;_nkw=cp2102+-pl2303&amp;amp;_sacat=0 CP2102 converters on ebay (as low as 3$)]&lt;br /&gt;
* [http://www.ebay.com/sch/i.html?_odkw=ft232+-cp2102+-ssop&amp;amp;LH_BIN=1&amp;amp;_sop=15&amp;amp;_osacat=0&amp;amp;_from=R40&amp;amp;LH_PrefLoc=2&amp;amp;_from=R40&amp;amp;_trksid=p2045573.m570.l1313.TR0.TRC0.H0.Xft232+-cp2102+-pl2303+-ssop&amp;amp;_nkw=ft232+-cp2102+-pl2303+-ssop&amp;amp;_sacat=0 FT232R converters on ebay (as low as 4$)]&lt;br /&gt;
* [http://www.sparkfun.com/products/198 CP2102 converter at sparkfun (22$ excl. shipping costs)]&lt;br /&gt;
* [http://www.sparkfun.com/products/718 FT232R converter at sparkfun (15$ excl. shipping costs)]&lt;br /&gt;
* Some devices like the arduino have an on-board usb to serial chip (remove the AVR chip to use it)&lt;br /&gt;
* A second usb development board can also be programmed as a usb to serial converter.&lt;br /&gt;
&lt;br /&gt;
=== AVR USB development board === &amp;lt;!--T:5--&amp;gt;&lt;br /&gt;
Make sure it is '''working at 5V''' and that is has a chip among the following: at90usb82, at90usb162, at90usb646, at90usb647, at90usb1286, at90usb1287, atmega16u2, atmega32u2, atmega16u4, atmega32u4&amp;lt;br /&amp;gt;&lt;br /&gt;
Examples:&lt;br /&gt;
* [http://www.pjrc.com/store/teensy.html Teensy 2.0 board (atmega32u4, 16$ excl. shipping costs)] (to build a solderless adapter, take a board [http://www.pjrc.com/store/teensy_pins.html with header pins]) (newer Teensy 3.x and LC boards are NOT compatible as they do not have the same chip)&lt;br /&gt;
* Boards used for the psgroove hack (check the on-board chip).&lt;br /&gt;
* Arduino-compatible boards based on the atmega32u4 chip&lt;br /&gt;
** [http://arduino.cc/en/Main/ArduinoBoardLeonardo Arduino Leonardo] - [http://arduino.cc/en/Main/Buy distributors] - (cheap Chinese clones can be found on ebay for 11$ incl. shipping costs)&lt;br /&gt;
** [http://www.ebay.com/sch/i.html?_sop=15&amp;amp;_from=R40&amp;amp;_sacat=0&amp;amp;_nkw=pro+micro+atmega32u4+-atmega328&amp;amp;LH_PrefLoc=2&amp;amp;rt=nc&amp;amp;LH_BIN=1 Cheap atmega32u4 boards on ebay] (about 4$). Soldering required.&lt;br /&gt;
&lt;br /&gt;
=== Recommended setup === &amp;lt;!--T:7--&amp;gt;&lt;br /&gt;
* CP2102 converter from ebay (very low price, but sometimes low delivery)&lt;br /&gt;
* Teensy 2.0 board (low price, good quality, and quick delivery).&lt;br /&gt;
&lt;br /&gt;
==Wiring== &amp;lt;!--T:12--&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:13--&amp;gt;&lt;br /&gt;
The only thing you have to do is to connect the following pins:&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
| USB dev board || USB to UART board&lt;br /&gt;
|-&lt;br /&gt;
| GND     || GND&lt;br /&gt;
|-&lt;br /&gt;
| RX     || TX / TXO / TXD&lt;br /&gt;
|-&lt;br /&gt;
| TX     || RX / RXI / RXD&lt;br /&gt;
|}&lt;br /&gt;
'''Warning: some adapters are mislabeled and have inverted RX/TX.'''&amp;lt;br /&amp;gt;&lt;br /&gt;
With a Teensy 2.0 or Arduino Leonardo as a USB dev board:&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
| Arduino Leonardo || Teensy 2.0 || USB to UART board&lt;br /&gt;
|-&lt;br /&gt;
| GND              || GND        || GND&lt;br /&gt;
|-&lt;br /&gt;
| 0 (RX1)          || D2         || TX / TXO / TXD&lt;br /&gt;
|-&lt;br /&gt;
| 1 (TX1)          || D3         || RX / RXI / RXD&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:23--&amp;gt;&lt;br /&gt;
If you use the arduino on-board USB to serial converter, Rx and Tx are inverted, i.e. Rx = TX&amp;amp;#9654; and Tx = RX&amp;amp;#9664;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:14--&amp;gt;&lt;br /&gt;
The example below shows how to connect a (mislabeled) CP2102 converter (left) to a Teensy 2.0 board (right):&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:15--&amp;gt;&lt;br /&gt;
&amp;lt;div class=&amp;quot;image200px&amp;quot;&amp;gt;[https://gimx.fr/img/screenshots/PC-to-PS3-USB-controller.JPG https://gimx.fr/img/screenshots/PC-to-PS3-USB-controller.JPG]&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:16--&amp;gt;&lt;br /&gt;
It's possible to solder wires or to use jumper wires (these are generally provided with USB to serial TTL boards) in case your AVR USB board has header pins:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:17--&amp;gt;&lt;br /&gt;
&amp;lt;div class=&amp;quot;image200px&amp;quot;&amp;gt;[https://gimx.fr/img/adapter/solderless.jpg https://gimx.fr/img/adapter/solderless.jpg]&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:19--&amp;gt;&lt;br /&gt;
Examples:&lt;br /&gt;
* Bumble-b and FT232RL wired on a breadboard:&lt;br /&gt;
:&amp;lt;div class=&amp;quot;image200px&amp;quot;&amp;gt;[https://gimx.fr/img/screenshots/ft232rl_bumbleb.jpg https://gimx.fr/img/screenshots/ft232rl_bumbleb.jpg]&amp;lt;/div&amp;gt;&lt;br /&gt;
* Teensy++ and CP2102 wired on a breadboard:&lt;br /&gt;
:&amp;lt;div class=&amp;quot;image200px&amp;quot;&amp;gt;[https://gimx.fr/img/screenshots/cp2102_teensy++.jpg https://gimx.fr/img/screenshots/cp2102_teensy++.jpg]&amp;lt;/div&amp;gt;&lt;br /&gt;
* Teensy 2.0 and CP2102 soldered:&lt;br /&gt;
:&amp;lt;div class=&amp;quot;image200px&amp;quot;&amp;gt;[https://gimx.fr/img/adapter/soldered.jpg https://gimx.fr/img/adapter/soldered.jpg]&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Firmware loading== &amp;lt;!--T:8--&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:9--&amp;gt;&lt;br /&gt;
*[http://gimx.fr/download/gimx-firmwares Firmwares]&lt;br /&gt;
{{Firmwares/en}}&lt;br /&gt;
&lt;br /&gt;
===Teensy boards=== &amp;lt;!--T:24--&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:25--&amp;gt;&lt;br /&gt;
Teensy boards can be easily flashed using the [http://www.pjrc.com/teensy/loader.html Teensy Loader].&amp;lt;br /&amp;gt;&lt;br /&gt;
It is probably the easier to use flashing tool, but it is only compatible with '''genuine''' teensy boards.&lt;br /&gt;
&lt;br /&gt;
===Cheap Arduino-compatible atmega32u4-based boards=== &amp;lt;!--T:26--&amp;gt;&lt;br /&gt;
&lt;br /&gt;
====Using the Arduino Builder tool==== &amp;lt;!--T:27--&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:28--&amp;gt;&lt;br /&gt;
* The order of operations must be followed strictly, as Arduino builder is quite finicky!&lt;br /&gt;
* Download the Arduino Leonardo drivers and save them into the same folder:&lt;br /&gt;
** [https://github.com/arduino/Arduino/raw/master/build/windows/dist/drivers/arduino.cat arduino.cat]&lt;br /&gt;
** [https://github.com/arduino/Arduino/raw/master/build/windows/dist/drivers/arduino.inf arduino.inf]&lt;br /&gt;
* Right-click on the arduino.inf file and click on Install.&lt;br /&gt;
* Make sure that the USB to UART board (e.g. CP2102) is connected and powered, and that the wiring with the atmega32u4 board is correct.&lt;br /&gt;
* Make sure that the atmega32u4 board is connected and powered.&lt;br /&gt;
* Download the [http://sourceforge.net/projects/arduinodev/files/ArduinoBuilder/ArduinoBuilder-0.9.1.7z/download Arduino Builder tool] and extract the archive (using [http://www.7-zip.org/ 7zip]).&lt;br /&gt;
* Run ArduinoBuilder.exe.&lt;br /&gt;
* Click on &amp;quot;Load Sketch / HEX&amp;quot;, and select the desired atmega32u4.hex firmware.&lt;br /&gt;
* Click on &amp;quot;Board Type&amp;quot; and select &amp;quot;Arduino Leonardo&amp;quot;.&lt;br /&gt;
* Click on the COM port that matches the &amp;quot;Silicon Labs CP210x ... (COMX)&amp;quot; COM port in the device manager (or whatever the name of your USB to UART board is). This is a trick to make the Arduino Builder tool look for a new COM port. If no COM port is visible, make sure the USB adapter AND the Arduino are plugged into two separate USB ports on the PC, then close and reopen Arduino Builder.&lt;br /&gt;
* The following message should appear: &amp;quot;Forcing reset using 1200bps open/close on COMX...&amp;quot;.&lt;br /&gt;
* Quickly unplug/replug the atmega32u4 board, or connect RST to GND twice.&lt;br /&gt;
* The atmega32u4 board should run the bootloader. The Arduino builder tool should find the Arduino Leonardo COM port and flash the firmware.&lt;br /&gt;
Upon success a &amp;quot;Uploading completed!&amp;quot; message should be displayed.&amp;lt;br /&amp;gt;&lt;br /&gt;
&lt;br /&gt;
====Using Avrdude==== &amp;lt;!--T:29--&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:30--&amp;gt;&lt;br /&gt;
* Download the Arduino Leonardo drivers and save them into the same folder:&lt;br /&gt;
** [https://github.com/arduino/Arduino/raw/master/build/windows/dist/drivers/arduino.cat arduino.cat]&lt;br /&gt;
** [https://github.com/arduino/Arduino/raw/master/build/windows/dist/drivers/arduino.inf arduino.inf]&lt;br /&gt;
* Right-click on the arduino.inf file and click on Install.&lt;br /&gt;
* Make sure that the USB to UART board (e.g. CP2102) is connected and powered, and that the wiring with the atmega32u4 board is correct.&lt;br /&gt;
* Make sure that the atmega32u4 board is connected and powered.&lt;br /&gt;
* Download the [http://sourceforge.net/projects/arduinodev/files/ArduinoBuilder/ArduinoBuilder-0.9.1.7z/download Arduino Builder tool] and extract the archive (using [http://www.7-zip.org/ 7zip]).&lt;br /&gt;
* Press shift and right-click into the bin folder, and click on &amp;quot;Open command window here&amp;quot;.&lt;br /&gt;
* Type the following text but don't press enter:&lt;br /&gt;
 avrdude -p atmega32u4 -c avr109 -P COM7 -D -U flash:w:&amp;lt;path to atmega32u4.hex&amp;gt;:i&lt;br /&gt;
* Make sure to replace &amp;quot;&amp;lt;path to atmega32u4.hex&amp;gt;&amp;quot; in the command line with the location of the firmware to load (for example: C:\Users\YourUserName\Downloads\firmwares-5.0\EMUPS4\atmega32u4.hex).&lt;br /&gt;
* Move the cursor right after COM7.&lt;br /&gt;
* Open the device manager, and unfold the COM port item.&lt;br /&gt;
* Quickly unplug/replug the atmega32u4 board, or connect RST to GND twice.&lt;br /&gt;
* The atmega32u4 board should run the bootloader. As soon as you see it appearing in the device manager, change the COM port number in the CMD window and press enter.&lt;br /&gt;
* The bootloader is executed very briefly. You may have to make a few attempts before the firmware gets loaded correctly!&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:31--&amp;gt;&lt;br /&gt;
In GNU/Linux, the avrdude command is:&lt;br /&gt;
 avrdude -p atmega32u4 -c avr109 -P /dev/ttyACM0 -D -U flash:w:atmega32u4.hex:i&lt;br /&gt;
(make sure to adjust the port and the file)&lt;br /&gt;
&lt;br /&gt;
===Other tools=== &amp;lt;!--T:32--&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:10--&amp;gt;&lt;br /&gt;
There are a few other tools that can be used to load the hex file:&lt;br /&gt;
* [http://www.atmel.com/tools/FLIP.aspx Flip utility from Atmel] (not compatible with genuine teensy boards and with Arduino-compatible atmega32u4-based boards)&lt;br /&gt;
* [http://dfu-programmer.sourceforge.net/ dfu-programmer command-line tool] (not compatible with genuine teensy boards and with Arduino-compatible atmega32u4-based boards)&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:11--&amp;gt;&lt;br /&gt;
dfu-programmer example:&lt;br /&gt;
    sudo dfu-programmer at90usb162 erase&lt;br /&gt;
    sudo dfu-programmer at90usb162 flash at90usb162.hex&lt;br /&gt;
    sudo dfu-programmer at90usb162 reset&lt;br /&gt;
&lt;br /&gt;
==Serial port settings== &amp;lt;!--T:33--&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:34--&amp;gt;&lt;br /&gt;
On Windows the driver for FTDI chips (e.g. FT232R, FT230X, FT231X...) provides a &amp;quot;Latency Timer&amp;quot; setting than should be set to 1ms for optimal performance.&amp;lt;br /&amp;gt;&lt;br /&gt;
The procedure is detailed on the FTDI website: [http://www.ftdichip.com/Support/Knowledgebase/index.html?cdmcomportadvancedproperti.htm link].&lt;br /&gt;
&lt;br /&gt;
==Next Tutorial== &amp;lt;!--T:20--&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:21--&amp;gt;&lt;br /&gt;
Now that your adapter is ready you can follow the instructions on the [[Quick_Start|Quick Start page]].&lt;br /&gt;
&amp;lt;/translate&amp;gt;&lt;/div&gt;</summary>
		<author><name>Steel 3d</name></author>
		
	</entry>
	<entry>
		<id>https://gimx.fr/wiki/index.php?title=DIY_USB_adapter&amp;diff=5268</id>
		<title>DIY USB adapter</title>
		<link rel="alternate" type="text/html" href="https://gimx.fr/wiki/index.php?title=DIY_USB_adapter&amp;diff=5268"/>
		<updated>2016-12-14T05:32:28Z</updated>

		<summary type="html">&lt;p&gt;Steel 3d: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&amp;lt;languages /&amp;gt;&lt;br /&gt;
&amp;lt;translate&amp;gt;&amp;lt;!--T:1--&amp;gt;&lt;br /&gt;
This page explains how to build a GIMX DIY USB adapter.&amp;lt;br /&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:22--&amp;gt;&lt;br /&gt;
'''A much easier but less complete tutorial is also available: [[DIY_USB_adapter_for_dummies|DIY USB Adapter for dummies]].'''&amp;lt;br /&amp;gt;&lt;br /&gt;
A German translation of a previous version is also available on the forum: [https://forum.gimx.fr/viewtopic.php?f=4&amp;amp;t=362 old German translation].&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:2--&amp;gt;&lt;br /&gt;
Warning: you are responsible for the hardware you buy, and anything right or wrong you do with this.&lt;br /&gt;
&lt;br /&gt;
==Required hardware parts== &amp;lt;!--T:3--&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== USB to serial TTL converter === &amp;lt;!--T:4--&amp;gt;&lt;br /&gt;
Make sure it works at '''500kbps''' and that it is '''5V tolerant'''.&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
| chip || CP2102 || FT232R || PL2303HX || CH340 || FT230X&lt;br /&gt;
|-&lt;br /&gt;
| 5V tolerant&lt;br /&gt;
| style=&amp;quot;background: green; color: white;&amp;quot; | yes&lt;br /&gt;
| style=&amp;quot;background: orange; color: white;&amp;quot; | (1)&lt;br /&gt;
| style=&amp;quot;background: orange; color: white;&amp;quot; | (1)&lt;br /&gt;
| style=&amp;quot;background: orange; color: white;&amp;quot; | (1)&lt;br /&gt;
| style=&amp;quot;background: green; color: white;&amp;quot; | yes&lt;br /&gt;
|-&lt;br /&gt;
| 500 kbps&lt;br /&gt;
| style=&amp;quot;background: green; color: white;&amp;quot; | yes&lt;br /&gt;
| style=&amp;quot;background: green; color: white;&amp;quot; | yes&lt;br /&gt;
| style=&amp;quot;background: orange; color: white;&amp;quot; | (2)&lt;br /&gt;
| style=&amp;quot;background: red; color: white;&amp;quot; | no&lt;br /&gt;
| style=&amp;quot;background: green; color: white;&amp;quot; | yes&lt;br /&gt;
|-&lt;br /&gt;
|&lt;br /&gt;
|-&lt;br /&gt;
| compatible&lt;br /&gt;
| style=&amp;quot;background: green; color: white;&amp;quot; | yes&lt;br /&gt;
| style=&amp;quot;background: orange; color: white;&amp;quot; | (1)&lt;br /&gt;
| style=&amp;quot;background: orange; color: white;&amp;quot; | (1)(2)&lt;br /&gt;
| style=&amp;quot;background: red; color: white;&amp;quot; | no&lt;br /&gt;
| style=&amp;quot;background: green; color: white;&amp;quot; | yes&lt;br /&gt;
|}&lt;br /&gt;
(1) depends on the board&amp;lt;br /&amp;gt;&lt;br /&gt;
(2) only on Linux&amp;lt;br /&amp;gt;&lt;br /&gt;
Examples:&lt;br /&gt;
* [http://jim.sh/ftx/ MicroFTX (10$ excl. shipping costs)]&lt;br /&gt;
* [http://www.ebay.com/sch/i.html?_odkw=cp2102&amp;amp;LH_BIN=1&amp;amp;_sop=15&amp;amp;_osacat=0&amp;amp;_from=R40&amp;amp;LH_PrefLoc=2&amp;amp;_from=R40&amp;amp;_trksid=p2045573.m570.l1313.TR0.TRC0.H0.Xcp2102+-pl2303&amp;amp;_nkw=cp2102+-pl2303&amp;amp;_sacat=0 CP2102 converters on ebay (as low as 3$)]&lt;br /&gt;
* [http://www.ebay.com/sch/i.html?_odkw=ft232+-cp2102+-ssop&amp;amp;LH_BIN=1&amp;amp;_sop=15&amp;amp;_osacat=0&amp;amp;_from=R40&amp;amp;LH_PrefLoc=2&amp;amp;_from=R40&amp;amp;_trksid=p2045573.m570.l1313.TR0.TRC0.H0.Xft232+-cp2102+-pl2303+-ssop&amp;amp;_nkw=ft232+-cp2102+-pl2303+-ssop&amp;amp;_sacat=0 FT232R converters on ebay (as low as 4$)]&lt;br /&gt;
* [http://www.sparkfun.com/products/198 CP2102 converter at sparkfun (22$ excl. shipping costs)]&lt;br /&gt;
* [http://www.sparkfun.com/products/718 FT232R converter at sparkfun (15$ excl. shipping costs)]&lt;br /&gt;
* Some devices like the arduino have an on-board usb to serial chip (remove the AVR chip to use it)&lt;br /&gt;
* A second usb development board can also be programmed as a usb to serial converter.&lt;br /&gt;
&lt;br /&gt;
=== AVR USB development board === &amp;lt;!--T:5--&amp;gt;&lt;br /&gt;
Make sure it is '''working at 5V''' and that is has a chip among the following: at90usb82, at90usb162, at90usb646, at90usb647, at90usb1286, at90usb1287, atmega16u2, atmega32u2, atmega16u4, atmega32u4&amp;lt;br /&amp;gt;&lt;br /&gt;
Examples:&lt;br /&gt;
* [http://www.pjrc.com/store/teensy.html Teensy 2.0 board (atmega32u4, 16$ excl. shipping costs)] (to build a solderless adapter, take a board [http://www.pjrc.com/store/teensy_pins.html with header pins]) (newer Teensy 3.x and LC boards are NOT compatible as they do not have the same chip)&lt;br /&gt;
* Boards used for the psgroove hack (check the on-board chip).&lt;br /&gt;
* Arduino-compatible boards based on the atmega32u4 chip&lt;br /&gt;
** [http://arduino.cc/en/Main/ArduinoBoardLeonardo Arduino Leonardo] - [http://arduino.cc/en/Main/Buy distributors] - (cheap Chinese clones can be found on ebay for 11$ incl. shipping costs)&lt;br /&gt;
** [http://www.ebay.com/sch/i.html?_sop=15&amp;amp;_from=R40&amp;amp;_sacat=0&amp;amp;_nkw=pro+micro+atmega32u4+-atmega328&amp;amp;LH_PrefLoc=2&amp;amp;rt=nc&amp;amp;LH_BIN=1 Cheap atmega32u4 boards on ebay] (about 4$). Soldering required.&lt;br /&gt;
&lt;br /&gt;
=== Recommended setup === &amp;lt;!--T:7--&amp;gt;&lt;br /&gt;
* CP2102 converter from ebay (very low price, but sometimes low delivery)&lt;br /&gt;
* Teensy 2.0 board (low price, good quality, and quick delivery).&lt;br /&gt;
&lt;br /&gt;
==Wiring== &amp;lt;!--T:12--&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:13--&amp;gt;&lt;br /&gt;
The only thing you have to do is to connect the following pins:&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
| USB dev board || USB to UART board&lt;br /&gt;
|-&lt;br /&gt;
| GND     || GND&lt;br /&gt;
|-&lt;br /&gt;
| RX     || TX / TXO / TXD&lt;br /&gt;
|-&lt;br /&gt;
| TX     || RX / RXI / RXD&lt;br /&gt;
|}&lt;br /&gt;
'''Warning: some adapters are mislabeled and have inverted RX/TX.'''&amp;lt;br /&amp;gt;&lt;br /&gt;
With a Teensy 2.0 or Arduino Leonardo as a USB dev board:&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
| Arduino Leonardo || Teensy 2.0 || USB to UART board&lt;br /&gt;
|-&lt;br /&gt;
| GND              || GND        || GND&lt;br /&gt;
|-&lt;br /&gt;
| 0 (RX1)          || D2         || TX / TXO / TXD&lt;br /&gt;
|-&lt;br /&gt;
| 1 (TX1)          || D3         || RX / RXI / RXD&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:23--&amp;gt;&lt;br /&gt;
If you use the arduino on-board USB to serial converter, Rx and Tx are inverted, i.e. Rx = TX&amp;amp;#9654; and Tx = RX&amp;amp;#9664;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:14--&amp;gt;&lt;br /&gt;
The example below shows how to connect a (mislabeled) CP2102 converter (left) to a Teensy 2.0 board (right):&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:15--&amp;gt;&lt;br /&gt;
&amp;lt;div class=&amp;quot;image200px&amp;quot;&amp;gt;[https://gimx.fr/img/screenshots/PC-to-PS3-USB-controller.JPG https://gimx.fr/img/screenshots/PC-to-PS3-USB-controller.JPG]&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:16--&amp;gt;&lt;br /&gt;
It's possible to solder wires or to use jumper wires (these are generally provided with USB to serial TTL boards) in case your AVR USB board has header pins:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:17--&amp;gt;&lt;br /&gt;
&amp;lt;div class=&amp;quot;image200px&amp;quot;&amp;gt;[https://gimx.fr/img/adapter/solderless.jpg https://gimx.fr/img/adapter/solderless.jpg]&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:19--&amp;gt;&lt;br /&gt;
Examples:&lt;br /&gt;
* Bumble-b and FT232RL wired on a breadboard:&lt;br /&gt;
:&amp;lt;div class=&amp;quot;image200px&amp;quot;&amp;gt;[https://gimx.fr/img/screenshots/ft232rl_bumbleb.jpg https://gimx.fr/img/screenshots/ft232rl_bumbleb.jpg]&amp;lt;/div&amp;gt;&lt;br /&gt;
* Teensy++ and CP2102 wired on a breadboard:&lt;br /&gt;
:&amp;lt;div class=&amp;quot;image200px&amp;quot;&amp;gt;[https://gimx.fr/img/screenshots/cp2102_teensy++.jpg https://gimx.fr/img/screenshots/cp2102_teensy++.jpg]&amp;lt;/div&amp;gt;&lt;br /&gt;
* Teensy 2.0 and CP2102 soldered:&lt;br /&gt;
:&amp;lt;div class=&amp;quot;image200px&amp;quot;&amp;gt;[https://gimx.fr/img/adapter/soldered.jpg https://gimx.fr/img/adapter/soldered.jpg]&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Firmware loading== &amp;lt;!--T:8--&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:9--&amp;gt;&lt;br /&gt;
*[http://gimx.fr/download/gimx-firmwares Firmwares]&lt;br /&gt;
{{Firmwares/en}}&lt;br /&gt;
&lt;br /&gt;
===Teensy boards=== &amp;lt;!--T:24--&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:25--&amp;gt;&lt;br /&gt;
Teensy boards can be easily flashed using the [http://www.pjrc.com/teensy/loader.html Teensy Loader].&amp;lt;br /&amp;gt;&lt;br /&gt;
It is probably the easier to use flashing tool, but it is only compatible with '''genuine''' teensy boards.&lt;br /&gt;
&lt;br /&gt;
===Cheap Arduino-compatible atmega32u4-based boards=== &amp;lt;!--T:26--&amp;gt;&lt;br /&gt;
&lt;br /&gt;
====Using the Arduino Builder tool==== &amp;lt;!--T:27--&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:28--&amp;gt;&lt;br /&gt;
* Download the Arduino Leonardo drivers and save them into the same folder:&lt;br /&gt;
** [https://github.com/arduino/Arduino/raw/master/build/windows/dist/drivers/arduino.cat arduino.cat]&lt;br /&gt;
** [https://github.com/arduino/Arduino/raw/master/build/windows/dist/drivers/arduino.inf arduino.inf]&lt;br /&gt;
* Right-click on the arduino.inf file and click on Install.&lt;br /&gt;
* Make sure that the USB to UART board (e.g. CP2102) is connected and powered, and that the wiring with the atmega32u4 board is correct.&lt;br /&gt;
* Make sure that the atmega32u4 board is connected and powered.&lt;br /&gt;
* Download the [http://sourceforge.net/projects/arduinodev/files/ArduinoBuilder/ArduinoBuilder-0.9.1.7z/download Arduino Builder tool] and extract the archive (using [http://www.7-zip.org/ 7zip]).&lt;br /&gt;
* Run ArduinoBuilder.exe.&lt;br /&gt;
* Click on &amp;quot;Load Sketch / HEX&amp;quot;, and select the desired atmega32u4.hex firmware.&lt;br /&gt;
* Click on &amp;quot;Board Type&amp;quot; and select &amp;quot;Arduino Leonardo&amp;quot;.&lt;br /&gt;
* Click on the COM port that matches the &amp;quot;Silicon Labs CP210x ... (COMX)&amp;quot; COM port in the device manager (or whatever the name of your USB to UART board is). This is a trick to make the Arduino Builder tool look for a new COM port. If no COM port is visible, make sure the USB adapter AND the Arduino are plugged into two separate USB ports on the PC, then close and reopen Arduino Builder.&lt;br /&gt;
* The following message should appear: &amp;quot;Forcing reset using 1200bps open/close on COMX...&amp;quot;.&lt;br /&gt;
* Quickly unplug/replug the atmega32u4 board, or connect RST to GND twice.&lt;br /&gt;
* The atmega32u4 board should run the bootloader. The Arduino builder tool should find the Arduino Leonardo COM port and flash the firmware.&lt;br /&gt;
Upon success a &amp;quot;Uploading completed!&amp;quot; message should be displayed.&amp;lt;br /&amp;gt;&lt;br /&gt;
&lt;br /&gt;
====Using Avrdude==== &amp;lt;!--T:29--&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:30--&amp;gt;&lt;br /&gt;
* Download the Arduino Leonardo drivers and save them into the same folder:&lt;br /&gt;
** [https://github.com/arduino/Arduino/raw/master/build/windows/dist/drivers/arduino.cat arduino.cat]&lt;br /&gt;
** [https://github.com/arduino/Arduino/raw/master/build/windows/dist/drivers/arduino.inf arduino.inf]&lt;br /&gt;
* Right-click on the arduino.inf file and click on Install.&lt;br /&gt;
* Make sure that the USB to UART board (e.g. CP2102) is connected and powered, and that the wiring with the atmega32u4 board is correct.&lt;br /&gt;
* Make sure that the atmega32u4 board is connected and powered.&lt;br /&gt;
* Download the [http://sourceforge.net/projects/arduinodev/files/ArduinoBuilder/ArduinoBuilder-0.9.1.7z/download Arduino Builder tool] and extract the archive (using [http://www.7-zip.org/ 7zip]).&lt;br /&gt;
* Press shift and right-click into the bin folder, and click on &amp;quot;Open command window here&amp;quot;.&lt;br /&gt;
* Type the following text but don't press enter:&lt;br /&gt;
 avrdude -p atmega32u4 -c avr109 -P COM7 -D -U flash:w:&amp;lt;path to atmega32u4.hex&amp;gt;:i&lt;br /&gt;
* Make sure to replace &amp;quot;&amp;lt;path to atmega32u4.hex&amp;gt;&amp;quot; in the command line with the location of the firmware to load (for example: C:\Users\YourUserName\Downloads\firmwares-5.0\EMUPS4\atmega32u4.hex).&lt;br /&gt;
* Move the cursor right after COM7.&lt;br /&gt;
* Open the device manager, and unfold the COM port item.&lt;br /&gt;
* Quickly unplug/replug the atmega32u4 board, or connect RST to GND twice.&lt;br /&gt;
* The atmega32u4 board should run the bootloader. As soon as you see it appearing in the device manager, change the COM port number in the CMD window and press enter.&lt;br /&gt;
* The bootloader is executed very briefly. You may have to make a few attempts before the firmware gets loaded correctly!&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:31--&amp;gt;&lt;br /&gt;
In GNU/Linux, the avrdude command is:&lt;br /&gt;
 avrdude -p atmega32u4 -c avr109 -P /dev/ttyACM0 -D -U flash:w:atmega32u4.hex:i&lt;br /&gt;
(make sure to adjust the port and the file)&lt;br /&gt;
&lt;br /&gt;
===Other tools=== &amp;lt;!--T:32--&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:10--&amp;gt;&lt;br /&gt;
There are a few other tools that can be used to load the hex file:&lt;br /&gt;
* [http://www.atmel.com/tools/FLIP.aspx Flip utility from Atmel] (not compatible with genuine teensy boards and with Arduino-compatible atmega32u4-based boards)&lt;br /&gt;
* [http://dfu-programmer.sourceforge.net/ dfu-programmer command-line tool] (not compatible with genuine teensy boards and with Arduino-compatible atmega32u4-based boards)&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:11--&amp;gt;&lt;br /&gt;
dfu-programmer example:&lt;br /&gt;
    sudo dfu-programmer at90usb162 erase&lt;br /&gt;
    sudo dfu-programmer at90usb162 flash at90usb162.hex&lt;br /&gt;
    sudo dfu-programmer at90usb162 reset&lt;br /&gt;
&lt;br /&gt;
==Serial port settings== &amp;lt;!--T:33--&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:34--&amp;gt;&lt;br /&gt;
On Windows the driver for FTDI chips (e.g. FT232R, FT230X, FT231X...) provides a &amp;quot;Latency Timer&amp;quot; setting than should be set to 1ms for optimal performance.&amp;lt;br /&amp;gt;&lt;br /&gt;
The procedure is detailed on the FTDI website: [http://www.ftdichip.com/Support/Knowledgebase/index.html?cdmcomportadvancedproperti.htm link].&lt;br /&gt;
&lt;br /&gt;
==Next Tutorial== &amp;lt;!--T:20--&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:21--&amp;gt;&lt;br /&gt;
Now that your adapter is ready you can follow the instructions on the [[Quick_Start|Quick Start page]].&lt;br /&gt;
&amp;lt;/translate&amp;gt;&lt;/div&gt;</summary>
		<author><name>Steel 3d</name></author>
		
	</entry>
	<entry>
		<id>https://gimx.fr/wiki/index.php?title=RPi&amp;diff=5267</id>
		<title>RPi</title>
		<link rel="alternate" type="text/html" href="https://gimx.fr/wiki/index.php?title=RPi&amp;diff=5267"/>
		<updated>2016-12-14T04:47:30Z</updated>

		<summary type="html">&lt;p&gt;Steel 3d: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&amp;lt;languages /&amp;gt;&lt;br /&gt;
&amp;lt;translate&amp;gt;&lt;br /&gt;
&amp;lt;!--T:1--&amp;gt;&lt;br /&gt;
'''Warning: RPi support should be considered as experimental. Be prepared to face issues if you try GIMX on the RPi.'''&lt;br /&gt;
&lt;br /&gt;
GIMX can run on many Linux targets, and the [http://www.raspberrypi.org/ the Raspberry Pi] is one of them!&lt;br /&gt;
== Hardware considerations == &amp;lt;!--T:23--&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:24--&amp;gt;&lt;br /&gt;
Use a USB HUB only if there are no ports available on the RPi.&amp;lt;br /&amp;gt;&lt;br /&gt;
It is highly recommended to use a HUB with an external power supply.&lt;br /&gt;
&lt;br /&gt;
== Firmware update == &amp;lt;!--T:5--&amp;gt;&lt;br /&gt;
As early firmwares had severe USB issues it is recommended to update the firmware before using GIMX.&amp;lt;br /&amp;gt;&lt;br /&gt;
Updating the firmware may also be useful if you plan to use a Logitech force feedback wheel (the uhid kernel module was missing in earlier firmwares).&amp;lt;br /&amp;gt;&lt;br /&gt;
Type the following command:&lt;br /&gt;
&amp;lt;pre&amp;gt;sudo rpi-update&lt;br /&gt;
sudo reboot&amp;lt;/pre&amp;gt;&lt;br /&gt;
If you have issues with the latest firmware, install the following instead:&lt;br /&gt;
&amp;lt;pre&amp;gt;sudo rpi-update 771a503cfc2a1130e2df2a4ddfc45ffa0f592b3f&lt;br /&gt;
sudo reboot&amp;lt;/pre&amp;gt;&lt;br /&gt;
Tested Rpi firmware:&lt;br /&gt;
&amp;lt;pre&amp;gt;pi@raspberrypi ~ $ uname -a&lt;br /&gt;
Linux raspberrypi 4.1.21+ #873 Mon Apr 11 18:00:37 BST 2016 armv6l GNU/Linux&amp;lt;/pre&amp;gt;&lt;br /&gt;
&amp;lt;!--== UHID kernel module ==&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:27--&amp;gt;&lt;br /&gt;
If you plan to use a Logitech force feedback wheel, you will have to build the uhid.ko module for your kernel.&amp;lt;br /&amp;gt;&lt;br /&gt;
Install the right version of gcc, as explained here: [https://github.com/notro/rpi-source/wiki link].&amp;lt;br /&amp;gt;&lt;br /&gt;
Update your kernel:&lt;br /&gt;
&amp;lt;pre&amp;gt;sudo rpi-update&amp;lt;/pre&amp;gt;&lt;br /&gt;
In case the kernel was updated, reboot:&lt;br /&gt;
&amp;lt;pre&amp;gt;sudo reboot&amp;lt;/pre&amp;gt;&lt;br /&gt;
Install the rpi-source tool:&lt;br /&gt;
&amp;lt;pre&amp;gt;sudo wget https://raw.githubusercontent.com/notro/rpi-source/master/rpi-source -O /usr/bin/rpi-source &amp;amp;&amp;amp; sudo chmod +x /usr/bin/rpi-source &amp;amp;&amp;amp; /usr/bin/rpi-source -q --tag-update&amp;lt;/pre&amp;gt;&lt;br /&gt;
Run rpi-source:&lt;br /&gt;
&amp;lt;pre&amp;gt;rpi-source&amp;lt;/pre&amp;gt;&lt;br /&gt;
This step may take a while to complete.&amp;lt;br /&amp;gt;&lt;br /&gt;
Install ncurses:&lt;br /&gt;
&amp;lt;pre&amp;gt;sudo apt-get install libncurses5-dev&amp;lt;/pre&amp;gt;&lt;br /&gt;
Enable the UHID module compilation:&lt;br /&gt;
&amp;lt;pre&amp;gt;cd linux&lt;br /&gt;
make menuconfig&amp;lt;/pre&amp;gt;&lt;br /&gt;
Select Device Drivers&amp;gt;HID support&amp;gt;User-space I/O driver support for HID subsystem. The line should start with '&amp;lt;M&amp;gt;'.&amp;lt;br /&amp;gt;&lt;br /&gt;
To speed up the compilation, you can disable all other modules in the HID support section and subsections.&amp;lt;br /&amp;gt;&lt;br /&gt;
Save the config to the default location and exit.&amp;lt;br /&amp;gt;&lt;br /&gt;
Build the module:&lt;br /&gt;
&amp;lt;pre&amp;gt;make prepare&lt;br /&gt;
make scripts&lt;br /&gt;
make M=drivers/hid&amp;lt;/pre&amp;gt;&lt;br /&gt;
Install it:&lt;br /&gt;
&amp;lt;pre&amp;gt;sudo cp drivers/hid/uhid.ko /lib/modules/`uname -r`/kernel/drivers/hid/&lt;br /&gt;
sudo depmod -a&amp;lt;/pre&amp;gt;--&amp;gt;&lt;br /&gt;
&amp;lt;!--mkdir dest&lt;br /&gt;
make INSTALL_HDR_PATH=dest headers_install&lt;br /&gt;
sudo cp dest/include/linux/uhid.h /usr/include/linux/--&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== USB adapter using the on-board UART interface == &amp;lt;!--T:6--&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Hardware requirements === &amp;lt;!--T:25--&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:26--&amp;gt;&lt;br /&gt;
The on-board UART runs at 0V/3.3V levels, and the AVR USB board has to run at 5V to operate at 16MHz (running at 3.3V would only allow to operate at 8MHz).&amp;lt;br /&amp;gt;&lt;br /&gt;
Connecting the RPi and the AVR USB board directly may damage the hardware!&amp;lt;br /&amp;gt;&lt;br /&gt;
One cheap solution is to use a voltage divider:&amp;lt;br /&amp;gt;&lt;br /&gt;
* Connect both GNDs&lt;br /&gt;
* It's safe to connect the TXD pin of the RPi to the Rx pin of the AVR USB board (the GIMX firmwares configure the Rx pin as an input)&lt;br /&gt;
* To connect the Tx pin of the AVR USB board to the RXD pin of the RPi, you'll need to convert the voltage level from 0..5V to 0..3.3V.&amp;lt;br /&amp;gt;&lt;br /&gt;
This can be done with a simple resistive divider:&lt;br /&gt;
&amp;lt;div class=&amp;quot;image200px&amp;quot;&amp;gt;[https://gimx.fr/img/wiki/Resistive_divider.png https://gimx.fr/img/wiki/Resistive_divider.png]&amp;lt;/div&amp;gt;&lt;br /&gt;
Vin is the Tx pin of the AVR USB board, Vout is the RXD pin of the RPi, R1=2.2kΩ , R2=3.3kΩ&lt;br /&gt;
* Do not connect any other pin!&lt;br /&gt;
&lt;br /&gt;
=== Sotware adjustments === &amp;lt;!--T:15--&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:17--&amp;gt;&lt;br /&gt;
By default, the RPi UART is configured as a serial console.&amp;lt;br /&amp;gt;&lt;br /&gt;
Disable this serial console using raspi-config:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
sudo raspi-config &lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
Then select:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
&amp;quot;Advanced Options&amp;quot;, &amp;quot;Serial&amp;quot;, &amp;quot;No&amp;quot;, &amp;quot;Finish&amp;quot;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
The default configuration does not allow high baudrates.&amp;lt;br /&amp;gt;&lt;br /&gt;
Enable high baudrates editing /boot/config.txt:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
sudo nano /boot/config.txt&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
Add the following line at the end of the file:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
init_uart_clock=8000000 &lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
Reboot to apply the changes:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
sudo reboot&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== GIMX installation == &amp;lt;!--T:7--&amp;gt;&lt;br /&gt;
&amp;lt;pre&amp;gt;wget https://gimx.fr/download/gimx-raspbian -O gimx.deb&lt;br /&gt;
sudo dpkg -i gimx.deb&lt;br /&gt;
sudo apt-get -f install&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:8--&amp;gt;&lt;br /&gt;
If you get a &amp;quot;Dependency is not satisfiable: ...&amp;quot; error message, upgrade Raspbian:&lt;br /&gt;
&amp;lt;pre&amp;gt;sudo apt-get update &amp;amp;&amp;amp; sudo apt-get upgrade&lt;br /&gt;
sudo apt-get -f install&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Stop/disable triggerhappy service == &amp;lt;!--T:9--&amp;gt;&lt;br /&gt;
[https://github.com/wertarbyte/triggerhappy/blob/master/README Triggerhappy] is a daemon that opens every input device for reading, and that consumes a few percent of the CPU time.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:10--&amp;gt;&lt;br /&gt;
It seems a good idea to stop it while running GIMX.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:11--&amp;gt;&lt;br /&gt;
To stop triggerhappy:&lt;br /&gt;
 sudo service triggerhappy stop&lt;br /&gt;
To disable triggerhappy:&lt;br /&gt;
 sudo update-rc.d triggerhappy disable&lt;br /&gt;
&lt;br /&gt;
== Run GIMX == &amp;lt;!--T:12--&amp;gt;&lt;br /&gt;
Read the [[Quick_Start|Quick start page]] to learn how to run GIMX through the GUI.&amp;lt;br /&amp;gt;&lt;br /&gt;
A good idea is to run GIMX directly from a terminal, without starting a graphical session, which can be done over the network, using a ssh client, or you can [[#Autostart GIMX at boot without GUI]]&amp;lt;br /&amp;gt;&lt;br /&gt;
Ideally, GIMX should be launched without using the Ethernet port (because it is connected on the USB bus).&amp;lt;br /&amp;gt;&lt;br /&gt;
More details on command line options on [[Command_line|this page]].&amp;lt;br /&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Autostart GIMX at boot without GUI == &amp;lt;!--T:28--&amp;gt;&lt;br /&gt;
Simply create a file /etc/systemd/system/gimx.service (as root): &lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
sudo nano /etc/systemd/system/gimx.service&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
With the following contents:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:29--&amp;gt;&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
[Unit]&lt;br /&gt;
Description=GIMX  &lt;br /&gt;
After=syslog.target network.target&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:30--&amp;gt;&lt;br /&gt;
[Service]&lt;br /&gt;
User=pi  &lt;br /&gt;
Type=simple  &lt;br /&gt;
# Replace /dev/ttyUSB0 with /dev/ttyAMA0 when using the on-board UART interface&lt;br /&gt;
ExecStart=/usr/bin/gimx -p /dev/ttyUSB0 -c LogitechDrivingForceGT_G29.xml --nograb  &lt;br /&gt;
Restart=always  &lt;br /&gt;
RestartSec=5&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:31--&amp;gt;&lt;br /&gt;
[Install]&lt;br /&gt;
WantedBy=multi-user.target&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:32--&amp;gt;&lt;br /&gt;
Replace ttyUSB0 with your device (/dev/ttyAMA0 when using the on-board UART interface) and LogitechDrivingForceGT_G29.xml with your mapping file (which should be available in the pi home directory as /home/pi/.gimx/config/LogitechDrivingForceGT_G29.xml)&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:33--&amp;gt;&lt;br /&gt;
Run &amp;lt;pre&amp;gt;sudo systemctl daemon-reload&amp;lt;/pre&amp;gt; to notify systemd about the new file and &amp;lt;pre&amp;gt;sudo systemctl enable gimx &amp;amp;&amp;amp; sudo systemctl start gimx&amp;lt;/pre&amp;gt; to enable the gimx service start at boot and start it in the same line.&lt;br /&gt;
&lt;br /&gt;
== Notify when GIMX is running using a led == &amp;lt;!--T:34--&amp;gt;&lt;br /&gt;
In order to have a proper confirmation about if the gimx service is up and running, you can add a simple python script that turns a led on if the gimx service is running.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:35--&amp;gt;&lt;br /&gt;
The file will be located at /home/pi/blink.py:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:36--&amp;gt;&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
#!/usr/bin/python&lt;br /&gt;
import os  &lt;br /&gt;
import time  &lt;br /&gt;
import RPi.GPIO as GPIO&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:37--&amp;gt;&lt;br /&gt;
led = 23  &lt;br /&gt;
button = 18  &lt;br /&gt;
GPIO.setmode(GPIO.BCM)  &lt;br /&gt;
GPIO.setup(led, GPIO.OUT)  &lt;br /&gt;
GPIO.setup(button, GPIO.IN, pull_up_down = GPIO.PUD_UP)&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:38--&amp;gt;&lt;br /&gt;
def Shutdown(channel):  &lt;br /&gt;
  GPIO.output(led, True)&lt;br /&gt;
  time.sleep(0.2)&lt;br /&gt;
  GPIO.output(led, False)&lt;br /&gt;
  time.sleep(0.2)&lt;br /&gt;
  GPIO.output(led, True)&lt;br /&gt;
  time.sleep(0.2)&lt;br /&gt;
  GPIO.output(led, False)&lt;br /&gt;
  os.system(&amp;quot;sudo shutdown -h now&amp;quot;)&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:39--&amp;gt;&lt;br /&gt;
GPIO.add_event_detect(18, GPIO.FALLING, callback = Shutdown, bouncetime = 2000)&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:40--&amp;gt;&lt;br /&gt;
while True:  &lt;br /&gt;
  found = False&lt;br /&gt;
  time.sleep(5)&lt;br /&gt;
  pids = [pid for pid in os.listdir('/proc') if pid.isdigit()]&lt;br /&gt;
  for pid in pids:&lt;br /&gt;
    try:&lt;br /&gt;
      cmd = open(os.path.join('/proc', pid, 'cmdline'), 'rb').read()&lt;br /&gt;
      if &amp;quot;gimx&amp;quot; in cmd:&lt;br /&gt;
        found = True&lt;br /&gt;
    except IOError: # proc has already terminated&lt;br /&gt;
      continue&lt;br /&gt;
  if found == True:&lt;br /&gt;
    GPIO.output(led, True)&lt;br /&gt;
  else:&lt;br /&gt;
    GPIO.output(led, False)&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:41--&amp;gt;&lt;br /&gt;
As a bonus, you can add a button so when it is pressed, there is a little blink effect, and the pi is shutted down.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:42--&amp;gt;&lt;br /&gt;
&amp;lt;div class=&amp;quot;image200px&amp;quot;&amp;gt;[https://gimx.fr/img/wiki/PiButtonLed.png https://gimx.fr/img/wiki/PiButtonLed.png]&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:43--&amp;gt;&lt;br /&gt;
To start at boot, simply add it to the pi user crontab (crontab -e) as &amp;lt;pre&amp;gt;@reboot python /home/pi/blink.py &amp;amp;&amp;lt;/pre&amp;gt;&lt;br /&gt;
&amp;lt;/translate&amp;gt;&lt;/div&gt;</summary>
		<author><name>Steel 3d</name></author>
		
	</entry>
	<entry>
		<id>https://gimx.fr/wiki/index.php?title=RPi&amp;diff=5266</id>
		<title>RPi</title>
		<link rel="alternate" type="text/html" href="https://gimx.fr/wiki/index.php?title=RPi&amp;diff=5266"/>
		<updated>2016-12-14T04:45:35Z</updated>

		<summary type="html">&lt;p&gt;Steel 3d: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&amp;lt;languages /&amp;gt;&lt;br /&gt;
&amp;lt;translate&amp;gt;&lt;br /&gt;
&amp;lt;!--T:1--&amp;gt;&lt;br /&gt;
'''Warning: RPi support should be considered as experimental. Be prepared to face issues if you try GIMX on the RPi.'''&lt;br /&gt;
&lt;br /&gt;
GIMX can run on many Linux targets, and the [http://www.raspberrypi.org/ the Raspberry Pi] is one of them!&lt;br /&gt;
== Hardware considerations == &amp;lt;!--T:23--&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:24--&amp;gt;&lt;br /&gt;
Use a USB HUB only if there are no ports available on the RPi.&amp;lt;br /&amp;gt;&lt;br /&gt;
It is highly recommended to use a HUB with an external power supply.&lt;br /&gt;
&lt;br /&gt;
== Firmware update == &amp;lt;!--T:5--&amp;gt;&lt;br /&gt;
As early firmwares had severe USB issues it is recommended to update the firmware before using GIMX.&amp;lt;br /&amp;gt;&lt;br /&gt;
Updating the firmware may also be useful if you plan to use a Logitech force feedback wheel (the uhid kernel module was missing in earlier firmwares).&amp;lt;br /&amp;gt;&lt;br /&gt;
Type the following command:&lt;br /&gt;
&amp;lt;pre&amp;gt;sudo rpi-update&lt;br /&gt;
sudo reboot&amp;lt;/pre&amp;gt;&lt;br /&gt;
If you have issues with the latest firmware, install the following instead:&lt;br /&gt;
&amp;lt;pre&amp;gt;sudo rpi-update 771a503cfc2a1130e2df2a4ddfc45ffa0f592b3f&lt;br /&gt;
sudo reboot&amp;lt;/pre&amp;gt;&lt;br /&gt;
Tested Rpi firmware:&lt;br /&gt;
&amp;lt;pre&amp;gt;pi@raspberrypi ~ $ uname -a&lt;br /&gt;
Linux raspberrypi 4.1.21+ #873 Mon Apr 11 18:00:37 BST 2016 armv6l GNU/Linux&amp;lt;/pre&amp;gt;&lt;br /&gt;
&amp;lt;!--== UHID kernel module ==&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:27--&amp;gt;&lt;br /&gt;
If you plan to use a Logitech force feedback wheel, you will have to build the uhid.ko module for your kernel.&amp;lt;br /&amp;gt;&lt;br /&gt;
Install the right version of gcc, as explained here: [https://github.com/notro/rpi-source/wiki link].&amp;lt;br /&amp;gt;&lt;br /&gt;
Update your kernel:&lt;br /&gt;
&amp;lt;pre&amp;gt;sudo rpi-update&amp;lt;/pre&amp;gt;&lt;br /&gt;
In case the kernel was updated, reboot:&lt;br /&gt;
&amp;lt;pre&amp;gt;sudo reboot&amp;lt;/pre&amp;gt;&lt;br /&gt;
Install the rpi-source tool:&lt;br /&gt;
&amp;lt;pre&amp;gt;sudo wget https://raw.githubusercontent.com/notro/rpi-source/master/rpi-source -O /usr/bin/rpi-source &amp;amp;&amp;amp; sudo chmod +x /usr/bin/rpi-source &amp;amp;&amp;amp; /usr/bin/rpi-source -q --tag-update&amp;lt;/pre&amp;gt;&lt;br /&gt;
Run rpi-source:&lt;br /&gt;
&amp;lt;pre&amp;gt;rpi-source&amp;lt;/pre&amp;gt;&lt;br /&gt;
This step may take a while to complete.&amp;lt;br /&amp;gt;&lt;br /&gt;
Install ncurses:&lt;br /&gt;
&amp;lt;pre&amp;gt;sudo apt-get install libncurses5-dev&amp;lt;/pre&amp;gt;&lt;br /&gt;
Enable the UHID module compilation:&lt;br /&gt;
&amp;lt;pre&amp;gt;cd linux&lt;br /&gt;
make menuconfig&amp;lt;/pre&amp;gt;&lt;br /&gt;
Select Device Drivers&amp;gt;HID support&amp;gt;User-space I/O driver support for HID subsystem. The line should start with '&amp;lt;M&amp;gt;'.&amp;lt;br /&amp;gt;&lt;br /&gt;
To speed up the compilation, you can disable all other modules in the HID support section and subsections.&amp;lt;br /&amp;gt;&lt;br /&gt;
Save the config to the default location and exit.&amp;lt;br /&amp;gt;&lt;br /&gt;
Build the module:&lt;br /&gt;
&amp;lt;pre&amp;gt;make prepare&lt;br /&gt;
make scripts&lt;br /&gt;
make M=drivers/hid&amp;lt;/pre&amp;gt;&lt;br /&gt;
Install it:&lt;br /&gt;
&amp;lt;pre&amp;gt;sudo cp drivers/hid/uhid.ko /lib/modules/`uname -r`/kernel/drivers/hid/&lt;br /&gt;
sudo depmod -a&amp;lt;/pre&amp;gt;--&amp;gt;&lt;br /&gt;
&amp;lt;!--mkdir dest&lt;br /&gt;
make INSTALL_HDR_PATH=dest headers_install&lt;br /&gt;
sudo cp dest/include/linux/uhid.h /usr/include/linux/--&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== USB adapter using the on-board UART interface == &amp;lt;!--T:6--&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Hardware requirements === &amp;lt;!--T:25--&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:26--&amp;gt;&lt;br /&gt;
The on-board UART runs at 0V/3.3V levels, and the AVR USB board has to run at 5V to operate at 16MHz (running at 3.3V would only allow to operate at 8MHz).&amp;lt;br /&amp;gt;&lt;br /&gt;
Connecting the RPi and the AVR USB board directly may damage the hardware!&amp;lt;br /&amp;gt;&lt;br /&gt;
One cheap solution is to use a voltage divider:&amp;lt;br /&amp;gt;&lt;br /&gt;
* Connect both GNDs&lt;br /&gt;
* It's safe to connect the TXD pin of the RPi to the Rx pin of the AVR USB board (the GIMX firmwares configure the Rx pin as an input)&lt;br /&gt;
* To connect the Tx pin of the AVR USB board to the RXD pin of the RPi, you'll need to convert the voltage level from 0..5V to 0..3.3V.&amp;lt;br /&amp;gt;&lt;br /&gt;
This can be done with a simple resistive divider:&lt;br /&gt;
&amp;lt;div class=&amp;quot;image200px&amp;quot;&amp;gt;[https://gimx.fr/img/wiki/Resistive_divider.png https://gimx.fr/img/wiki/Resistive_divider.png]&amp;lt;/div&amp;gt;&lt;br /&gt;
Vin is the Tx pin of the AVR USB board, Vout is the RXD pin of the RPi, R1=2.2kΩ , R2=3.3kΩ&lt;br /&gt;
* Do not connect any other pin!&lt;br /&gt;
&lt;br /&gt;
=== Sotware adjustments === &amp;lt;!--T:15--&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:17--&amp;gt;&lt;br /&gt;
By default, the RPi UART is configured as a serial console.&amp;lt;br /&amp;gt;&lt;br /&gt;
Disable this serial console using raspi-config:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
sudo raspi-config &lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
Then select:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
&amp;quot;Advanced Options&amp;quot;, &amp;quot;Serial&amp;quot;, &amp;quot;No&amp;quot;, &amp;quot;Finish&amp;quot;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
The default configuration does not allow high baudrates.&amp;lt;br /&amp;gt;&lt;br /&gt;
Enable high baudrates editing /boot/config.txt:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
sudo nano /boot/config.txt&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
Add the following line at the end of the file:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
init_uart_clock=8000000 &lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
Reboot to apply the changes:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
sudo reboot&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== GIMX installation == &amp;lt;!--T:7--&amp;gt;&lt;br /&gt;
&amp;lt;pre&amp;gt;wget https://gimx.fr/download/gimx-raspbian -O gimx.deb&lt;br /&gt;
sudo dpkg -i gimx.deb&lt;br /&gt;
sudo apt-get -f install&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:8--&amp;gt;&lt;br /&gt;
If you get a &amp;quot;Dependency is not satisfiable: ...&amp;quot; error message, upgrade Raspbian:&lt;br /&gt;
&amp;lt;pre&amp;gt;sudo apt-get update &amp;amp;&amp;amp; sudo apt-get upgrade&lt;br /&gt;
sudo apt-get -f install&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Stop/disable triggerhappy service == &amp;lt;!--T:9--&amp;gt;&lt;br /&gt;
[https://github.com/wertarbyte/triggerhappy/blob/master/README Triggerhappy] is a daemon that opens every input device for reading, and that consumes a few percent of the CPU time.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:10--&amp;gt;&lt;br /&gt;
It seems a good idea to stop it while running GIMX.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:11--&amp;gt;&lt;br /&gt;
To stop triggerhappy:&lt;br /&gt;
 sudo service triggerhappy stop&lt;br /&gt;
To disable triggerhappy:&lt;br /&gt;
 sudo update-rc.d triggerhappy disable&lt;br /&gt;
&lt;br /&gt;
== Run GIMX == &amp;lt;!--T:12--&amp;gt;&lt;br /&gt;
Read the [[Quick_Start|Quick start page]] to learn how to run GIMX through the GUI.&amp;lt;br /&amp;gt;&lt;br /&gt;
A good idea is to run GIMX directly from a terminal, without starting a graphical session, which can be done over the network, using a ssh client, or you can [[#Autostart GIMX at boot without GUI]]&amp;lt;br /&amp;gt;&lt;br /&gt;
Ideally, GIMX should be launched without using the Ethernet port (because it is connected on the USB bus).&amp;lt;br /&amp;gt;&lt;br /&gt;
More details on command line options on [[Command_line|this page]].&amp;lt;br /&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Autostart GIMX at boot without GUI == &amp;lt;!--T:28--&amp;gt;&lt;br /&gt;
Simply create a file /etc/systemd/system/gimx.service as root (sudo nano /etc/systemd/system/gimx.service) with the following content:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:29--&amp;gt;&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
[Unit]&lt;br /&gt;
Description=GIMX  &lt;br /&gt;
After=syslog.target network.target&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:30--&amp;gt;&lt;br /&gt;
[Service]&lt;br /&gt;
User=pi  &lt;br /&gt;
Type=simple  &lt;br /&gt;
# Replace /dev/ttyUSB0 with /dev/ttyAMA0 when using the on-board UART interface&lt;br /&gt;
ExecStart=/usr/bin/gimx -p /dev/ttyUSB0 -c LogitechDrivingForceGT_G29.xml --nograb  &lt;br /&gt;
Restart=always  &lt;br /&gt;
RestartSec=5&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:31--&amp;gt;&lt;br /&gt;
[Install]&lt;br /&gt;
WantedBy=multi-user.target&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:32--&amp;gt;&lt;br /&gt;
Replace ttyUSB0 with your device (/dev/ttyAMA0 when using the on-board UART interface) and LogitechDrivingForceGT_G29.xml with your mapping file (which should be available in the pi home directory as /home/pi/.gimx/config/LogitechDrivingForceGT_G29.xml)&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:33--&amp;gt;&lt;br /&gt;
Run &amp;lt;pre&amp;gt;sudo systemctl daemon-reload&amp;lt;/pre&amp;gt; to notify systemd about the new file and &amp;lt;pre&amp;gt;sudo systemctl enable gimx &amp;amp;&amp;amp; sudo systemctl start gimx&amp;lt;/pre&amp;gt; to enable the gimx service start at boot and start it in the same line.&lt;br /&gt;
&lt;br /&gt;
== Notify when GIMX is running using a led == &amp;lt;!--T:34--&amp;gt;&lt;br /&gt;
In order to have a proper confirmation about if the gimx service is up and running, you can add a simple python script that turns a led on if the gimx service is running.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:35--&amp;gt;&lt;br /&gt;
The file will be located at /home/pi/blink.py:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:36--&amp;gt;&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
#!/usr/bin/python&lt;br /&gt;
import os  &lt;br /&gt;
import time  &lt;br /&gt;
import RPi.GPIO as GPIO&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:37--&amp;gt;&lt;br /&gt;
led = 23  &lt;br /&gt;
button = 18  &lt;br /&gt;
GPIO.setmode(GPIO.BCM)  &lt;br /&gt;
GPIO.setup(led, GPIO.OUT)  &lt;br /&gt;
GPIO.setup(button, GPIO.IN, pull_up_down = GPIO.PUD_UP)&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:38--&amp;gt;&lt;br /&gt;
def Shutdown(channel):  &lt;br /&gt;
  GPIO.output(led, True)&lt;br /&gt;
  time.sleep(0.2)&lt;br /&gt;
  GPIO.output(led, False)&lt;br /&gt;
  time.sleep(0.2)&lt;br /&gt;
  GPIO.output(led, True)&lt;br /&gt;
  time.sleep(0.2)&lt;br /&gt;
  GPIO.output(led, False)&lt;br /&gt;
  os.system(&amp;quot;sudo shutdown -h now&amp;quot;)&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:39--&amp;gt;&lt;br /&gt;
GPIO.add_event_detect(18, GPIO.FALLING, callback = Shutdown, bouncetime = 2000)&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:40--&amp;gt;&lt;br /&gt;
while True:  &lt;br /&gt;
  found = False&lt;br /&gt;
  time.sleep(5)&lt;br /&gt;
  pids = [pid for pid in os.listdir('/proc') if pid.isdigit()]&lt;br /&gt;
  for pid in pids:&lt;br /&gt;
    try:&lt;br /&gt;
      cmd = open(os.path.join('/proc', pid, 'cmdline'), 'rb').read()&lt;br /&gt;
      if &amp;quot;gimx&amp;quot; in cmd:&lt;br /&gt;
        found = True&lt;br /&gt;
    except IOError: # proc has already terminated&lt;br /&gt;
      continue&lt;br /&gt;
  if found == True:&lt;br /&gt;
    GPIO.output(led, True)&lt;br /&gt;
  else:&lt;br /&gt;
    GPIO.output(led, False)&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:41--&amp;gt;&lt;br /&gt;
As a bonus, you can add a button so when it is pressed, there is a little blink effect, and the pi is shutted down.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:42--&amp;gt;&lt;br /&gt;
&amp;lt;div class=&amp;quot;image200px&amp;quot;&amp;gt;[https://gimx.fr/img/wiki/PiButtonLed.png https://gimx.fr/img/wiki/PiButtonLed.png]&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:43--&amp;gt;&lt;br /&gt;
To start at boot, simply add it to the pi user crontab (crontab -e) as &amp;lt;pre&amp;gt;@reboot python /home/pi/blink.py &amp;amp;&amp;lt;/pre&amp;gt;&lt;br /&gt;
&amp;lt;/translate&amp;gt;&lt;/div&gt;</summary>
		<author><name>Steel 3d</name></author>
		
	</entry>
	<entry>
		<id>https://gimx.fr/wiki/index.php?title=RPi&amp;diff=5265</id>
		<title>RPi</title>
		<link rel="alternate" type="text/html" href="https://gimx.fr/wiki/index.php?title=RPi&amp;diff=5265"/>
		<updated>2016-12-13T07:23:50Z</updated>

		<summary type="html">&lt;p&gt;Steel 3d: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&amp;lt;languages /&amp;gt;&lt;br /&gt;
&amp;lt;translate&amp;gt;&lt;br /&gt;
&amp;lt;!--T:1--&amp;gt;&lt;br /&gt;
'''Warning: RPi support should be considered as experimental. Be prepared to face issues if you try GIMX on the RPi.'''&lt;br /&gt;
&lt;br /&gt;
GIMX can run on many Linux targets, and the [http://www.raspberrypi.org/ the Raspberry Pi] is one of them!&lt;br /&gt;
== Hardware considerations == &amp;lt;!--T:23--&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:24--&amp;gt;&lt;br /&gt;
Use a USB HUB only if there are no ports available on the RPi.&amp;lt;br /&amp;gt;&lt;br /&gt;
It is highly recommended to use a HUB with an external power supply.&lt;br /&gt;
&lt;br /&gt;
== Firmware update == &amp;lt;!--T:5--&amp;gt;&lt;br /&gt;
As early firmwares had severe USB issues it is recommended to update the firmware before using GIMX.&amp;lt;br /&amp;gt;&lt;br /&gt;
Updating the firmware may also be useful if you plan to use a Logitech force feedback wheel (the uhid kernel module was missing in earlier firmwares).&amp;lt;br /&amp;gt;&lt;br /&gt;
Type the following command:&lt;br /&gt;
&amp;lt;pre&amp;gt;sudo rpi-update&lt;br /&gt;
sudo reboot&amp;lt;/pre&amp;gt;&lt;br /&gt;
If you have issues with the latest firmware, install the following instead:&lt;br /&gt;
&amp;lt;pre&amp;gt;sudo rpi-update 771a503cfc2a1130e2df2a4ddfc45ffa0f592b3f&lt;br /&gt;
sudo reboot&amp;lt;/pre&amp;gt;&lt;br /&gt;
Tested Rpi firmware:&lt;br /&gt;
&amp;lt;pre&amp;gt;pi@raspberrypi ~ $ uname -a&lt;br /&gt;
Linux raspberrypi 4.1.21+ #873 Mon Apr 11 18:00:37 BST 2016 armv6l GNU/Linux&amp;lt;/pre&amp;gt;&lt;br /&gt;
&amp;lt;!--== UHID kernel module ==&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:27--&amp;gt;&lt;br /&gt;
If you plan to use a Logitech force feedback wheel, you will have to build the uhid.ko module for your kernel.&amp;lt;br /&amp;gt;&lt;br /&gt;
Install the right version of gcc, as explained here: [https://github.com/notro/rpi-source/wiki link].&amp;lt;br /&amp;gt;&lt;br /&gt;
Update your kernel:&lt;br /&gt;
&amp;lt;pre&amp;gt;sudo rpi-update&amp;lt;/pre&amp;gt;&lt;br /&gt;
In case the kernel was updated, reboot:&lt;br /&gt;
&amp;lt;pre&amp;gt;sudo reboot&amp;lt;/pre&amp;gt;&lt;br /&gt;
Install the rpi-source tool:&lt;br /&gt;
&amp;lt;pre&amp;gt;sudo wget https://raw.githubusercontent.com/notro/rpi-source/master/rpi-source -O /usr/bin/rpi-source &amp;amp;&amp;amp; sudo chmod +x /usr/bin/rpi-source &amp;amp;&amp;amp; /usr/bin/rpi-source -q --tag-update&amp;lt;/pre&amp;gt;&lt;br /&gt;
Run rpi-source:&lt;br /&gt;
&amp;lt;pre&amp;gt;rpi-source&amp;lt;/pre&amp;gt;&lt;br /&gt;
This step may take a while to complete.&amp;lt;br /&amp;gt;&lt;br /&gt;
Install ncurses:&lt;br /&gt;
&amp;lt;pre&amp;gt;sudo apt-get install libncurses5-dev&amp;lt;/pre&amp;gt;&lt;br /&gt;
Enable the UHID module compilation:&lt;br /&gt;
&amp;lt;pre&amp;gt;cd linux&lt;br /&gt;
make menuconfig&amp;lt;/pre&amp;gt;&lt;br /&gt;
Select Device Drivers&amp;gt;HID support&amp;gt;User-space I/O driver support for HID subsystem. The line should start with '&amp;lt;M&amp;gt;'.&amp;lt;br /&amp;gt;&lt;br /&gt;
To speed up the compilation, you can disable all other modules in the HID support section and subsections.&amp;lt;br /&amp;gt;&lt;br /&gt;
Save the config to the default location and exit.&amp;lt;br /&amp;gt;&lt;br /&gt;
Build the module:&lt;br /&gt;
&amp;lt;pre&amp;gt;make prepare&lt;br /&gt;
make scripts&lt;br /&gt;
make M=drivers/hid&amp;lt;/pre&amp;gt;&lt;br /&gt;
Install it:&lt;br /&gt;
&amp;lt;pre&amp;gt;sudo cp drivers/hid/uhid.ko /lib/modules/`uname -r`/kernel/drivers/hid/&lt;br /&gt;
sudo depmod -a&amp;lt;/pre&amp;gt;--&amp;gt;&lt;br /&gt;
&amp;lt;!--mkdir dest&lt;br /&gt;
make INSTALL_HDR_PATH=dest headers_install&lt;br /&gt;
sudo cp dest/include/linux/uhid.h /usr/include/linux/--&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== USB adapter using the on-board UART interface == &amp;lt;!--T:6--&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Hardware requirements === &amp;lt;!--T:25--&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:26--&amp;gt;&lt;br /&gt;
The on-board UART runs at 0V/3.3V levels, and the AVR USB board has to run at 5V to operate at 16MHz (running at 3.3V would only allow to operate at 8MHz).&amp;lt;br /&amp;gt;&lt;br /&gt;
Connecting the RPi and the AVR USB board directly may damage the hardware!&amp;lt;br /&amp;gt;&lt;br /&gt;
One cheap solution is to use a voltage divider:&amp;lt;br /&amp;gt;&lt;br /&gt;
* Connect both GNDs&lt;br /&gt;
* It's safe to connect the TXD pin of the RPi to the Rx pin of the AVR USB board (the GIMX firmwares configure the Rx pin as an input)&lt;br /&gt;
* To connect the Tx pin of the AVR USB board to the RXD pin of the RPi, you'll need to convert the voltage level from 0..5V to 0..3.3V.&amp;lt;br /&amp;gt;&lt;br /&gt;
This can be done with a simple resistive divider:&lt;br /&gt;
&amp;lt;div class=&amp;quot;image200px&amp;quot;&amp;gt;[https://gimx.fr/img/wiki/Resistive_divider.png https://gimx.fr/img/wiki/Resistive_divider.png]&amp;lt;/div&amp;gt;&lt;br /&gt;
Vin is the Tx pin of the AVR USB board, Vout is the RXD pin of the RPi, R1=2.2kΩ , R2=3.3kΩ&lt;br /&gt;
* Do not connect any other pin!&lt;br /&gt;
&lt;br /&gt;
=== Sotware adjustments === &amp;lt;!--T:15--&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:17--&amp;gt;&lt;br /&gt;
By default, the RPi UART is configured as a serial console.&amp;lt;br /&amp;gt;&lt;br /&gt;
Disable this serial console using raspi-config:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
sudo raspi-config &lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
Then select:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
&amp;quot;Advanced Options&amp;quot;, &amp;quot;Serial&amp;quot;, &amp;quot;No&amp;quot;, &amp;quot;Finish&amp;quot;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
The default configuration does not allow high baudrates.&amp;lt;br /&amp;gt;&lt;br /&gt;
Enable high baudrates editing /boot/config.txt:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
sudo nano /boot/config.txt&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
Add the following line at the end of the file:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
init_uart_clock=8000000 &lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
Reboot to apply the changes:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
sudo reboot&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== GIMX installation == &amp;lt;!--T:7--&amp;gt;&lt;br /&gt;
&amp;lt;pre&amp;gt;wget https://gimx.fr/download/gimx-raspbian -O gimx.deb&lt;br /&gt;
sudo dpkg -i gimx.deb&lt;br /&gt;
sudo apt-get -f install&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:8--&amp;gt;&lt;br /&gt;
If you get a &amp;quot;Dependency is not satisfiable: ...&amp;quot; error message, upgrade Raspbian:&lt;br /&gt;
&amp;lt;pre&amp;gt;sudo apt-get update &amp;amp;&amp;amp; sudo apt-get upgrade&lt;br /&gt;
sudo apt-get -f install&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Stop/disable triggerhappy service == &amp;lt;!--T:9--&amp;gt;&lt;br /&gt;
[https://github.com/wertarbyte/triggerhappy/blob/master/README Triggerhappy] is a daemon that opens every input device for reading, and that consumes a few percent of the CPU time.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:10--&amp;gt;&lt;br /&gt;
It seems a good idea to stop it while running GIMX.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:11--&amp;gt;&lt;br /&gt;
To stop triggerhappy:&lt;br /&gt;
 sudo service triggerhappy stop&lt;br /&gt;
To disable triggerhappy:&lt;br /&gt;
 sudo update-rc.d triggerhappy disable&lt;br /&gt;
&lt;br /&gt;
== Run GIMX == &amp;lt;!--T:12--&amp;gt;&lt;br /&gt;
Read the [[Quick_Start|Quick start page]] to learn how to run GIMX through the GUI.&amp;lt;br /&amp;gt;&lt;br /&gt;
A good idea is to run GIMX directly from a terminal, without starting a graphical session, which can be done over the network, using a ssh client, or you can [[#Autostart GIMX at boot without GUI]]&amp;lt;br /&amp;gt;&lt;br /&gt;
Ideally, GIMX should be launched without using the Ethernet port (because it is connected on the USB bus).&amp;lt;br /&amp;gt;&lt;br /&gt;
More details on command line options on [[Command_line|this page]].&amp;lt;br /&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Autostart GIMX at boot without GUI == &amp;lt;!--T:28--&amp;gt;&lt;br /&gt;
Simply create a file /etc/systemd/system/gimx.service (as root) with the following content:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:29--&amp;gt;&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
[Unit]&lt;br /&gt;
Description=GIMX  &lt;br /&gt;
After=syslog.target network.target&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:30--&amp;gt;&lt;br /&gt;
[Service]&lt;br /&gt;
User=pi  &lt;br /&gt;
Type=simple  &lt;br /&gt;
# Replace /dev/ttyUSB0 with /dev/ttyAMA0 when using the on-board UART interface&lt;br /&gt;
ExecStart=/usr/bin/gimx -p /dev/ttyUSB0 -c LogitechDrivingForceGT_G29.xml --nograb  &lt;br /&gt;
Restart=always  &lt;br /&gt;
RestartSec=5&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:31--&amp;gt;&lt;br /&gt;
[Install]&lt;br /&gt;
WantedBy=multi-user.target&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:32--&amp;gt;&lt;br /&gt;
Replace ttyUSB0 with your device (/dev/ttyAMA0 when using the on-board UART interface) and LogitechDrivingForceGT_G29.xml with your mapping file (which should be available in the pi home directory as /home/pi/.gimx/config/LogitechDrivingForceGT_G29.xml)&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:33--&amp;gt;&lt;br /&gt;
Run &amp;lt;pre&amp;gt;sudo systemctl daemon-reload&amp;lt;/pre&amp;gt; to notify systemd about the new file and &amp;lt;pre&amp;gt;sudo systemctl enable gimx &amp;amp;&amp;amp; sudo systemctl start gimx&amp;lt;/pre&amp;gt; to enable the gimx service start at boot and start it in the same line.&lt;br /&gt;
&lt;br /&gt;
== Notify when GIMX is running using a led == &amp;lt;!--T:34--&amp;gt;&lt;br /&gt;
In order to have a proper confirmation about if the gimx service is up and running, you can add a simple python script that turns a led on if the gimx service is running.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:35--&amp;gt;&lt;br /&gt;
The file will be located at /home/pi/blink.py:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:36--&amp;gt;&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
#!/usr/bin/python&lt;br /&gt;
import os  &lt;br /&gt;
import time  &lt;br /&gt;
import RPi.GPIO as GPIO&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:37--&amp;gt;&lt;br /&gt;
led = 23  &lt;br /&gt;
button = 18  &lt;br /&gt;
GPIO.setmode(GPIO.BCM)  &lt;br /&gt;
GPIO.setup(led, GPIO.OUT)  &lt;br /&gt;
GPIO.setup(button, GPIO.IN, pull_up_down = GPIO.PUD_UP)&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:38--&amp;gt;&lt;br /&gt;
def Shutdown(channel):  &lt;br /&gt;
  GPIO.output(led, True)&lt;br /&gt;
  time.sleep(0.2)&lt;br /&gt;
  GPIO.output(led, False)&lt;br /&gt;
  time.sleep(0.2)&lt;br /&gt;
  GPIO.output(led, True)&lt;br /&gt;
  time.sleep(0.2)&lt;br /&gt;
  GPIO.output(led, False)&lt;br /&gt;
  os.system(&amp;quot;sudo shutdown -h now&amp;quot;)&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:39--&amp;gt;&lt;br /&gt;
GPIO.add_event_detect(18, GPIO.FALLING, callback = Shutdown, bouncetime = 2000)&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:40--&amp;gt;&lt;br /&gt;
while True:  &lt;br /&gt;
  found = False&lt;br /&gt;
  time.sleep(5)&lt;br /&gt;
  pids = [pid for pid in os.listdir('/proc') if pid.isdigit()]&lt;br /&gt;
  for pid in pids:&lt;br /&gt;
    try:&lt;br /&gt;
      cmd = open(os.path.join('/proc', pid, 'cmdline'), 'rb').read()&lt;br /&gt;
      if &amp;quot;gimx&amp;quot; in cmd:&lt;br /&gt;
        found = True&lt;br /&gt;
    except IOError: # proc has already terminated&lt;br /&gt;
      continue&lt;br /&gt;
  if found == True:&lt;br /&gt;
    GPIO.output(led, True)&lt;br /&gt;
  else:&lt;br /&gt;
    GPIO.output(led, False)&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:41--&amp;gt;&lt;br /&gt;
As a bonus, you can add a button so when it is pressed, there is a little blink effect, and the pi is shutted down.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:42--&amp;gt;&lt;br /&gt;
&amp;lt;div class=&amp;quot;image200px&amp;quot;&amp;gt;[https://gimx.fr/img/wiki/PiButtonLed.png https://gimx.fr/img/wiki/PiButtonLed.png]&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:43--&amp;gt;&lt;br /&gt;
To start at boot, simply add it to the pi user crontab (crontab -e) as &amp;lt;pre&amp;gt;@reboot python /home/pi/blink.py &amp;amp;&amp;lt;/pre&amp;gt;&lt;br /&gt;
&amp;lt;/translate&amp;gt;&lt;/div&gt;</summary>
		<author><name>Steel 3d</name></author>
		
	</entry>
	<entry>
		<id>https://gimx.fr/wiki/index.php?title=RPi&amp;diff=5052</id>
		<title>RPi</title>
		<link rel="alternate" type="text/html" href="https://gimx.fr/wiki/index.php?title=RPi&amp;diff=5052"/>
		<updated>2016-10-20T05:54:41Z</updated>

		<summary type="html">&lt;p&gt;Steel 3d: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&amp;lt;languages /&amp;gt;&lt;br /&gt;
&amp;lt;translate&amp;gt;&lt;br /&gt;
&amp;lt;!--T:1--&amp;gt;&lt;br /&gt;
'''Warning: RPi support should be considered as experimental. Be prepared to face issues if you try GIMX on the RPi.'''&lt;br /&gt;
&lt;br /&gt;
GIMX can run on many Linux targets, and the [http://www.raspberrypi.org/ the Raspberry Pi] is one of them!&lt;br /&gt;
== Hardware considerations == &amp;lt;!--T:23--&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:24--&amp;gt;&lt;br /&gt;
Use a USB HUB only if there are no ports available on the RPi.&amp;lt;br /&amp;gt;&lt;br /&gt;
It is highly recommended to use a HUB with an external power supply.&lt;br /&gt;
&lt;br /&gt;
== Firmware update == &amp;lt;!--T:5--&amp;gt;&lt;br /&gt;
As early firmwares had severe USB issues it is recommended to update the firmware before using GIMX.&amp;lt;br /&amp;gt;&lt;br /&gt;
Updating the firmware may also be useful if you plan to use a Logitech force feedback wheel (the uhid kernel module was missing in earlier firmwares).&amp;lt;br /&amp;gt;&lt;br /&gt;
Type the following command:&lt;br /&gt;
&amp;lt;pre&amp;gt;sudo rpi-update&lt;br /&gt;
sudo reboot&amp;lt;/pre&amp;gt;&lt;br /&gt;
If you have issues with the latest firmware, install the following instead:&lt;br /&gt;
&amp;lt;pre&amp;gt;sudo rpi-update 771a503cfc2a1130e2df2a4ddfc45ffa0f592b3f&lt;br /&gt;
sudo reboot&amp;lt;/pre&amp;gt;&lt;br /&gt;
Tested Rpi firmware:&lt;br /&gt;
&amp;lt;pre&amp;gt;pi@raspberrypi ~ $ uname -a&lt;br /&gt;
Linux raspberrypi 4.1.21+ #873 Mon Apr 11 18:00:37 BST 2016 armv6l GNU/Linux&amp;lt;/pre&amp;gt;&lt;br /&gt;
&amp;lt;!--== UHID kernel module ==&lt;br /&gt;
&lt;br /&gt;
If you plan to use a Logitech force feedback wheel, you will have to build the uhid.ko module for your kernel.&amp;lt;br /&amp;gt;&lt;br /&gt;
Install the right version of gcc, as explained here: [https://github.com/notro/rpi-source/wiki link].&amp;lt;br /&amp;gt;&lt;br /&gt;
Update your kernel:&lt;br /&gt;
&amp;lt;pre&amp;gt;sudo rpi-update&amp;lt;/pre&amp;gt;&lt;br /&gt;
In case the kernel was updated, reboot:&lt;br /&gt;
&amp;lt;pre&amp;gt;sudo reboot&amp;lt;/pre&amp;gt;&lt;br /&gt;
Install the rpi-source tool:&lt;br /&gt;
&amp;lt;pre&amp;gt;sudo wget https://raw.githubusercontent.com/notro/rpi-source/master/rpi-source -O /usr/bin/rpi-source &amp;amp;&amp;amp; sudo chmod +x /usr/bin/rpi-source &amp;amp;&amp;amp; /usr/bin/rpi-source -q --tag-update&amp;lt;/pre&amp;gt;&lt;br /&gt;
Run rpi-source:&lt;br /&gt;
&amp;lt;pre&amp;gt;rpi-source&amp;lt;/pre&amp;gt;&lt;br /&gt;
This step may take a while to complete.&amp;lt;br /&amp;gt;&lt;br /&gt;
Install ncurses:&lt;br /&gt;
&amp;lt;pre&amp;gt;sudo apt-get install libncurses5-dev&amp;lt;/pre&amp;gt;&lt;br /&gt;
Enable the UHID module compilation:&lt;br /&gt;
&amp;lt;pre&amp;gt;cd linux&lt;br /&gt;
make menuconfig&amp;lt;/pre&amp;gt;&lt;br /&gt;
Select Device Drivers&amp;gt;HID support&amp;gt;User-space I/O driver support for HID subsystem. The line should start with '&amp;lt;M&amp;gt;'.&amp;lt;br /&amp;gt;&lt;br /&gt;
To speed up the compilation, you can disable all other modules in the HID support section and subsections.&amp;lt;br /&amp;gt;&lt;br /&gt;
Save the config to the default location and exit.&amp;lt;br /&amp;gt;&lt;br /&gt;
Build the module:&lt;br /&gt;
&amp;lt;pre&amp;gt;make prepare&lt;br /&gt;
make scripts&lt;br /&gt;
make M=drivers/hid&amp;lt;/pre&amp;gt;&lt;br /&gt;
Install it:&lt;br /&gt;
&amp;lt;pre&amp;gt;sudo cp drivers/hid/uhid.ko /lib/modules/`uname -r`/kernel/drivers/hid/&lt;br /&gt;
sudo depmod -a&amp;lt;/pre&amp;gt;--&amp;gt;&lt;br /&gt;
&amp;lt;!--mkdir dest&lt;br /&gt;
make INSTALL_HDR_PATH=dest headers_install&lt;br /&gt;
sudo cp dest/include/linux/uhid.h /usr/include/linux/--&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== USB adapter using the on-board UART interface == &amp;lt;!--T:6--&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Hardware requirements === &amp;lt;!--T:25--&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:26--&amp;gt;&lt;br /&gt;
The on-board UART runs at 0V/3.3V levels, and the AVR USB board has to run at 5V to operate at 16MHz (running at 3.3V would only allow to operate at 8MHz).&amp;lt;br /&amp;gt;&lt;br /&gt;
Connecting the RPi and the AVR USB board directly may damage the hardware!&amp;lt;br /&amp;gt;&lt;br /&gt;
One cheap solution is to use a voltage divider:&amp;lt;br /&amp;gt;&lt;br /&gt;
* Connect both GNDs&lt;br /&gt;
* It's safe to connect the TXD pin of the RPi to the Rx pin of the AVR USB board (the GIMX firmwares configure the Rx pin as an input)&lt;br /&gt;
* To connect the Tx pin of the AVR USB board to the RXD pin of the RPi, you'll need to convert the voltage level from 0..5V to 0..3.3V.&amp;lt;br /&amp;gt;&lt;br /&gt;
This can be done with a simple resistive divider:&lt;br /&gt;
&amp;lt;div class=&amp;quot;image200px&amp;quot;&amp;gt;[https://gimx.fr/img/wiki/Resistive_divider.png https://gimx.fr/img/wiki/Resistive_divider.png]&amp;lt;/div&amp;gt;&lt;br /&gt;
Vin is the Tx pin of the AVR USB board, Vout is the RXD pin of the RPi, R1=2.2kΩ , R2=3.3kΩ&lt;br /&gt;
* Do not connect any other pin!&lt;br /&gt;
&lt;br /&gt;
=== Sotware adjustments === &amp;lt;!--T:15--&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:17--&amp;gt;&lt;br /&gt;
By default, the RPi UART is configured as a serial console.&amp;lt;br /&amp;gt;&lt;br /&gt;
Disable this serial console using raspi-config:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
sudo raspi-config &lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
Then select:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
&amp;quot;Advanced Options&amp;quot;, &amp;quot;Serial&amp;quot;, &amp;quot;No&amp;quot;, &amp;quot;Finish&amp;quot;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
The default configuration does not allow high baudrates.&amp;lt;br /&amp;gt;&lt;br /&gt;
Enable high baudrates editing /boot/config.txt:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
sudo nano /boot/config.txt&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
Add the following line at the end of the file:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
init_uart_clock=8000000 &lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
Reboot to apply the changes:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
sudo reboot&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== GIMX installation == &amp;lt;!--T:7--&amp;gt;&lt;br /&gt;
&amp;lt;pre&amp;gt;sudo apt-get install gdebi&lt;br /&gt;
wget http://gimx.fr/download/gimx-raspbian -O gimx.deb&lt;br /&gt;
sudo gdebi gimx.deb&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:8--&amp;gt;&lt;br /&gt;
If you get a &amp;quot;Dependency is not satisfiable: ...&amp;quot; error message, upgrade Raspbian:&lt;br /&gt;
&amp;lt;pre&amp;gt;sudo apt-get update &amp;amp;&amp;amp; sudo apt-get upgrade&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Stop/disable triggerhappy service == &amp;lt;!--T:9--&amp;gt;&lt;br /&gt;
[https://github.com/wertarbyte/triggerhappy/blob/master/README Triggerhappy] is a daemon that opens every input device for reading, and that consumes a few percent of the CPU time.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:10--&amp;gt;&lt;br /&gt;
It seems a good idea to stop it while running GIMX.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:11--&amp;gt;&lt;br /&gt;
To stop triggerhappy:&lt;br /&gt;
 sudo service triggerhappy stop&lt;br /&gt;
To disable triggerhappy:&lt;br /&gt;
 sudo update-rc.d triggerhappy disable&lt;br /&gt;
&lt;br /&gt;
== Run GIMX == &amp;lt;!--T:12--&amp;gt;&lt;br /&gt;
Read the [[Quick_Start|Quick start page]] to learn how to run GIMX through the GUI.&amp;lt;br /&amp;gt;&lt;br /&gt;
A good idea is to run GIMX directly from a terminal, without starting a graphical session, which can be done over the network, using a ssh client, or you can [[#Autostart GIMX at boot without GUI]]&amp;lt;br /&amp;gt;&lt;br /&gt;
Ideally, GIMX should be launched without using the Ethernet port (because it is connected on the USB bus).&amp;lt;br /&amp;gt;&lt;br /&gt;
More details on command line options on [[Command_line|this page]].&amp;lt;br /&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Autostart GIMX at boot without GUI ==&lt;br /&gt;
Simply create a file /etc/systemd/system/gimx.service (as root) with the following content:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
[Unit]&lt;br /&gt;
Description=GIMX  &lt;br /&gt;
After=syslog.target network.target&lt;br /&gt;
&lt;br /&gt;
[Service]&lt;br /&gt;
User=pi  &lt;br /&gt;
Type=simple  &lt;br /&gt;
ExecStart=/usr/bin/gimx -p /dev/ttyUSB0 -c LogitechDrivingForceGT_G29.xml --nograb  &lt;br /&gt;
Restart=always  &lt;br /&gt;
RestartSec=5&lt;br /&gt;
&lt;br /&gt;
[Install]&lt;br /&gt;
WantedBy=multi-user.target&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Replace ttyUSB0 with your device and LogitechDrivingForceGT_G29.xml with your mapping file (which should be available in the pi home directory as /home/pi/.gimx/config/LogitechDrivingForceGT_G29.xml)&lt;br /&gt;
&lt;br /&gt;
Run &amp;lt;pre&amp;gt;sudo systemctl daemon-reload&amp;lt;/pre&amp;gt; to notify systemd about the new file and &amp;lt;pre&amp;gt;sudo systemctl enable gimx &amp;amp;&amp;amp; sudo systemctl start gimx&amp;lt;/pre&amp;gt; to enable the gimx service start at boot and start it in the same line.&lt;br /&gt;
&lt;br /&gt;
== Notify when GIMX is running using a led ==&lt;br /&gt;
In order to have a proper confirmation about if the gimx service is up and running, you can add a simple python script that turns a led on if the gimx service is running.&lt;br /&gt;
&lt;br /&gt;
The file will be located at /home/pi/blink.py:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
#!/usr/bin/python&lt;br /&gt;
import os  &lt;br /&gt;
import time  &lt;br /&gt;
import RPi.GPIO as GPIO&lt;br /&gt;
&lt;br /&gt;
led = 23  &lt;br /&gt;
button = 18  &lt;br /&gt;
GPIO.setmode(GPIO.BCM)  &lt;br /&gt;
GPIO.setup(led, GPIO.OUT)  &lt;br /&gt;
GPIO.setup(button, GPIO.IN, pull_up_down = GPIO.PUD_UP)&lt;br /&gt;
&lt;br /&gt;
def Shutdown(channel):  &lt;br /&gt;
  GPIO.output(led, True)&lt;br /&gt;
  time.sleep(0.2)&lt;br /&gt;
  GPIO.output(led, False)&lt;br /&gt;
  time.sleep(0.2)&lt;br /&gt;
  GPIO.output(led, True)&lt;br /&gt;
  time.sleep(0.2)&lt;br /&gt;
  GPIO.output(led, False)&lt;br /&gt;
  os.system(&amp;quot;sudo shutdown -h now&amp;quot;)&lt;br /&gt;
&lt;br /&gt;
GPIO.add_event_detect(18, GPIO.FALLING, callback = Shutdown, bouncetime = 2000)&lt;br /&gt;
&lt;br /&gt;
while True:  &lt;br /&gt;
  found = False&lt;br /&gt;
  time.sleep(5)&lt;br /&gt;
  pids = [pid for pid in os.listdir('/proc') if pid.isdigit()]&lt;br /&gt;
  for pid in pids:&lt;br /&gt;
    try:&lt;br /&gt;
      cmd = open(os.path.join('/proc', pid, 'cmdline'), 'rb').read()&lt;br /&gt;
      if &amp;quot;gimx&amp;quot; in cmd:&lt;br /&gt;
        found = True&lt;br /&gt;
    except IOError: # proc has already terminated&lt;br /&gt;
      continue&lt;br /&gt;
  if found == True:&lt;br /&gt;
    GPIO.output(led, True)&lt;br /&gt;
  else:&lt;br /&gt;
    GPIO.output(led, False)&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
As a bonus, you can add a button so when it is pressed, there is a little blink effect, and the pi is shutted down.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;div class=&amp;quot;image200px&amp;quot;&amp;gt;[https://gimx.fr/img/wiki/PiButtonLed.png https://gimx.fr/img/wiki/PiButtonLed.png]&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
To start at boot, simply add it to the pi user crontab (crontab -e) as &amp;lt;pre&amp;gt;@reboot python /home/pi/blink.py &amp;amp;&amp;lt;/pre&amp;gt;&lt;br /&gt;
&amp;lt;/translate&amp;gt;&lt;/div&gt;</summary>
		<author><name>Steel 3d</name></author>
		
	</entry>
	<entry>
		<id>https://gimx.fr/wiki/index.php?title=RPi&amp;diff=5051</id>
		<title>RPi</title>
		<link rel="alternate" type="text/html" href="https://gimx.fr/wiki/index.php?title=RPi&amp;diff=5051"/>
		<updated>2016-10-20T05:44:10Z</updated>

		<summary type="html">&lt;p&gt;Steel 3d: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&amp;lt;languages /&amp;gt;&lt;br /&gt;
&amp;lt;translate&amp;gt;&lt;br /&gt;
&amp;lt;!--T:1--&amp;gt;&lt;br /&gt;
'''Warning: RPi support should be considered as experimental. Be prepared to face issues if you try GIMX on the RPi.'''&lt;br /&gt;
&lt;br /&gt;
GIMX can run on many Linux targets, and the [http://www.raspberrypi.org/ the Raspberry Pi] is one of them!&lt;br /&gt;
== Hardware considerations == &amp;lt;!--T:23--&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:24--&amp;gt;&lt;br /&gt;
Use a USB HUB only if there are no ports available on the RPi.&amp;lt;br /&amp;gt;&lt;br /&gt;
It is highly recommended to use a HUB with an external power supply.&lt;br /&gt;
&lt;br /&gt;
== Firmware update == &amp;lt;!--T:5--&amp;gt;&lt;br /&gt;
As early firmwares had severe USB issues it is recommended to update the firmware before using GIMX.&amp;lt;br /&amp;gt;&lt;br /&gt;
Updating the firmware may also be useful if you plan to use a Logitech force feedback wheel (the uhid kernel module was missing in earlier firmwares).&amp;lt;br /&amp;gt;&lt;br /&gt;
Type the following command:&lt;br /&gt;
&amp;lt;pre&amp;gt;sudo rpi-update&lt;br /&gt;
sudo reboot&amp;lt;/pre&amp;gt;&lt;br /&gt;
If you have issues with the latest firmware, install the following instead:&lt;br /&gt;
&amp;lt;pre&amp;gt;sudo rpi-update 771a503cfc2a1130e2df2a4ddfc45ffa0f592b3f&lt;br /&gt;
sudo reboot&amp;lt;/pre&amp;gt;&lt;br /&gt;
Tested Rpi firmware:&lt;br /&gt;
&amp;lt;pre&amp;gt;pi@raspberrypi ~ $ uname -a&lt;br /&gt;
Linux raspberrypi 4.1.21+ #873 Mon Apr 11 18:00:37 BST 2016 armv6l GNU/Linux&amp;lt;/pre&amp;gt;&lt;br /&gt;
&amp;lt;!--== UHID kernel module ==&lt;br /&gt;
&lt;br /&gt;
If you plan to use a Logitech force feedback wheel, you will have to build the uhid.ko module for your kernel.&amp;lt;br /&amp;gt;&lt;br /&gt;
Install the right version of gcc, as explained here: [https://github.com/notro/rpi-source/wiki link].&amp;lt;br /&amp;gt;&lt;br /&gt;
Update your kernel:&lt;br /&gt;
&amp;lt;pre&amp;gt;sudo rpi-update&amp;lt;/pre&amp;gt;&lt;br /&gt;
In case the kernel was updated, reboot:&lt;br /&gt;
&amp;lt;pre&amp;gt;sudo reboot&amp;lt;/pre&amp;gt;&lt;br /&gt;
Install the rpi-source tool:&lt;br /&gt;
&amp;lt;pre&amp;gt;sudo wget https://raw.githubusercontent.com/notro/rpi-source/master/rpi-source -O /usr/bin/rpi-source &amp;amp;&amp;amp; sudo chmod +x /usr/bin/rpi-source &amp;amp;&amp;amp; /usr/bin/rpi-source -q --tag-update&amp;lt;/pre&amp;gt;&lt;br /&gt;
Run rpi-source:&lt;br /&gt;
&amp;lt;pre&amp;gt;rpi-source&amp;lt;/pre&amp;gt;&lt;br /&gt;
This step may take a while to complete.&amp;lt;br /&amp;gt;&lt;br /&gt;
Install ncurses:&lt;br /&gt;
&amp;lt;pre&amp;gt;sudo apt-get install libncurses5-dev&amp;lt;/pre&amp;gt;&lt;br /&gt;
Enable the UHID module compilation:&lt;br /&gt;
&amp;lt;pre&amp;gt;cd linux&lt;br /&gt;
make menuconfig&amp;lt;/pre&amp;gt;&lt;br /&gt;
Select Device Drivers&amp;gt;HID support&amp;gt;User-space I/O driver support for HID subsystem. The line should start with '&amp;lt;M&amp;gt;'.&amp;lt;br /&amp;gt;&lt;br /&gt;
To speed up the compilation, you can disable all other modules in the HID support section and subsections.&amp;lt;br /&amp;gt;&lt;br /&gt;
Save the config to the default location and exit.&amp;lt;br /&amp;gt;&lt;br /&gt;
Build the module:&lt;br /&gt;
&amp;lt;pre&amp;gt;make prepare&lt;br /&gt;
make scripts&lt;br /&gt;
make M=drivers/hid&amp;lt;/pre&amp;gt;&lt;br /&gt;
Install it:&lt;br /&gt;
&amp;lt;pre&amp;gt;sudo cp drivers/hid/uhid.ko /lib/modules/`uname -r`/kernel/drivers/hid/&lt;br /&gt;
sudo depmod -a&amp;lt;/pre&amp;gt;--&amp;gt;&lt;br /&gt;
&amp;lt;!--mkdir dest&lt;br /&gt;
make INSTALL_HDR_PATH=dest headers_install&lt;br /&gt;
sudo cp dest/include/linux/uhid.h /usr/include/linux/--&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== USB adapter using the on-board UART interface == &amp;lt;!--T:6--&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Hardware requirements === &amp;lt;!--T:25--&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:26--&amp;gt;&lt;br /&gt;
The on-board UART runs at 0V/3.3V levels, and the AVR USB board has to run at 5V to operate at 16MHz (running at 3.3V would only allow to operate at 8MHz).&amp;lt;br /&amp;gt;&lt;br /&gt;
Connecting the RPi and the AVR USB board directly may damage the hardware!&amp;lt;br /&amp;gt;&lt;br /&gt;
One cheap solution is to use a voltage divider:&amp;lt;br /&amp;gt;&lt;br /&gt;
* Connect both GNDs&lt;br /&gt;
* It's safe to connect the TXD pin of the RPi to the Rx pin of the AVR USB board (the GIMX firmwares configure the Rx pin as an input)&lt;br /&gt;
* To connect the Tx pin of the AVR USB board to the RXD pin of the RPi, you'll need to convert the voltage level from 0..5V to 0..3.3V.&amp;lt;br /&amp;gt;&lt;br /&gt;
This can be done with a simple resistive divider:&lt;br /&gt;
&amp;lt;div class=&amp;quot;image200px&amp;quot;&amp;gt;[https://gimx.fr/img/wiki/Resistive_divider.png https://gimx.fr/img/wiki/Resistive_divider.png]&amp;lt;/div&amp;gt;&lt;br /&gt;
Vin is the Tx pin of the AVR USB board, Vout is the RXD pin of the RPi, R1=2.2kΩ , R2=3.3kΩ&lt;br /&gt;
* Do not connect any other pin!&lt;br /&gt;
&lt;br /&gt;
=== Sotware adjustments === &amp;lt;!--T:15--&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:17--&amp;gt;&lt;br /&gt;
By default, the RPi UART is configured as a serial console.&amp;lt;br /&amp;gt;&lt;br /&gt;
Disable this serial console using raspi-config:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
sudo raspi-config &lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
Then select:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
&amp;quot;Advanced Options&amp;quot;, &amp;quot;Serial&amp;quot;, &amp;quot;No&amp;quot;, &amp;quot;Finish&amp;quot;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
The default configuration does not allow high baudrates.&amp;lt;br /&amp;gt;&lt;br /&gt;
Enable high baudrates editing /boot/config.txt:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
sudo nano /boot/config.txt&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
Add the following line at the end of the file:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
init_uart_clock=8000000 &lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
Reboot to apply the changes:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
sudo reboot&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== GIMX installation == &amp;lt;!--T:7--&amp;gt;&lt;br /&gt;
&amp;lt;pre&amp;gt;sudo apt-get install gdebi&lt;br /&gt;
wget http://gimx.fr/download/gimx-raspbian -O gimx.deb&lt;br /&gt;
sudo gdebi gimx.deb&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:8--&amp;gt;&lt;br /&gt;
If you get a &amp;quot;Dependency is not satisfiable: ...&amp;quot; error message, upgrade Raspbian:&lt;br /&gt;
&amp;lt;pre&amp;gt;sudo apt-get update &amp;amp;&amp;amp; sudo apt-get upgrade&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Stop/disable triggerhappy service == &amp;lt;!--T:9--&amp;gt;&lt;br /&gt;
[https://github.com/wertarbyte/triggerhappy/blob/master/README Triggerhappy] is a daemon that opens every input device for reading, and that consumes a few percent of the CPU time.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:10--&amp;gt;&lt;br /&gt;
It seems a good idea to stop it while running GIMX.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:11--&amp;gt;&lt;br /&gt;
To stop triggerhappy:&lt;br /&gt;
 sudo service triggerhappy stop&lt;br /&gt;
To disable triggerhappy:&lt;br /&gt;
 sudo update-rc.d triggerhappy disable&lt;br /&gt;
&lt;br /&gt;
== Run GIMX == &amp;lt;!--T:12--&amp;gt;&lt;br /&gt;
Read the [[Quick_Start|Quick start page]] to learn how to run GIMX through the GUI.&amp;lt;br /&amp;gt;&lt;br /&gt;
A good idea is to run GIMX directly from a terminal, without starting a graphical session, which can be done over the network, using a ssh client, or you can [[#Autostart GIMX at boot without GUI]]&amp;lt;br /&amp;gt;&lt;br /&gt;
Ideally, GIMX should be launched without using the Ethernet port (because it is connected on the USB bus).&amp;lt;br /&amp;gt;&lt;br /&gt;
More details on command line options on [[Command_line|this page]].&amp;lt;br /&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Autostart GIMX at boot without GUI ==&lt;br /&gt;
Simply create a file /etc/systemd/system/gimx.service (as root) with the following content:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
[Unit]&lt;br /&gt;
Description=GIMX  &lt;br /&gt;
After=syslog.target network.target&lt;br /&gt;
&lt;br /&gt;
[Service]&lt;br /&gt;
User=pi  &lt;br /&gt;
Type=simple  &lt;br /&gt;
ExecStart=/usr/bin/gimx -p /dev/ttyUSB0 -c LogitechDrivingForceGT_G29.xml --nograb  &lt;br /&gt;
Restart=always  &lt;br /&gt;
RestartSec=5&lt;br /&gt;
&lt;br /&gt;
[Install]&lt;br /&gt;
WantedBy=multi-user.target&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Replace ttyUSB0 with your device and LogitechDrivingForceGT_G29.xml with your mapping file (which should be available in the pi home directory as /home/pi/LogitechDrivingForceGT_G29.xml)&lt;br /&gt;
&lt;br /&gt;
Run &amp;lt;pre&amp;gt;sudo systemctl daemon-reload&amp;lt;/pre&amp;gt; to notify systemd about the new file and &amp;lt;pre&amp;gt;sudo systemctl enable gimx &amp;amp;&amp;amp; sudo systemctl start gimx&amp;lt;/pre&amp;gt; to enable the gimx service start at boot and start it in the same line.&lt;br /&gt;
&lt;br /&gt;
== Notify when GIMX is running using a led ==&lt;br /&gt;
In order to have a proper confirmation about if the gimx service is up and running, you can add a simple python script that turns a led on if the gimx service is running.&lt;br /&gt;
&lt;br /&gt;
The file will be located at /home/pi/blink.py:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
#!/usr/bin/python&lt;br /&gt;
import os  &lt;br /&gt;
import time  &lt;br /&gt;
import RPi.GPIO as GPIO&lt;br /&gt;
&lt;br /&gt;
led = 23  &lt;br /&gt;
button = 18  &lt;br /&gt;
GPIO.setmode(GPIO.BCM)  &lt;br /&gt;
GPIO.setup(led, GPIO.OUT)  &lt;br /&gt;
GPIO.setup(button, GPIO.IN, pull_up_down = GPIO.PUD_UP)&lt;br /&gt;
&lt;br /&gt;
def Shutdown(channel):  &lt;br /&gt;
  GPIO.output(led, True)&lt;br /&gt;
  time.sleep(0.2)&lt;br /&gt;
  GPIO.output(led, False)&lt;br /&gt;
  time.sleep(0.2)&lt;br /&gt;
  GPIO.output(led, True)&lt;br /&gt;
  time.sleep(0.2)&lt;br /&gt;
  GPIO.output(led, False)&lt;br /&gt;
  os.system(&amp;quot;sudo shutdown -h now&amp;quot;)&lt;br /&gt;
&lt;br /&gt;
GPIO.add_event_detect(18, GPIO.FALLING, callback = Shutdown, bouncetime = 2000)&lt;br /&gt;
&lt;br /&gt;
while True:  &lt;br /&gt;
  found = False&lt;br /&gt;
  time.sleep(5)&lt;br /&gt;
  pids = [pid for pid in os.listdir('/proc') if pid.isdigit()]&lt;br /&gt;
  for pid in pids:&lt;br /&gt;
    try:&lt;br /&gt;
      cmd = open(os.path.join('/proc', pid, 'cmdline'), 'rb').read()&lt;br /&gt;
      if &amp;quot;gimx&amp;quot; in cmd:&lt;br /&gt;
        found = True&lt;br /&gt;
    except IOError: # proc has already terminated&lt;br /&gt;
      continue&lt;br /&gt;
  if found == True:&lt;br /&gt;
    GPIO.output(led, True)&lt;br /&gt;
  else:&lt;br /&gt;
    GPIO.output(led, False)&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
As a bonus, you can add a button so when it is pressed, there is a little blink effect, and the pi is shutted down.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;div class=&amp;quot;image200px&amp;quot;&amp;gt;[https://gimx.fr/img/wiki/PiButtonLed.png https://gimx.fr/img/wiki/PiButtonLed.png]&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
To start at boot, simply add it to the pi user crontab (crontab -e) as &amp;lt;pre&amp;gt;@reboot python /home/pi/blink.py &amp;amp;&amp;lt;/pre&amp;gt;&lt;br /&gt;
&amp;lt;/translate&amp;gt;&lt;/div&gt;</summary>
		<author><name>Steel 3d</name></author>
		
	</entry>
</feed>