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.
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?
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:
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