Remote Gimx Client-Server Questions

General Chat, Feel Free To talk about anything here.
Post Reply
sdelgran
Posts: 9
Joined: Tue Dec 02, 2014 7:02 pm

Remote Gimx Client-Server Questions

Post by sdelgran »

[I realize now that I posted this in General instead of Support. Can an Admin move it please?]

Let me first explain my config...

I wanted to make a remote on my phone for my PS3. So far, I have been using Unified Remote but there are many products with the same concept. The Remote control server is installed on a Windows machine. I also have on my LAN a loyal Pogoplug E02 (Armv5 board with 4 USB and 256 Mb RAM) running Archlinux for the last 3 years and serving as a NAS.

My idea was to put a BT dongle on the Linux box and use it as a Gimx server. I compiled/installed Gimx from source on the plug. It might not be as easy as having packages and a few things need to be adapted but it does not take long to figure it all out. At the end of the day I have a perfectly functional Gimx command-line-only server. At this stage, I fell in love with the project. ;-)

I start the server on a SSH console (Linux box):

Code: Select all

gimx --config SixaxisUsb.xml --hci 0 --nograb -s 192.168.1.50:9615 -b XX:XX:XX:XX:XX:XX
The Remote control server sends events as required by the phone (Windows box):

Code: Select all

gimx -d 192.168.1.50:9615 --event "up(255)"
gimx -d 192.168.1.50:9615 --event "up(0)"
(No delay between the 2 lines works perfectly).

So far so good. Everything works like a charm. Now, here are 2 little problems I have with this config.

1) How should I start the Gimx "server"? I tried to turn it into a systemd service (which can conveniently be started remotely). No error but it does not work either. I thought of writing a small TCP server, run it as a daemon and call it to start Gimx But I am unclear whether I will be able to run Gimx in a non-interactive mode. Am I missing something?

2) When using Gimx in Windows with the -d option as quoted above, if the remote Gimx does not reply, it just sits there forever. If I use the same command locally I get "Recvfrom: Connection refused" and it exits right away. Is there a time-out option I could set? Also, the error would be nice actually since that would give the "status" of the remote server (NO connection need to start it).

Of course, the alternative is probably to build a USB adapter and plug it directly in the Windows machine. I confessed having flashed an Arduino Micro Leonardo tonight and it works also beautifully. But it would just be much easier in my current setup if I could actually connect wirelessly to the PS3. Hence I still favor the little Linux box and the BT dongle.

Thank you for reading!
sdelgran
Posts: 9
Joined: Tue Dec 02, 2014 7:02 pm

Re: Remote Gimx Client-Server Questions

Post by sdelgran »

I resolved one bit of my first question:
How should I start the Gimx "server"? I tried to turn it into a systemd service (which can conveniently be started remotely). No error but it does not work either. I thought of writing a small TCP server, run it as a daemon and call it to start Gimx But I am unclear whether I will be able to run Gimx in a non-interactive mode. Am I missing something?
Running Gimx in the background was as easy as... sending it to the background. Ooops! :oops:

Code: Select all

gimx --config SixaxisUsb.xml --hci 0 --nograb -s 192.168.1.50:9615 -b XX:XX:XX:XX:XX:XX &
The systemd service works fine now but it does not help me much. I totally forgot I am running Windows on the client side and hence cannot use systemctl -H there. Of course, I can start the service (or Gimx really just the same) with SSH using plink or SCP. So I would say that this part is covered: I have a Gimx server running in the background until the PS3 shuts down. :mrgreen:
sdelgran
Posts: 9
Joined: Tue Dec 02, 2014 7:02 pm

Re: Remote Gimx Client-Server Questions

Post by sdelgran »

Hey Matlo, thanks for adding the 2 s timeout! I just pulled in Linux since the Windows Build has issues and saw the code in the UDP connector (I had added the same code myself). Well that should solve my second issue. Let me test it right now.
Last edited by sdelgran on Thu Dec 04, 2014 2:17 am, edited 1 time in total.
sdelgran
Posts: 9
Joined: Tue Dec 02, 2014 7:02 pm

Re: Remote Gimx Client-Server Questions

Post by sdelgran »

Nope, it does not timeout. I tried filling the struct entirely (with the micro-seconds as well) but it does not help. It is not my language of choice but I will try to debug some more since I am there...
sdelgran
Posts: 9
Joined: Tue Dec 02, 2014 7:02 pm

Re: Remote Gimx Client-Server Questions

Post by sdelgran »

OK. I got both platforms to compile and respect timeout. You've got a Pull Request...

My 2 issues are therefore resolved. :D I now have a fully working config. Thanks again!
Last edited by sdelgran on Thu Dec 04, 2014 12:11 pm, edited 1 time in total.
User avatar
Matlo
Posts: 5768
Joined: Wed Jul 06, 2011 7:01 am
Location: France
Contact:

Re: Remote Gimx Client-Server Questions

Post by Matlo »

I also did not manage to get the timeout working.
A select/poll seems to be a good alternative.
Thanks for the suggestion!
GIMX creator
Post Reply