Main Restorations Software Audio/Jukebox/MP3 Everything Else Buy/Sell/Trade
Project Announcements Monitor/Video GroovyMAME Merit/JVL Touchscreen Meet Up Retail Vendors
Driving & Racing Woodworking Software Support Forums Consoles Project Arcade Reviews
Automated Projects Artwork Frontend Support Forums Pinball Forum Discussion Old Boards
Raspberry Pi & Dev Board controls.dat Linux Miscellaneous Arcade Wiki Discussion Old Archives
Site News

Unread posts | New Replies | Recent posts | Rules | Chatroom | Wiki | File Repository | RSS | Submit news


  

Author Topic: How to use RGBCommander with a ServoStik and Attract Mode?  (Read 429 times)

0 Members and 1 Guest are viewing this topic.

wrybreadsf

  • Trade Count: (0)
  • Jr. Member
  • **
  • Offline Offline
  • Posts: 4
  • I want to build my own arcade controls!
How to use RGBCommander with a ServoStik and Attract Mode?
« on: February 02, 2018, 04:51:20 pm »
I just got my ServoStik in the mail (whoo hoo!), but am having trouble integrating it with Attract Mode under Ubuntu Linux.

I can control it using RGBCommander via it's daemon:

rgbcmdcon
set,stick,4

But the joystick doesn't switch when I run MAME (v.1888) ROMs from Attract Mode.

I'm not getting any new entries in the RGBCommander log when I run ROMs either. I have this line set in rbgcmdd.xml, which I gather is supposed to make the joystick automatically switch mode:

<joystick name="SERVOSTIK" on="1" hwthrottle="0"/>

And I added this line to mame.ini: "output          network".

I've also tried running "rgbcmdcon set,rom,shinobi", which, if I understand things correctly, should make the joystick switch to 8-way when the ROM Shinobi is run, but so far no luck.

Can anyone confirm that RGBCommander works with Attract Mode? And if so, any hints as to what specific setup steps are needed?

Alternatively, if there was a commandline interface to RGBCommander, I'd be all set. In other words, if I could run something like "rgbcmdcon set,stick,4" or "rgbcmd stick=4", I could easily make an Attract Mode plugin that sets the joystick mode when I launch a ROM, but there doesn't appear to be a way of controlling RGBCommander like that for some reason. I've been trying to connect to it's socket directly via Python (see below) to make my own command line interface, but so far haven't had any luck with that either.

Or ideally I'd love to control the ServoStik from Python or a simple binary directly, since this approach seems overly complicated just to essentially flip a switch. It should be doable using pyusb, but there doesn't appear to be any notes on the ServoStik's protocol anywhere, that I can find at least.

Or I could change the ServoStik controller to "hardware mode" and use an external relay, but that's a permanent change and I'd rather not do that unless I really need to.


By the way here's my attempt at some Python code to send a command to RGBCommander's daemon. It doesn't currently work though. I have a feeling I'm missing a delimiter at the end? To test, send the joystick mode [4 or 8] via commandline.

Code: [Select]
#!/usr/bin/python

import socket, sys, time

# get the joystick mode [4 or 8] from command line
mode = sys.argv[1]

HOST = 'localhost'
PORT = 2724
#s = socket.socket()
s=socket.socket(socket.AF_INET,socket.SOCK_STREAM)

s.connect((HOST, PORT))

cmd = "set,stick,%s" % mode
n = s.send(cmd)

s.close()
« Last Edit: February 02, 2018, 09:42:14 pm by wrybreadsf »

ZoOl007

  • Trade Count: (0)
  • Full Member
  • ***
  • Offline Offline
  • Posts: 114
    • RGBcommander
Re: How to use RGBCommander with a ServoStik and Attract Mode?
« Reply #1 on: February 03, 2018, 04:14:54 am »
Hi, yes it does work. It is fe agnostic as it watches processes.
You need to use v0.4.0.5 to be able to use the new mame network output system.
The fact that you don't get any lines tailing the log means that the deamon doesn't see the mame process.
If you have some lines indicating it sees it but nothing further than the mame process doesn't send anything.
Watching the log one should see lines starting and stopping mame. If you don't see that it's no good.
Is it correctly configured in the rgbcmdd.xml?

I've never used it with .188 but a higher version. Does mame's network output system work?
Telnet to it and see what it sends you. You should get output.
http://forum.arcadecontrols.com/index.php/topic,151464.0.html

Try the above first - forget the servostiks atm... if you solve the above it'll work fine. I have servostiks myself.

I can't tell you more without your xml and a full, but short,representative log.

My best guess is you made an xml cfg fault.

shinobi : that is correct but you don't need that

overly complicated : depends on your needs. It knows 38000+ roms and automates it and you can bend it in multiple ways. It's primary purpose is RGBleds though - the joysticks are a nice addition.

You can't interface with the daemon like that. It ony talks to rgbcmdcon (that itself doesn't accept most thing you pass to it).

I do have a standalone servostik switcher (eg the simple binary you refer to) I never released that does what you want. I'll think about it.

I don't have much time atm but I'll try to help you out. Send me cfg + log + you mame process name if you can't sort it out.

wrybreadsf

  • Trade Count: (0)
  • Jr. Member
  • **
  • Offline Offline
  • Posts: 4
  • I want to build my own arcade controls!
Re: How to use RGBCommander with a ServoStik and Attract Mode?
« Reply #2 on: February 03, 2018, 01:58:14 pm »
Aha, looks like I made a mistake. I'm actually using MAME .175. From your notes it looks like that version won't work with your software.

I tried using a later version of MAME and have problems with a lot of my ROMs. Everything else works well on my system so I'll probably stick with this version.

I hope you decide to release that simple commandline utility for Servo-Stiks, it would be useful. Or maybe just share the source code?

Or allow interfacing with the daemon from a different process (like my Python script).

Or allow running "rgbcmdcon set,stick,4". I see that rgbcmdcon accepts other commands interactively, so maybe that's an easy addition.
« Last Edit: February 13, 2018, 01:54:39 pm by wrybreadsf »

wrybreadsf

  • Trade Count: (0)
  • Jr. Member
  • **
  • Offline Offline
  • Posts: 4
  • I want to build my own arcade controls!
Re: How to use RGBCommander with a ServoStik and Attract Mode?
« Reply #3 on: February 13, 2018, 02:54:25 am »
I wound up putting my Servo-Stik into "hardware mode" and writing an Attract Mode plugin to control it using a USB relay. Works great. Details if anyone is interested:

http://forum.attractmode.org/index.php?topic=2123.msg14494#msg14494

And @ZoOl007, sure would be useful to have a commandline utility to control the Servo-Stik via conventional USB, if you can find time to release that.

  
 

Sitemap 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31