Page 1 of 2

GIMX Web API and Android application

Posted: Sun Jan 06, 2019 12:22 am
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.

Re: GIMX Web API and Android application

Posted: Sun Jan 06, 2019 8:04 pm
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

Re: GIMX Web API and Android application

Posted: Tue Jan 08, 2019 12:06 pm
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?

Re: GIMX Web API and Android application

Posted: Thu Jan 10, 2019 8:26 am
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

Re: GIMX Web API and Android application

Posted: Mon Jan 28, 2019 8:42 pm
by Lucashsmello
Current state:

Re: GIMX Web API and Android application

Posted: Wed Aug 07, 2019 6:49 pm
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.

Re: GIMX Web API and Android application

Posted: Wed Aug 21, 2019 9:12 pm
by Cybereu
Working Flawless.
Minor bugs when rotating screen.

GIMX Web API Android app setup

Posted: Sat Dec 07, 2019 6:26 pm
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.

Re: GIMX Web API and Android application

Posted: Sat Dec 07, 2019 9:52 pm
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.

Re: GIMX Web API and Android application

Posted: Sun Dec 08, 2019 6:27 am
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