PDA

View Full Version : [Announce] Phone Control Script


MohammadAG
2010-08-13, 02:07
Been using the commands on http://wiki.maemo.org/Phone_control for quite some time, and dbus not being my thing I always had to check the page for the commands, so I decided to merge them all into one script, this should give you an idea what the script does:

Usage: phone-control [OPTIONS]

Options:
-v Display version.
-h Show this help message.
--call [number] Call the number specified
--answercall Answer an incoming call (if present)
--endcall End an ongoing call (if present)
--imei Print the IMEI (serial) number
--imsi Print the IMSI number
--cellstrength Show cellular signal strength
--speakeron Turn loudspeaker on
--speakeroff Turn loudspeaker off
--vibrateon [pattern] Vibrate using the pattern specified
--vibrateoff [pattern] Stop vibrating the pattern specified
--listvibrapatterns Lists default vibration patterns
--ledon [pattern] Activate the LED pattern specified
--ledoff [pattern] Deactivate the LED pattern specified
--listledpatterns Lists default LED patterns
--profileset [profile] Change the current profile to the one specified
--email [address] Send an email to address specified
--syncemail Send and receive email
--mp-play [/path/file] Open the file specified in the media player.
--mp-pause Pause media player playback
--mp-stop Stop media player playback
--mp-resume Resume media player playback
--mp-next Skip to the next track
--mp-prev Skip to the previous track
--notify [message] Show a one-line notification
--dialog [message] Show a multi-line dialog (requires attention)
--lock Lock the device with a lock code
--unlock Unlock the device (useful over SSH)
--keylock Lock screen and keys
--keyunlock Unlock screen and keys
--cellon Enable cellular modem
--celloff Disable cellular modem
--cellmode [2G/3G/Dual] Set cellular modem mode
--bton Turn bluetooth on
--btoff Turn bluetooth off
--browse [url] Open the specified url in the browser
--volume [0-100] Set volume level
--dashboard Open dashboard
--fmtxon Turn on the FMTX
--fmtxoff Turn off the FMTX
--fmtxname Set FMTX RDS station name
--fmtxinfo Set FMTX RDS info text
--capture [/path/file] Capture an image and save it to the file specified
--frontcap [/path/file] Capture an image from the front cam and save it to the file specified


After installation open terminal and type phone-control to see the command list.

The script can of course be used as a backend for many other apps.

Feel free to report bugs here, although I've tested all the commands (except the camera and the loudspeaker ones) :)

Package name: phone-control
Package page: http://maemo.org/packages/view/phone-control

e0x
2010-08-13, 02:18
nice ! this make a lot easy do some really useful apps

Thanks!

jaywink
2010-08-13, 06:34
nice stuff \o/

edit; I was actually going to make a script to do all the required stuff relating to an alarm clock that opens a certain radio stream, for example. I can do all that with this, including setting volume, profiles etc required :)

vkv.raju
2010-08-13, 07:01
Thanks. Very good, clean and useful script.
Can this be enhanced to add lines to control the wifi chip too. I hope you plan to update this script even further.

AlMehdi
2010-08-13, 07:18
Marvelous as always MuhammadAG ;)

leojab
2010-08-13, 08:07
Excellentay Mohammed... This makes things easier for everyone

joelsk
2010-08-13, 08:16
hi.. i have a question.. is this meant to speed up the phone app launch time? as in the n900 only start ringing after the callers phone has been ringing for a while? thanks.

MohammadAG
2010-08-13, 09:14
Thanks. Very good, clean and useful script.
Can this be enhanced to add lines to control the wifi chip too. I hope you plan to update this script even further.

I'll add it today, already changed the imei and imsi commands so they only display the number.


This script won't speed up the phone app, I don't see how you concluded that, it's useful for what I listed above. :)

Corso85
2010-08-13, 09:43
Awesome.

Is there a way we can use it for SMS?

Edit: Am having trouble with speakeron and speakeroff. doesn't seem to do anything. Is it just me?

