GIMX Web API and Android application

Discuss everything to do with GIMX here
Lucashsmello
Posts: 17
Joined: Tue Nov 20, 2018 11:44 am
Location: Brazil
Contact:

GIMX Web API and Android application

Post by Lucashsmello »

I'm currently developing a GIMX Web API to serve an android application that starts/stops and monitors GIMX on a remote device (RPi for example). I am using python-flask-RESTful to implement it. The code is found here: https://github.com/Lucashsmello/GIMX-WebAPI.

This project is in the very beginning.

Currently the WebAPI service only uses gimx binary with its options, stdout+stderr and key events (ex: generate shift+ESC programmatically to stop gimx) to control and monitor GIMX process. Capturing status and error on stdout and stderr are not reliable and not easy. I think a proper solution should use a GIMX API that provides functionality to monitor and control gimx. Is there anything better than using "stdout+stderr+keyevents" already implemented or someone planning to implement?.


A screenshot of the current state of the android application:


It can start,stop, get the list of configurations files and monitor some errors. It usually works.
This is my first time developing a Web Server/API and i have low experience in Android development, therefore development is being very slow and any suggestions and help are welcome.
User avatar
Matlo
Posts: 5768
Joined: Wed Jul 06, 2011 7:01 am
Location: France
Contact:

Re: GIMX Web API and Android application

Post by Matlo »

Status could be provided via UDP packets using the same format as for controlling a remote instance.
https://gimx.fr/wiki/index.php?title=Network_API
GIMX creator
Lucashsmello
Posts: 17
Joined: Tue Nov 20, 2018 11:44 am
Location: Brazil
Contact:

Re: GIMX Web API and Android application

Post by Lucashsmello »

Thanks. I have some questions:
  • When does GIMX starts listening for udp packets? After or before connection with console and adapter is established?
  • I did not find any documentation about exit/return codes of gimx command line. What are the exit codes?
User avatar
Matlo
Posts: 5768
Joined: Wed Jul 06, 2011 7:01 am
Location: France
Contact:

Re: GIMX Web API and Android application

Post by Matlo »

GIMX can be cut into two stages. In the first one, it initializes all resources and, if using an adapter, synchronously detects its. In the second one, it just waits for events to happen from one of the resources. In this step most of the processing is asynchronous and non-blocking.

Following this logic, initializing a socket should be performed in the first stage, and processing received data should be performed in the second stage.
Lucashsmello wrote: Tue Jan 08, 2019 12:06 pm When does GIMX starts listening for udp packets? After or before connection with console and adapter is established?
It starts listening in the initialization stage, but no event gets processed before the end of the stage, which includes detecting the adapter.
Lucashsmello wrote: Tue Jan 08, 2019 12:06 pmI did not find any documentation about exit/return codes of gimx command line. What are the exit codes?
https://github.com/matlo/GIMX/blob/ae68 ... gimx.h#L26
GIMX creator
Lucashsmello
Posts: 17
Joined: Tue Nov 20, 2018 11:44 am
Location: Brazil
Contact:

Re: GIMX Web API and Android application

Post by Lucashsmello »

Current state:
Lucashsmello
Posts: 17
Joined: Tue Nov 20, 2018 11:44 am
Location: Brazil
Contact:

Re: GIMX Web API and Android application

Post by Lucashsmello »

I have just published a beta version of the android application on google play store named GIMX Controller. It is totally free to download and use, but not free of bugs. Please send feedback and report bugs in https://github.com/Lucashsmello/GIMX-WebAPI/issues.

The application is only a helper to start and do minor configurations on GIMX that is running on a remote device.
Requirements:
  • Linux based system running https://github.com/Lucashsmello/GIMX-WebAPI. (see installations instructions in the link)
  • Linux based system running a modified version of gimx. (Installations instructions above install this too)
  • Device running gimx and android device must be connected to the same home network (ethernet or wifi or hotspot).
  • Everything GIMX requires: gimx adapter, a ds4 connected (if using ps4), etc.
I'm not gonna lie, you will probably face with bugs. Please send log report from the android application itself, if possible, to lucasnetstuff@gmail.com and report bugs in https://github.com/Lucashsmello/GIMX-WebAPI/issues.
Cybereu
Posts: 182
Joined: Sun Jul 10, 2011 1:10 pm

Re: GIMX Web API and Android application

Post by Cybereu »

Working Flawless.
Minor bugs when rotating screen.
User avatar
LoneWolf81
Posts: 235
Joined: Sat Jun 15, 2019 11:49 am
Location: South Africa

GIMX Web API Android app setup

Post by LoneWolf81 »

Hi everyone

Hope this is the right section. I am currently trying to setup the webapi from this post viewtopic.php?f=11&t=2875&p=17604&hilit=webapi#p17604

I get to the point where I can open the app on the phone but when I try to download a config I get an error message " Could not download file - com.android.volley.servererror"

I have tried with both my Pi 2B+ and 3B+ using Raspbian Buster and Ubuntu server 19.10 distributions.

What I noticed is that I can open the version and status pages using the ip and port. The configfile page gives an error "internal server error"

So as far as I can see everything is running but somewhere there is something that's literally kicking my ass :mrgreen:

I got the log file (hope it helps) https://pastebin.com/uxdtM02L

My phone is a Sony XZ2 on Android 9 and not rooted.
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 .
User avatar
Matlo
Posts: 5768
Joined: Wed Jul 06, 2011 7:01 am
Location: France
Contact:

Re: GIMX Web API and Android application

Post by Matlo »

Hi,

This is a third-party app, there is no official support for it. Due to this reason I moved your post here.
GIMX creator
User avatar
LoneWolf81
Posts: 235
Joined: Sat Jun 15, 2019 11:49 am
Location: South Africa

Re: GIMX Web API and Android application

Post by LoneWolf81 »

Thank you Matlo

I managed to get it working after I took a look at the log from the app, it showed a different folder as opposed to the one from the pc
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