<?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=ElectronicZeta1</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=ElectronicZeta1"/>
	<link rel="alternate" type="text/html" href="https://gimx.fr/wiki/index.php?title=Special:Contributions/ElectronicZeta1"/>
	<updated>2026-05-01T11:03:09Z</updated>
	<subtitle>User contributions</subtitle>
	<generator>MediaWiki 1.31.7</generator>
	<entry>
		<id>https://gimx.fr/wiki/index.php?title=RPi&amp;diff=7846</id>
		<title>RPi</title>
		<link rel="alternate" type="text/html" href="https://gimx.fr/wiki/index.php?title=RPi&amp;diff=7846"/>
		<updated>2023-06-23T10:49:11Z</updated>

		<summary type="html">&lt;p&gt;ElectronicZeta1: &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. The USB controller has been unstable since the first version. 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;
== 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 [https://www.allaboutcircuits.com/textbook/direct-current/chpt-6/voltage-divider-circuits/ voltage 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 update &amp;amp;&amp;amp; 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 GIMX 8 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>ElectronicZeta1</name></author>
		
	</entry>
</feed>