Remote control emulation via TCP/IP socket?

  Thread Rating:
  • 2 Votes - 5 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Post Reply
BDoc Offline
Junior Member
Posts: 7
Joined: Sep 2008
Reputation: 0
Post: #1
Are there already HTTP (or some other tcp/ip socket) commands that allow for simple remote control or controller emulation?


Thanks a lot.
find quote
d4rk Offline
Team-XBMC Developer
Posts: 500
Joined: May 2007
Reputation: 1
Location: Albuquerque
Post: #2
XBMC has both an HTTP API (TCP/IP) and an Event Server (UDP).

Use the HTTP API if you want to communicate bidirectionally with XBMC (obtain current status, current song, album art etc). The XBMC Remote iPhone App, for example, uses the HTTP API.

Use the Event Server, when you simply want to send XBMC button or analog events at high speeds with low latency. The Apple Remote support, for example, is implemented using the Event Server protocol.

Always read the XBMC online-manual, FAQ and search the forum before posting.
Please read and follow the forum rules.
For troubleshooting and bug reporting, please make sure you read this first.


[Image: badge.gif]
find quote
BDoc Offline
Junior Member
Posts: 7
Joined: Sep 2008
Reputation: 0
Post: #3
Ah, thanks a lot m8.

Can you point me toward any documentation on the event server protocol? I just want to mimic basic button presses.
find quote
d4rk Offline
Team-XBMC Developer
Posts: 500
Joined: May 2007
Reputation: 1
Location: Albuquerque
Post: #4
There are many example event clients here. For C++, you can use this header. There are Python and Java examples as well.

Always read the XBMC online-manual, FAQ and search the forum before posting.
Please read and follow the forum rules.
For troubleshooting and bug reporting, please make sure you read this first.


[Image: badge.gif]
find quote
BDoc Offline
Junior Member
Posts: 7
Joined: Sep 2008
Reputation: 0
Post: #5
Ahh...

I guess what I meant is.. is there already something like

http://xbox/button_1
http://xbox/button_2
http://xbox/up
http://xbox/down
http://xbox/left
http://xbox/right
find quote
d4rk Offline
Team-XBMC Developer
Posts: 500
Joined: May 2007
Reputation: 1
Location: Albuquerque
Post: #6
Yes, that is possible using the HTTP API which is very well documented here. Look for the SendKey command as that is probably what you're after.

Similarly if you want to use the Event Server protocol, you can use the send_button() function from the Python library, compressed snipped from this example.
Code:
xbmc = XBMCClient("Example Remote", "../../icons/bluetooth.png")
xbmc.connect()
xbmc.send_keyboard_button("right")

I'm moving this thread to the development subforum.

Always read the XBMC online-manual, FAQ and search the forum before posting.
Please read and follow the forum rules.
For troubleshooting and bug reporting, please make sure you read this first.


[Image: badge.gif]
find quote
timgray Offline
Junior Member
Posts: 20
Joined: Nov 2008
Reputation: 0
Post: #7
Anyone know how to enable this stuff in XBMC live? I cant get the webserver to function nor the event server.

Yes XBMC is working, I'm playing stuff off the network. I also can ping an dtelnet into it. but when I enable the webserver or event server and set to allow external access I never get any ports open even after a reboot.
find quote