<?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=Minwi</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=Minwi"/>
	<link rel="alternate" type="text/html" href="https://gimx.fr/wiki/index.php?title=Special:Contributions/Minwi"/>
	<updated>2026-05-07T10:54:28Z</updated>
	<subtitle>User contributions</subtitle>
	<generator>MediaWiki 1.31.7</generator>
	<entry>
		<id>https://gimx.fr/wiki/index.php?title=RPi&amp;diff=4934</id>
		<title>RPi</title>
		<link rel="alternate" type="text/html" href="https://gimx.fr/wiki/index.php?title=RPi&amp;diff=4934"/>
		<updated>2016-04-19T10:46:03Z</updated>

		<summary type="html">&lt;p&gt;Minwi: Added how to autostart gimx at boot and flash a led when running&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&amp;lt;/pre&amp;gt;&lt;br /&gt;
And don't forget to reboot:&lt;br /&gt;
&amp;lt;pre&amp;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.9+ #819 PREEMPT Thu Oct 1 20:31:26 BST 2015 armv6l&lt;br /&gt;
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;
== 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;[http://gimx.fr/img/wiki/Resistive_divider.png http://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;-- missing diagram --&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 /home/pi/blink.py&amp;lt;/pre&amp;gt;&lt;br /&gt;
&amp;lt;/translate&amp;gt;&lt;/div&gt;</summary>
		<author><name>Minwi</name></author>
		
	</entry>
</feed>