XBMC Symbian S60 Remote v2 - unofficial third-party XBMC Remote Control for Symbian
#16
Hi. Algo with freeze problems

Nokia N86 8MP. Installed all componentes, the Ip as the server is right (tested as N86 can Surf the web via WIFI).

When the Script starts, ask for the network, selected the desired one (the same al always), the system freezes, or at least, starts working REEEEALLYYYY Slow.

Must Turn Off Telephone.

Also, is necessary the Touch Screen, or can you use the keyboard?. as N86 don't have touch screen ;D

Thanks for the improvement
Reply
#17
First of all, thank you for this great idea/script. Perfect for those waiting for an iPhone Wink

I own a Nokia E61 (Image: http://www.about-nokia.com/blog/media/1/...ia_e61.jpg) and had problems installing your sis-files. After some research, I found out that my mobile can't "digest" python packages above version 1.9.6. So I got the right package from https://garage.maemo.org/frs/?group_id=854 and installed everything without errors.

Unfortunately, the E61 has a whole keyboard and for typing numbers one has to hold a modifier key. So I changed your script to use some of the standard keys (like in the original script: EKeyDownArrow, EKey8...) AND scancodes.

In order to find out the scancode for each key, I wrote a tiny python script that shows it on key press.
Code:
import appuifw,e32,graphics
body=graphics.Image.new((176,208))
def keys(x):
if x['type']==3:
  body.clear()
  body.text((50,80),u'button ' + x['scancode'].__str__(),0x0000ff,font=u'Alb17b')
  canvas.blit(body)
appuifw.app.body=canvas=appuifw.Canvas(event_callback=keys)
body.clear(0xff0000)
canvas.blit(body)
e32.Ao_lock().wait()

And here the modified "XBMCRemotev2":
Code:
# XBMC Remote v2b
# with Events (less resource consumming)

# default ip:port
xbmc = u"192.168.0.10:80"

# background image route
background = u'e:\\Python\\bkg.png'


import appuifw
from graphics import *
import globalui
import e32
from key_codes import *
import urllib2

keyboard_state={}
last_keycode=0

#Imagen de fondo
def set_theme():
    global bkg_img
    bkg_img = Image.open(background)
    handle_redraw(())
    
def handle_redraw(rect):
    global bkg_img
    if bkg_img:
        canvas.blit(bkg_img)
        
def optionsHost():
    global xbmc
    xbmc = appuifw.query(u"Set xbmc host:port", "text", xbmc)
    
def optionsTheme():
    global background
    background = appuifw.query(u"Set Theme", "text", background)
    set_theme()

def quit():
    appuifw.app.set_exit()


def MyCommand(cmd):
urllib2.urlopen('http://'+xbmc+'/xbmcCmds/xbmcHttp?command=' + cmd)

def SendKey(k):
MyCommand('sendKey(' + k.__str__() + ')')

def MyAction(act):
MyCommand('ExecBuiltIn&parameter=XBMC.Action(' + act + ')')

#CustomActions
def PreviousMenu():
MyAction('PreviousMenu')

def ShowInfo():
MyAction('Info')

def Rewind():
MyAction('Rewind')

def FastForward():
MyAction('FastForward')

def VolumeUp():
MyAction('VolumeUp')

def VolumeDown():
MyAction('VolumeDown')

def SkipPrevious():
MyAction('SkipPrevious')

def SkipNext():
MyAction('SkipNext')

def Play():
MyAction('Play')

def Stop():
MyAction('Stop')

def Mute():
MyAction('Mute')

def AspectRatio():
MyAction('AspectRatio')

def ShowSubtitles():
MyAction('ShowSubtitles')
  
def MyFSSwitch():
MyCommand('action(199)')

#key mapping (e.g. 49 = 'R')
hotkeys = {
  49: Rewind,
  50: FastForward,
  51: VolumeUp,
  54: VolumeDown,
  52: SkipPrevious,
  53: SkipNext,
  55: Play,
  56: Stop,
  57: Mute,
  65: AspectRatio,
  83: ShowSubtitles,
  122: ShowInfo}

#eventhandler for keypresses
def keys(x):
if x['type']==3:
  sc = x['scancode']                        
  hotkeys.get(sc,lambda: print 'Not assigned')()
  
def exit_btn_cmd():
    MyAction('OSD')
    MyAction('ContextMenu')


appuifw.app.menu = [(u"Set XBMC host", optionsHost), (u"Set Theme", optionsTheme), (u"Exit", quit)]
appuifw.app.exit_key_handler=exit_btn_cmd
appuifw.app.screen='full'
appuifw.app.title=u'S60 XBMC Remote'

# extended Canvas constructor
canvas=appuifw.Canvas(event_callback=keys,redraw_callback=handle_redraw)

# set the application body to canvas
appuifw.app.body=canvas

# commands

#Left
canvas.bind(EKeyLeftArrow,lambda:SendKey(272))

#Right
canvas.bind(EKeyRightArrow,lambda:SendKey(273))

#Down
canvas.bind(EKeyDownArrow,lambda:SendKey(271))

#Right
canvas.bind(EKeyUpArrow,lambda:SendKey(270))

#Select
canvas.bind(EKeySelect,lambda:SendKey(256))

#Backspace -> Previous Dir      
canvas.bind(EKeyBackspace,lambda:SendKey(257))

#Space -> Previous Menu
canvas.bind(EKeySpace,PreviousMenu)

canvas.bind(EKeyNo,lambda:quit())    
        
canvas.bind(EKey0,MyFSSwitch)    

#Workaround to establish WLAN connection at start
MyCommand('')

lock=e32.Ao_lock()
set_theme()
lock.wait()

I do not attach these scripts as files, because I never code Python and expect that you will certainly find some mistakes and improvements. So this is not meant to be an out-of-the-box solution for everyone.
Reply
#18
on my E51 it works fine but I have a problem on exit.
if just load script and then exit everything is ok but if to send any command phone hangs or reboots.
Reply
#19
which version are you using? mine or ezzemo's?
Reply
#20
Ezzemo version
Have more details. If to send command and try to exit right after phone hangs. But when I tried to exit after 20-30 minutes of idle everything was ok Rolleyes
Reply
#21
there was someone else having a similar problem. he said it was because of a wrong ip and port setting. have you checked this?
Reply
#22
The IP and port are correct because XBMC receives commands.
I guess it relates with wireless connection. If it is still active phones hangs.
Reply
#23
@borispr:

please try this version:
http://rapidshare.com/files/429204934/XBMCRemotev2c.py
I wrapped the urllib2.urlopen with try/except, so at least it should not hang (hopefully).
Reply
#24
Thank you, Max.
I have tried your version - same result. Phone reboots not during button press (http connection) but when I try quit from the script. It quits correctly only when enough time passed since command sent.
Reply
#25
The script can be quit in 2 ways. By choosing 'Exit' in options menu and by pressing the "hang up" key on your phone. As far as I know, the second way is faster. Maybe this helps as a workaround?!
Reply
#26
both use the same function quit() where is just appuifw.app.set_exit()
Reply
#27
is there a chance to run the app on a Nokia N97 ?
Kodi 18.7 on Windows 10 (2x)/FireTV Stick (5x)/Android (2x) | MariaDB 5 on Synology Diskstation DS115/DS216+II
Reply
#28
Yes, you can. Every S60 mobile is supported. The only question is: which version of the python package can be installed on the device?
I have not found a list of all supported mobiles, but someone posted a bug concerning listboxes in version 2.0.0.0 and N97 here: https://garage.maemo.org/tracker/?func=d...&atid=3201
Since Ezzemo's app doesn't use any listboxes, I suppose that you can install the python package he provided.

If you encounter problems installing the sis-files, see this page for older python packages (< v2): https://garage.maemo.org/frs/?group_id=854

If you want to use more keys, look at this post: http://forum.xbmc.org/showpost.php?p=635...stcount=18
Reply
#29
Hi all,

for the interested, there's a version for the nokia 5800 here: http://forum.xbmc.org/showthread.php?tid=88522

Cheers

Thomas
Reply
#30
Ezzemo Wrote:Simple Python Based Remote control for XBMC.

Requires Wifi and a Symbian S60 3rd Edition Phone.

Screenshots:
Image Image

Download: http://www.mediafire.com/file/5j83on99cc...motev2.rar

PIPs Installer: http://www.megaupload.com/?d=IF16BWHY (you might also need it)

******************
**HOW TO INSTALL**
******************
  • Copy RAR contents to a folder.
  • Connect phone to PC in PCSuite Mode.
  • Install on Phone (using PC Suite or Similar):
    Python_2.0.0.sis
    PythonScriptShell_2.0.0_931-9.4.sis
    PIPs Installer 1.6 (if you don't have it already)
  • Modify XBMCRemotev2.py to set your default server address (open file with notepad and change IPTongueort on line 4)
  • Create Folder on the memory card on the phone named Python
  • Upload to recently created e:/Python:
    XBMCRemotev2.py
    bkg.png
    bkg2.png
  • Disconnect phone.
  • Make sure XBMC is on and HTTP Enabled: Settings->Network->Services->Allow control of XBMC via HTTP
  • Run Python2.0.0 (under aplications)
  • Select Options -> Run and select XBMCRemotev2.py
  • Use butons to control XBMC according to the image displayed.

************
**COMMANDS**
************

? : Set Host, change Theme or Exit
i : View movie information
* : Options Menu (on movie menu or while playing)
x : exit
C : Return

[+]: change Aspect Ratio (during movie)
[/]: Toogle Windowed or Fullscreen Mode
S : Toogle Subtitles on/off

Also: Play, Pause, Stop, FastForward, Rewind, Next, Previous, VolumeUp, VolumeDown, Mute


********************************************
Improvements:
  • The pythons scrip now works on key events, it is more CPU friendly and will not run out your battery.
  • More KeyOptions.
  • Visual display of commands
  • "Themes" supported


*********************************************
Known Problems or issues:
  • It will take some seconds to send the first keys.
  • If the cellphone is in standby it will take 2 key press to send command. the first to wake up.
  • I will not save your changed server adress.
  • You have to open python first to access the program. (a Sis programa can be created in the future)


****************************************

Tested on Nokia N85 using XBMC Dharma beta 2

Should work on:
Nokia N78, N79, N81, N82, N85, N86, N95, N96, E51, E55, E71, E72, E75, Samsung GT-I7110 and maybe some others.

Better than using the Iphone since you don't have to look at the screen, you can feel the keyboard.


Enjoy,
Ezzemo

dear Ezzemo, thanks for your code, program work fine with navigation only ( my mobile keyboard E 72 is Qwety)
i tried to modifying for my S60 V 3 , by change the Ekey 1 - 9 to the numkey, it work ok, but if i assign to the other key there is no action , do you have any idea to help me
thanks in advance.
MaxMustermann: i get keys_code from your Python script, it's helpfull, if you have any idea, pls help me anyway!. your remote script dont seem error by code.
Reply

Logout Mark Read Team Forum Stats Members Help
XBMC Symbian S60 Remote v2 - unofficial third-party XBMC Remote Control for Symbian1