jakiman
2010-08-13, 10:27
This is awesome. It works perfectly with the Queen Beecon Widget. Now I can "much" easily create buttons on my desktop that calls the a specific number immediately upon click. Well, you can do anything that's mentioned above really. Awesome. Thanks MAG.

ny-hardcore
2010-08-13, 10:47
Nice!

will come in really handy...

one 'request' is it possible to add a pynotify im style message popup thingie as an option?

joelsk
2010-08-13, 11:14
Sorry.. Just asking.. Is there anything available that would be able to speed up the phone app launching? Getting a lot of miscalls. Searching thru the threads for a solution, can't seem to find any. Thanks.

James_Littler
2010-08-13, 11:21
Sorry.. Just asking.. Is there anything available that would be able to speed up the phone app launching? Getting a lot of miscalls. Searching thru the threads for a solution, can't seem to find any. Thanks.

Overclock, edit transitions.ini or install 'Transition Control' from the repos, that should help a bit.

Other than that...phone Nokia and shout at them until they fix their stupid software?

Corso85
2010-08-13, 11:55
Some more feed back.

I think something is wrong with --mp-play. It says "mpplay not found...." Other --mp commands work fine.

Thanks again for your efforts. :)

x-lette
2010-08-13, 12:05
This looks really great! Will try it out and give some feedback :)

Corso85
2010-08-13, 12:20
Last one I promise :D

This is not related to the script in specific, but the Wiki in general. Anyone one know if more can be done with "show dashboard"? I don't see the point if we can't select an App after "showing" the dashboard. :confused:

Thankies

x-lette
2010-08-13, 13:32
Last one I promise :D

This is not related to the script in specific, but the Wiki in general. Anyone one know if more can be done with "show dashboard"? I don't see the point if we can't select an App after "showing" the dashboard. :confused:

Thankies
Showing the dashboard itself is helpful when you are running a program which doesn't offer the possibility to go back to dashboard without leaving the prog. Another example is using browser in fullscreen mode and you don't want to go back to window mode just to get to dashboard. So you might add a line with the call to the system menu (the one you get by pressing the top button). :cool:

MohammadAG
2010-08-13, 13:38
Some more feed back.

I think something is wrong with --mp-play. It says "mpplay not found...." Other --mp commands work fine.

Thanks again for your efforts. :)

Fixed (hopefully) in the 0.2-1 :)

Corso85
2010-08-13, 14:30
Fixed (hopefully) in the 0.2-1 :)

Thanks. :)

Is speakeron/off working fine with you? Doesn't do much on my side. no errors though.

MohammadAG
2010-08-13, 14:56
Thanks. :)

Is speakeron/off working fine with you? Doesn't do much on my side. no errors though.

Hmm, the command from the wiki doesn't seem to be doing anything, not sure what it's for, if it doesn't do anything take it out of the wiki and I'll take it out of the app :)

Cue
2010-08-13, 23:55
so you used the speaker on off command while on a call? I'll test it out with a friend to see if I get the same.

vkv.raju
2010-08-14, 00:17
VERSION=0.1 still. You might want to change that.

EDIT: Never used those dbus things before. For some of the functions dest starts with Phone.Xxxx or with com.nokia.phone. Can we replace com.nokia.phone with Phone.Xxxx? Is it safe/correct?

ivnvir
2010-08-17, 16:22
what about connecting to the first saved internet connections? (as do the browser when you launch it).

WhiteWolf
2010-08-30, 14:19
This application is great.

You will only need to send sms.

DojwqIO
2010-09-24, 18:25
How do I install it?

Can I install by downloading the phone-control 0.2-4 deb for armel from the package page? Or do I need to add extras-devel to my repositories?

Thanks,

zerocool2k
2010-09-24, 22:35
Can you add battery level showing? Sometimes I don't want to turn on the screen just to see it. Would be great if I can do it from SSH :).

