GIMX Web API Android app setup

Other hardware interoperability tutorials for game consoles.
Post Reply
User avatar
LoneWolf81
Posts: 232
Joined: Sat Jun 15, 2019 11:49 am
Location: South Africa

GIMX Web API Android app setup

Post by LoneWolf81 »

I know this is not officially supported but I just wanted to post about how I got it to work and some other things I added as I use my setup every day.

The base of this guide will come from instructions you can get from https://github.com/Lucashsmello/GIMX-WebAPI

Start off by having a clean install on your Raspberry Pi

Make sure everything is updated by opening a terminal and typing the following

Code: Select all

sudo apt-get update
sudo apt-get upgrade
After running these commands reboot and open a terminal window then run

Code: Select all

git clone https://github.com/Lucashsmello/GIMX-WebAPI.git
Go into the directory

Code: Select all

cd GIMX-WebAPI
Now run the following I found I had to run sudo with every command

Code: Select all

sudo apt install python3 python3-pip
sudo python3 -m pip install -U pip setuptools
sudo pip3 install -r requirements.txt
Since I was getting some errors on running the install.sh script this is where I deviated from the instructions on the Github page.

I opened a new terminal window or you can just go into the pi user directory and create a new directory and run the following

Code: Select all

mkdir install
wget https://github.com/Lucashsmello/GIMX-WebAPI/releases/download/0.7/installer.tar.gz
tar -xzf installer.tar.gz 
Change to build directory then run the following

Code: Select all

cd build
sudo dpkg -i gimx_7.12+-1_armhf_original.deb
sudo apt install –f
You can now run the install script, change back to the GIMX-WebAPI directory and run

Code: Select all

sudo ./install.sh --install-dir /home/pi/install --dont-install-gimx

Now if you open the app on your phone you will have a option to choose a config file and start GIMX, if you click on the options button and select download config you can choose the ones you want to download. If it fails with a com.android.volley.servererror just follow the steps below.

You are going to create a directory for the config files and change the root password

Code: Select all

sudo passwd root
Create your new password and run the following and make sure you are in /root

Code: Select all

su -l
mkdir .gimx
cd gimx
mkdir config
After this you should be able to download your files. If this is all you want to do you are done as I said I did some more things to make my life easier, so all the next steps are optional.

Share config directory over lan

If you want to have the option to exit your config files from another computer on your network you can install Samba and set it up to share your config directory.

Code: Select all

sudo apt-get install samba
sudo nano /etc/samba/smb.conf
Then add your share under the shared folders section I forced root but you can go and create a new user and group, my system is blocked off from any internet access after setup was done.

[GiMX-Config]
path = /root/.gimx/config
browsable = yes
guest ok = yes
read only = no
force user = root

Safe and exit then restart Samba

Code: Select all

sudo service smbd restart
You can now browse and open your config files for editing on any pc on your network using the gui version of GIMX-config.

Onboard Uart

If you are planning on using the onboard uart as per instructions on the Wiki page you might find that the program will fail as its not detecting the port.

On the Raspberry Pi 3B+ the uart is ttyS0 so you have to create a symbolic link and set it to run on every boot.

To make the link and run the following to confirm

Code: Select all

sudo ln -s /dev/ttyS0 /dev/ttyUSB0
ls -lh /dev/ttyUSB0
It should return something like this lrwxrwxrwx 1 root root 10 Feb 11 12:11 /dev/ttyUSB0 -> /dev/ttyS0

Now press start and check if everything works, if it does make it run at boot by adding it to /etc/rc.local before the exit 0 line and saving the file.

Code: Select all

sudo nano /etc/rc.local
Shutdown and Startup Buttons

I decided to add two buttons as I am running a PoE Hat and dont want to leave my Pi on all the time nor do I want to constantly unplug the lan cable to start it.

I started by editing the /boot/config.txt file and added

Code: Select all

dtoverlay=gpio-shutdown,gpio_pin=17,active_low=1,gpio_pull=up
just under the enable_uart=1 line

You can use any of the unused GPIO pins just make sure you change the number to the correct one. For reference you can use google to check GPIO header but GPIO 17 is Pin 11 on the 3B+

To start it from standby I used the RUN pin that's next to the PoE header.

Wiring wise all you need to do is add two momentary buttons from ground to the selected pins.

Trouble Shooting

After performing a update you are unable to connect to the Pi from your app

This is normally cause by another app using port 80 (normally apache web server) the solution is to edit the following file and changing the port number back to 51916

Code: Select all

sudo nano /etc/systemd/system/gimx-web.service
You will see 80 as port number just delete it and replace it with 51916 and save the file and restart the service.

Code: Select all

sudo service gimx-web restart 
Things to remember

The following is taken from the Wiki I just wanted to add them here to make it easier for people.

1. When using the onboard uart don't forget the voltage divider https://gimx.fr/wiki/index.php?title=RP ... _interface
2. Remember to add init_uart_clock=8000000 to /boot/config.txt (this is only when using the onboard uart)
3. If your mouse stutters edit /boot/cmdline.txt and set your polling rate usbhid.mousepoll=1 , the value can be 0-10 you can experiment to find one best suited to your setup. Remember to save file and reboot
4. Kill the Triggerhappy service

Code: Select all

sudo update-rc.d triggerhappy disable
The Finished Product.

Image

That's it from me I hope this helps someone.


I just want to thank everyone involved in this project you guys are the best :mrgreen:
Please Remember to Post your Log file in the support section , that way its easier and faster to start identifying the issue thus helping you to sort it out so you can enjoy GIMX :D .
Post Reply