Tue 3 Jan 2006
Since few month I had been using amaroK, this is a great music player for KDE with a powerful DCOP interface. This interface is the base of BlueamaroK, a script programmed in TCL that controls basic functions of the amaroK player with a SonyEriccson mobile telephone through a bluetooth connection.
2006-01-03 a las 7.07 pm
De tanto blue te vas a quedar como un pitufo xD. Exelente script. Lástima que no sirva para mi movil, pero seguro que más de uno le dará uso.
2006-01-03 a las 9.22 pm
oh!, excelente proyecto, me encanta!
decime que modelo de celular tenés, asi se cual va a ser mi proximo cellphone
2006-01-04 a las 12.52 pm
Gracias tocayo :oops:, uso un SonyEricsson T610, pero supongo que cualquier SonyEricsson debería funcionar, el script hace uso de comandos AT de Ericsson que deberían seguir cualquier modelo de esta marca.
2006-01-10 a las 12.51 pm
Buenas!
He probado el BlueAmarok y funcionó perfectamente. Puse lo del /etc/bluetooth/rfcomm.conf. Si bien el software bluetooth de KDE funciona perfectamente con mi movil enviando y recibiendo archivos, el blueamarok ya no funciona (despues de irme de casa con el movil evidentemente perdieron contacto). he reiniciado el servicio e incluso reiniciado el PC pero nada. Dice que permisos incorrectos aunque le doy +rw a others e incluso le he hecho chmod 777al dispositivo /etc/rfcomm0
Alguna idea?
2006-01-10 a las 10.56 pm
Buenas, prueba a ejecutar el comando ‘rfcomm’ sin ningún parámetro, imprimirá las asociaciones (bindings) actuales.
$ rfcomm
rfcomm0: 00:0E:07:3E:58:0D channel 1 closed
comprueba que esté enlazada la MAC del móvil con el dispositivo correcto (rfcomm0) y en el canal 1. La MAC del móvil la miras como explico en kde-apps:
$ hcitool scan
Scanning …
00:0E:07:3E:58:0D Khertz
En caso de tener el móvil enlazado a un dispositivo distinto puedes especificárselo al script pulsando en el botón de configuración del gestor de scripts del amaroK.
2006-01-11 a las 2.12 am
Gracias por tu respuesta. Realmente hago todos los pasos. De hecho me funcionó hasta que se perdió cobertura:
hcitool scan
Scanning …
00:0E:07:2D:FD:FF >-*BSD T610-
2006-01-11 a las 2.14 am
–El post anterior no se pegó entero creo q por el nombre de mi movil–
Gracias por tu respuesta. Realmente hago todos los pasos. De hecho me funcionó hasta que se perdió cobertura:
hcitool scan
Scanning …
00:0E:07:2D:FD:FF
# rfcomm bind rfcomm0 00:0E:07:2D:FD:FF 1
# chmod o+rw /dev/rfcomm0
2006-01-21 a las 7.59 pm
Buenas!
I would be glad for some assistance. Whenever I try to start blueamarok, I get the error message “can’t open device!”.
# hcitool scan
Scanning …
00:16:20:2D:EC:08 K750i
# rfcomm
rfcomm0: 00:16:20:2D:EC:08 channel 9 clean
rfcomm1: 00:16:20:2D:EC:08 channel 1 clean
I already did a
# chmod o+rw /dev/rfcomm0
# /etc/init.d/bluetooth restart
and then restarted amarok, but I still get the error. Any idea what I could do?
Kind regards
Samuel
2006-01-22 a las 1.44 am
Try bind rfcomm0 with the channel 1 (or try with some channels). But lamentably I think k750i isn’t compatible with this script :S.
2006-01-29 a las 3.33 pm
[…] amaroK поддържа разни допълнителни скриптчета (все още не съм ги разгледал всички) като едно от тях е blueamarok. Чрез него можем да управляваме плеъра чрез мобилен телефон SonyEricsson поддържащ bluetooth. Моделите P800 и P900 както и Symbian базираните могат да управляват amarok чрез Bemused сървър който клиент може да бъде инсталиран като приложение. […]
2006-02-13 a las 10.55 pm
Hola,
excelente script, lo probe con mi sony ericsson T637 y una tarjeta Bluetooth USB en mi Fedora Core 3 64 bits y funciona demasiado bien, he encontrado unos detalles que quisiera discutir contigo mas adelante.
Tu proyecto me a parecido genial y me a inspirado a trabajar algo parecido desde java para controlar presentaciones.
Un saludo desde Colombia.
atte,
andress calderon
2006-02-13 a las 11.17 pm
Muchas gracias por tu comentario :). Explícame cuando quieras esos detalles, siempre interesa saber las opiniones y deseos de las personas que usan tus programas.
Supongo que la aplicación Java se ejecutará en el PC, porque, si no me equivoco, desde el Java del teléfono móvil no puedes acceder a la conexión bluetooth.
Un saludo.
2006-02-16 a las 5.13 pm
Does this work for amarok-1.4?
Thans for the effort.
2006-02-16 a las 6.55 pm
I don’t know, I have not used the new version. But I think the basic operations will work correctly.
2006-03-26 a las 3.19 pm
works excellent with a Sony T610 an Amarok 1.4(b2)!
ThanKs!!!!!
2006-03-26 a las 4.49 pm
Hello Christian, thaks for the information and for using the script
2006-04-11 a las 5.32 pm
Hello,
YOur apps seems to be great but apparently I can’t use it on my K750i, do you project to make it compatible? It’ll be so great….
:P
Raphael
2006-04-15 a las 3.04 pm
No, I haven’t this phone model to make a conversion of the script, very very sorry. I made the script for my T610 and the K750i use a different AT instructions set. If someday I have this model I’ll make the conversion.
2006-04-26 a las 8.09 am
Hello -
I dloaded your script, just what I want!
However, I get an error no.225 in amaroK.
rfcomm and such report no errors in the terminal, the phone binds on startup ok.
I’m using a SE K700i and amaroK 1.4-1 beta3 or something like that.
Any idea what the error is?
Many thanks
2006-10-03 a las 9.41 pm
#!/usr/bin/tclsh
#######################################################################
#
# BlueamaroK - It controls basic functions of the amaroK Player with a
# SonyEriccson mobile telephone through a bluetooth connection.
#
# This script is released under GPL free license.
#
# Pablo Chinea
# ver. 0.51 - 13/01/2006
#
#######################################################################
#
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation; either version 2 of the License, or
# (at your option) any later version.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
#######################################################################
global CONFIGFILE
set CONFIGFILE “blueamarokrc”
#################
# Configuration #
#################
proc configurar {} {
global CONFIGFILE
global DISPOSITIVO
set outfile [open $CONFIGFILE w]
set DISPOSITIVO [ exec kdialog –inputbox “Serial device binded” “/dev/rfcomm0″ –caption “BlueamaroK Configuration” ]
puts $outfile $DISPOSITIVO
close $outfile
}
######################
# Load configuration #
######################
proc cargar {} {
global CONFIGFILE
global DISPOSITIVO
if { [file exists $CONFIGFILE] } {
set infile [open $CONFIGFILE r]
set DISPOSITIVO [ gets $infile ]
close $infile
} else {
configurar
}
}
##########################
# Connect with the phone #
##########################
proc Conectar {} {
global DISPOSITIVO
global CANAL
if { [ catch { set CANAL [ open $DISPOSITIVO r+ ] } ] == 1 } {
exec kdialog –sorry “Error! Can’t open $DISPOSITIVO device”
exit 1
}
fconfigure $CANAL -buffering none
fileevent $CANAL readable “Leer”
}
#######################################
# Capture the input send by the phone #
#######################################
proc Leer {} {
global CANAL
gets $CANAL entrada
puts stderr ” $atcmd”
puts $CANAL $atcmd
}
#######################################
# Capture the commands sent by amaroK #
#######################################
proc iface {} {
gets stdin entrada
if { [ string match “configure” $entrada ] } {
configurar
}
}
###############################
# Execute an action in amarok #
###############################
proc action { cmd } {
exec dcop amarok player $cmd
}
###################################################
# Execute an action in amarok (with 2 parameters) #
###################################################
proc action2 { cmd1 cmd2 } {
exec dcop amarok player $cmd1 $cmd2
}
#######################
# Parsing phone input #
#######################
proc Parsear { cadena } {
global EST
global CONT
if { [ string match “OK” $cadena ] } {
global OK
set OK 1
}
if { [ string match “ERROR” $cadena ] } {
set EST 1
atsend “AT*EAID=1,0,\”BLUEAMAROK ERROR!\APlease, send debug output to khertz\\80gmail.com\”,0″
vwait OK
vwait CONT
}
switch $EST {
0 {
if { [ string match “*EAAI” $cadena ] } {
set EST 1
kmenu 1
}
if { [ string match “*EAII: 0″ $cadena ] } {
set CONT 1
}
}
1 {
if { [ string match “*EAMI*” $cadena ] } {
set val [ string range $cadena 7 end ]
if { $val != 0 } {
global MENU
eval [ lindex $MENU [ expr $val * 2 - 1 ] ]
kmenu $val
} else {
set EST 0
}
set LASTVAL $val
}
if { [ string match “*EAII*” $cadena ] } {
set CONT 1
}
}
2 {
if { [ string match “*EAII*” $cadena ] } {
if { [ string match “*EAII: 15*” $cadena ] } {
set val [ string range $cadena 10 end ]
action2 setVolume $val
} else {
set CONT 1
set EST 1
}
}
}
3 {
if { [ string match “*EAMI*” $cadena ] } {
set val [ string range $cadena 7 end ]
if { $val != 0 } {
global lista
global pag
if { ($pag != 0) } {
if { ($val == 1) } {
showplaylist -1 0
} elseif { ($val == 7) } {
showplaylist 1 0
} else {
exec dcop amarok playlist playByIndex [ expr $pag * 5 + $val - 2 ]
}
} else {
if { ( $val == 6 ) } {
showplaylist 1 0
} else {
exec dcop amarok playlist playByIndex [ expr $val - 1 ]
}
}
set CONT 1
}
set EST 1
set CONT 1
}
}
}
}
#######################
# Volume control menu #
#######################
proc volume {} {
global EST
set EST 2
set vol [ expr [ exec dcop amarok player getVolume ] / 10 ]
atsend “AT*EAID=4,2,\”Volume control\”,10,$vol”
vwait CONT
}
########################
# Create the main menu #
########################
proc kmenu { sel } {
global MENU
set MENU {
“Next” “action next”
“Pause/Play” “action pause”
“Volume” volume
“Previous” “action prev”
“Backward” “action2 seekRelative -5″
“Forward” “action2 seekRelative 5″
“Mute” “action mute”
“Playlist” playlist
“Track Info” Info
“About” Acerca
}
## “Play” “action play”
## “Stop” “action stop”
set titulos “”
foreach { elem cmd } $MENU {
set titulos “$titulos,\”$elem\”"
}
set long [ expr [ llength $MENU ] / 2 ]
set playing [ exec dcop amarok player title ]
set playing [ regexp -inline {\m.{1,11}$} $playing ]
#regsub -all {[^qwertyuiopasdfghjklzxcvbnm QWERTYUIOPASDFGHJKLZXCVBNM1234567890]} $playing “” playing
atsend “AT*EASM=\”$playing\”,1,$sel,$long$titulos”
vwait OK
atsend “AT*EAST=\”$playing\”"
atsend “AT*EAM=\”$playing\”"
}
#########################
# Generate the playlist #
#########################
proc genlist { fich } {
set infile [open $fich r]
while { [ gets $infile cadena ] >= 0 } {
if { [ string match “**” $cadena ] } {
regexp “(.*)” [ string trim $cadena ] -> titulo
}
if { [ string match “**” $cadena ] } {
regexp “(.*)” [ string trim $cadena ] -> artista
}
if { [ string match “* 0 } {
set elem “$artista - $titulo”
} else {
set elem $titulo
}
lappend lista “$elem”
}
}
close $infile
return $lista
}
####################
# Get the playlist #
####################
proc playlist {} {
global EST
global lista
if { [ exec dcop amarok playlist getTotalTrackCount ] == 0 } {
atsend “AT*EAID=1,0,\”Playlist empty\”,20″
vwait OK
vwait CONT
} else {
set EST 3
set lista [ genlist [ exec dcop amarok playlist saveCurrentPlaylist ] ]
exec dcop amarok playlist shortStatusMessage “Default Playlist saved by BlueamaroK”
set pos [ exec dcop amarok playlist getActiveIndex ]
global pag
if { $pos == -1 } {
set pag 0
set offset 0
} else {
set pag [ expr $pos / 5 ]
set offset [ expr $pos % 5 + 1 ]
}
showplaylist 0 $offset
}
}
##########################
# Show the playlist menu #
##########################
proc showplaylist { inc offset } {
global lista
global pag
set pag [ expr $pag + $inc ]
set longit [ llength $lista ]
set ini [ expr $pag * 5 ]
if { [ expr ($longit - 1) / 5 ] == $pag } {
set fin [ expr $longit - 1 ]
} else {
set fin [ expr $ini + 4 ]
}
set titulos “”
set long [ expr $fin - $ini + 1 ]
if { $offset } {
set sel $offset
} else {
set sel 1
}
if { $pag != 0 } {
set titulos “$titulos,\”\”"
set long [ expr $long + 1 ]
set sel [ expr $sel + 1 ]
}
foreach elem [ lrange $lista $ini $fin ] {
set titulos “$titulos,\”$elem\”"
}
if { [ expr ($longit - 1) / 5 ] != $pag } {
set titulos “$titulos,\”\”"
set long [ expr $long + 1 ]
}
set npag [ expr $pag + 1 ]
set tpag [ expr ($longit - 1) / 5 + 1 ]
atsend “AT*EASM=\”Playlist ($npag/$tpag)\”,1,$sel,$long$titulos”
vwait CONT
}
##########################
# Show track information #
##########################
proc Info {} {
set nombre [ exec dcop amarok player nowPlaying ]
set duracion [ exec dcop amarok player totalTime ]
set info “* $nombre\A* $duracion”
set bitrate [ exec dcop amarok player bitrate ]
set samplerate [ expr [ exec dcop amarok player sampleRate ] / 1000 ]
set info “$info\A* $bitrate - $samplerate Hz”
set fichero [ exec dcop amarok player path ]
if { [ file readable $fichero ] == 1 } {
set tipo [ string trim [ exec file $fichero | cut -d: -f2 ] ]
set info “$info\A* $tipo”
}
atsend “AT*EAID=14,2,\”Track Info\”,\”$info\”"
vwait CONT
}
#######################
# Show “About” dialog #
#######################
proc Acerca {} {
set a_pro “* BlueamaroK ver. 0.51″
set a_aut “* Pablo Chinea ”
set a_web “* http://www.khertz.net/”
set a_lic “* This script is released under GPL free license.”
set acerca “$a_pro\A$a_aut\A$a_web\A$a_lic”
atsend “AT*EAID=14,2,\”About\”,\”$acerca\”"
vwait CONT
}
#############################
# Initialize the connection #
#############################
proc IniCon {} {
atsend “ATZ”
vwait OK
atsend “ATE=0″
vwait OK
#title for menu
atsend “AT*EAM=\”Amarok\”"
vwait OK
atsend “AT*EAID=1,0,\”Connected to Amarok\”,20″
vwait OK
vwait CONT
atsend “AT*EAST=\”Amarok\”"
vwait OK
}
#################
# Main function #
#################
proc main {} {
global EST
set EST 0
cargar
Conectar
IniCon
fileevent stdin readable “iface”
vwait BUCLEINF
}
main
2006-10-03 a las 9.43 pm
The above post:
Shows the last 11 chars (full words only) at the top of the menu, and on the main screen (below where it says the mobile network). Sorry for the nasty, hacky code, I dont speak Spanish, TCL or the k700i’s AT command set.
2006-11-30 a las 11.06 am
Hola a todos:
Una pregunta, hay algo malo? en mi K7001 solo aparece la leyenda: “bluemarok” debajo del logo del operdaor y al cambiarse la cancion aparece una ventanita (en el telefono) diciendo bluemarok: [unos simbolos raros] “y el titulo de la cancion” pero no me aparece nnguna opcion de cambiar la cancion ni muchomenos. Si al guien me pudiece decir porfavor que estoy haciendo mal, tengo la version de KDE-apps; Feodra core & gracias.
2006-12-01 a las 7.12 am
Gracias a quien haya sido, ya logre que funcionara, por si hay otro googlero que haya llegado aqui, la solucion fue buscar (en el telefono) en el menu, la opcion conectividad, luego accesorios, y ahi esta amarok; gracias.
2007-02-06 a las 11.07 pm
Great Tool,
i will use it with my CarPC (Debian Sarge) as Jukebox.
Greatings from Alemagne.
2007-02-07 a las 12.11 am
I’ve just edit your Tool.
A little new Feature:
Quit Amarok
The new lines are:
###############
# Quit amarok #
###############
proc quit {} {
exec dcop amarok MainApplication-Interface quit 2>/dev/null
}
and in the Menue:
….. “Now Playing” Info \
“Playlist” playlist \
“About” Acerca \
“Quit” quit \
]
set titulos “”
Have Fun.