Pigro
2010-09-25, 00:29
lshal|grep "level.percentage" will return this over ssh without any need for new phone-control stuff?

zerocool2k
2010-09-25, 00:57
lshal|grep "level.percentage" will return this over ssh without any need for new phone-control stuff?

Well but the code looks "unfriendly" :D. Would be nice to have a uniform format like the phone control scripts.

WhiteWolf
2010-10-01, 23:10
"You can add the function to indicate GPS coordinates?

Are there plans to add SMS sending?

RAZOR
2010-10-02, 00:14
umm what exactly does this do? :/

WhiteWolf
2010-10-02, 09:03
To use this application scripts.

I'm preparing a script that captures the quality parameters of the network that we are interested in and storing them in csv format. The data recording time is extended.

Allow later analyzed with spreadsheets, etc.

The GPS is not accessible without SDK.

ahbarnasha
2010-12-30, 14:41
I want to open a playlist from the commandline
phone-control --mp-play file.mp3 works but when I try to use one of the playlist files in /home/user/.mafw-playlists it doesn't work.
do playlists need another dbus command?
if so, does anybody know the command?

thanks in advance,
AhBarnasha

Laughing Man
2011-01-06, 05:57
Does phone control --answercall work? Whenever I receive a phone call and try in shortcutd (short camera press) it doesn't work.

vi_
2011-01-09, 19:17
Yo mohammed, lovin' this scripthowever there seems to be a bug. The '...--wifion' and '...--wifioff' return an error. I think you are specifying the wlan0 interface as 'wlan0' as opposed to wlan0. The aposthrophes balls it up methinks.

nicolai
2011-01-17, 23:12
Hi MohammadAG,

the speaker options (--speakeron --speakeroff) doesn't work.
The dbus calls are from the n810 as far as I know. The right calls are:
speakeron

dbus-send --type=method_call --dest=org.maemo.Playback.Manager \
/org/maemo/Playback/Manager \
org.maemo.Playback.Manager.RequestPrivacyOverride boolean:True

speakeroff

dbus-send --type=method_call --dest=org.maemo.Playback.Manager \
/org/maemo/Playback/Manager \
org.maemo.Playback.Manager.RequestPrivacyOverride boolean:False


And for the capture commands, the commandline tools installed
by gst-tools has the suffix "-0.10" for example:

/usr/bin/gst-launch-0.10 v4l2camsrc device=/dev/video0\
num-buffers=1 ! video/x-raw-yuv,width=2592,height=1968 !\
ffmpegcolorspace ! jpegenc ! filesink location="$capturepath


Nicolai

vi_
2011-04-21, 10:03
yo mo, I hope your still rockin this badass script.

I have added flightmode on and flightmode off to mine. Here is teh patch:


74,75d73
< --flighton Enable flight mode
< --flightoff Disable flight mode
113,120d110
< flighton() {
< $prefix dbus-send --system --type=signal /com/nokia/mce/signal com.nokia.mce.signal.sig_device_mode_ind string:"flight"
< }
<
< flightoff() {
< $prefix dbus-send --system --type=signal /com/nokia/mce/signal com.nokia.mce.signal.sig_device_mode_ind string:"normal"
< }
<
453,460d442
< if [ "$1" = "--flighton" ]; then
< flighton
< fi
<
< if [ "$1" = "--flightoff" ]; then
< flightoff
< fi
<


Also, what exacly is gpsreverse function for?

vi_
2011-07-19, 10:41
Yo mo.

The 'resume' function is using the 'play' dbus call. It needs to be changed to resume.

I.e. replace the word play with resume on the dbus call in the script.

mase
2011-07-28, 14:04
If I disable Wifi with the script, my MAC changes every time. This
commands for Wifi work better:
http://wiki.maemo.org/Fcron

syake
2012-10-28, 03:35
quite nice script:cool:

Now we can kill the LED at camera is up,remotely take a picture and play a sound "dont touch my donuts:mad:" overSSH:)!