maemo.org - Talk

maemo.org - Talk (https://talk.maemo.org/index.php)
-   MeeGo / Harmattan (https://talk.maemo.org/forumdisplay.php?f=45)
-   -   [Announce] ProfileMatic for Harmattan (https://talk.maemo.org/showthread.php?t=79642)

ajalkane 2012-12-28 14:53

Re: [Announce/WIP] ProfileMatic for Harmattan
 
Quote:

Originally Posted by zappAtom (Post 1308434)
Hi ajalkane,

regarding the DLNA questions, contact phako (http://talk.maemo.org/member.php?u=59947), author of the Helium DLNA controller. He also has an option in his app to autostart the DLNA server with his app and is involved a lot in N9 & DLNA stuff.

Thanks for the hint. I trust the people interested in dlna to pursue this further, and hopefully let us know the results here. Perhaps by writing a ready to use custom action recipe?

Kaacz 2012-12-28 18:25

Re: [Announce/WIP] ProfileMatic for Harmattan
 
Hi ajalkane,
where is log ? Info not in first post and i am unable find this in 100 pages :) .. and nothing find in /var/log/syslog (only daemon start/stop).

ajalkane 2012-12-28 21:25

Re: [Announce/WIP] ProfileMatic for Harmattan
 
Quote:

Originally Posted by Kaacz (Post 1308579)
Hi ajalkane,
where is log ? Info not in first post and i am unable find this in 100 pages :) .. and nothing find in /var/log/syslog (only daemon start/stop).

Sorry, I really should link in first page how to do this. I will do that soon. In the meanwhile, see this and ask if there's something unclear about doing it:

http://talk.maemo.org/showpost.php?p...&postcount=429

Kaacz 2012-12-29 02:20

Re: [Announce/WIP] ProfileMatic for Harmattan
 
aaah .. hidden in the middle(earth). :) Not log file, console output - OK for me. Lets bug-hunt-weekend starts! :)

PS: Helium (DLNA control) is opensource - http://gitorious.org/helium

ajalkane 2012-12-29 07:28

Re: [Announce/WIP] ProfileMatic for Harmattan
 
Quote:

Originally Posted by Kaacz (Post 1308670)
PS: Helium (DLNA control) is opensource - http://gitorious.org/helium

I took a quick look, and the process responsible seems to be "rygel".

So when stopping media sharing, killing process rygel should do it.

And it can be started with

/usr/bin/rygel -p 57734

Unfortunately the status bar does not show these changes until going into Settings -> Media sharing.

knobtviker 2012-12-29 09:27

Re: [Announce/WIP] ProfileMatic for Harmattan
 
I just dropped in to say I still prefer Profilematic over Situations. Not only because it's free and has more flexible options, but because I've seen the code and it's doing stuff properly.

tanwg 2012-12-31 01:29

Re: [Announce/WIP] ProfileMatic for Harmattan
 
I wanted to use Profilematic to quit Wazzap when I go to sleep and start it in the morning. If anyone has done it and is working, please do share with me! Thanks!

Btw, I am unable to disable standby screen under default rule. I had it disabled but when I turn off the screen, the standby screen still comes up. Anyone has this or is it just me?

zappAtom 2012-12-31 09:11

Re: [Announce/WIP] ProfileMatic for Harmattan
 
Quote:

Originally Posted by ajalkane (Post 1308722)
I took a quick look, and the process responsible seems to be "rygel".

So when stopping media sharing, killing process rygel should do it.

And it can be started with

/usr/bin/rygel -p 57734

Unfortunately the status bar does not show these changes until going into Settings -> Media sharing.

Yes, it is rygel and unfortunately also with the Helium app, the status bar doesn't notice if DLNA server is on or not...ths time you sometimes walk around with enabled DLNA server and don't notice it...

ajalkane 2012-12-31 15:14

Re: [Announce/WIP] ProfileMatic for Harmattan
 
Quote:

Originally Posted by tanwg (Post 1309276)
Btw, I am unable to disable standby screen under default rule. I had it disabled but when I turn off the screen, the standby screen still comes up. Anyone has this or is it just me?

Worked fine for me as I did a quick test just now.

Kaacz 2013-01-03 17:12

Re: [Announce/WIP] ProfileMatic for Harmattan
 
I have same problem, but not always. Bad for debug. I try it, but .. :(
In Default rule is Standby screen enable.
In rule is: when "home" cell-ids (300s) then Standby screen disable (with restore prev. mode).
In some days Standby screen is not enabled after leaving home cell-ids location.

Kaacz 2013-01-03 17:28

Re: [Announce/WIP] ProfileMatic for Harmattan
 
I have idea/tip/workaround/solution
I use same cell-ids places for more rules. I first thought it would be good to have lists of cell-ids for use in many rules.

But now i have solution.
I make new rule with name of place, collect cell-ids, save to bottom and deactivate. Next, for use in new rule, just simply i do: "Copy as new", change name and add conditions and Actions.

But, if cell-ids changed, i have no way to simply change only cell-ids in rules with same cell-ids place. I must recollect cell-ids for each rule. In the future it would be good to have the lists of the cell-id locations. :)

I hope, unlike my poor english, I wrote it clearly. :)

Kaacz 2013-01-03 20:07

Re: [Announce/WIP] ProfileMatic for Harmattan
 
About PSM "flapping":

I have this problem only if PSM status NOT defined in "default rule" !! :)

In case of RESET (i don't know why) in event in log, Profilematic not found PSM state in Default rule, then use "previous state" => set PSM to oposite state. Touché. :)

I wil paste log when i come home. Workaround exists, factors are known .. It's nothing tragic..

meegofan 2013-01-03 23:45

Hey guys,

I have an issue using profilematic along with the app 2G/3G. Basically, 2G/3G stopped working when I installed profilematic... Strangely, the flightmode app of the same developer is still working! Do you have any idea how to fix this problem?

ajalkane 2013-01-04 06:26

Re: [Announce/WIP] ProfileMatic for Harmattan
 
Quote:

Originally Posted by meegofan (Post 1310670)
Hey guys,

I have an issue using profilematic along with the app 2G/3G. Basically, 2G/3G stopped working when I installed profilematic... Strangely, the flightmode app of the same developer is still working! Do you have any idea how to fix this problem?

Try reinstalling 2g/3g app. I see no reason why ProfileMatic and that app would cause problems for each other.

ajalkane 2013-01-04 15:54

Re: [Announce/WIP] ProfileMatic for Harmattan
 
Quote:

Originally Posted by Kaacz (Post 1310569)
I have same problem, but not always. Bad for debug. I try it, but .. :(
In Default rule is Standby screen enable.
In rule is: when "home" cell-ids (300s) then Standby screen disable (with restore prev. mode).
In some days Standby screen is not enabled after leaving home cell-ids location.

Do you perhaps sometimes shutdown or restart your phone when you're at home? If so, what you observed could happen.

Using "restore previous" in your rule makes no sense in this case, and is in fact harmful. You should remove "restore previous" and let the default rule take care of switching standby screen on when you leave your home cell-ids.

Quote:

But, if cell-ids changed, i have no way to simply change only cell-ids in rules with same cell-ids place. I must recollect cell-ids for each rule. In the future it would be good to have the lists of the cell-id locations.

I hope, unlike my poor english, I wrote it clearly.
You did write it clearly, and I know the pain... I've been thinking about different kinds of ways to do that, like having a button "copy from another rule", or copy-paste kind of things. But I haven't settled on anything, and it's really low-priority so not sure when or if it'll be implemented.

kkarioja 2013-01-05 09:43

Re: [Announce/WIP] ProfileMatic for Harmattan
 
Schturman gave an useful tip considering mcetools. Setting background connections I have also tried to do before seems to work reliably now.

After gconfing the restricted mode on or off, I switch internet connection off for a second with mcetools. More than two weeks now with no problems!

Kaacz 2013-01-08 02:34

Re: [Announce/WIP] ProfileMatic for Harmattan
 
@ajalkane Todey, when i collect some cell-id, first time i read (on bottom) tip about copy rule for create next rule with same cell-id. I'm sorry. I'm bad reader. :)

snooky 2013-01-08 21:49

Re: [Announce/WIP] ProfileMatic for Harmattan
 
hello,

i have one little bug with profilematic.
i setup the app that stand by screen is off and flight mode is enabled, when phone is charging between 0-8am...

now when i'm charging at another time, stanby screen goes off too...

also would like if it would enable these rules when connecting as mass storage...

mangoicetea 2013-01-08 23:11

Re: [Announce/WIP] ProfileMatic for Harmattan
 
Quote:

Originally Posted by slarti (Post 1306829)
I found out a better way to use an NFC tag on my car holder than explained here.

My aim was to put my phone on my car holder (on which I put an NFC sticker on) and have it automatically switch BT on, pair with my...

I tried this myself and despite many attempts I can't seem to get the script working properly. Running this script in terminal:
#!/bin/sh
xdg-open /usr/share/applications/toggleBT_harmattan.desktop
killall music-suite
Got me this:
:no process killede
- $ invoker ...toggleBT..
in which the bluetooth toggle works fine but the music application isn't killed.

Switching the lines in the script to this:
#!/bin/sh
killall music-suite
xdg-open /usr/share/applications/toggleBT_harmattan.desktop
Gets me:
no default action for the given PARAMS
Any advice?

Script is in a folder called /home/user/MyDocs/Scripts

ajalkane 2013-01-09 07:29

Re: [Announce/WIP] ProfileMatic for Harmattan
 
Quote:

Originally Posted by snooky (Post 1312501)
hello,

i have one little bug with profilematic.
i setup the app that stand by screen is off and flight mode is enabled, when phone is charging between 0-8am...

now when i'm charging at another time, stanby screen goes off

That is peculiar. I'll post a new beta soon, please try if this issue still happens with it.

slarti 2013-01-09 10:09

Re: [Announce/WIP] ProfileMatic for Harmattan
 
Quote:

Originally Posted by mangoicetea (Post 1312520)
I tried this myself and despite many attempts I can't seem to get the script working properly. Running this script in terminal:
#!/bin/sh
xdg-open /usr/share/applications/toggleBT_harmattan.desktop
killall music-suite
Got me this:
:no process killede
- $ invoker ...toggleBT..
in which the bluetooth toggle works fine but the music application isn't killed.

Switching the lines in the script to this:
#!/bin/sh
killall music-suite
xdg-open /usr/share/applications/toggleBT_harmattan.desktop
Gets me:
no default action for the given PARAMS
Any advice?

Script is in a folder called /home/user/MyDocs/Scripts

Your script is probably written in windows and has MS-DOS formatting. Just go to terminal and use nano.

Code:

nano myscript.sh
Write your script there and save (the default /home/user is fine). It will work now.

ajalkane 2013-01-09 19:53

Re: [Announce/WIP] ProfileMatic for Harmattan
 
Please install and test the new beta to make sure the upcoming release works for your rules. Latest beta is available from here:
http://www.kolumbus.fi/~ks2877/profi...beta_armel.deb

To install, first remove the version you have installed from Nokia Store. Then install the version above.

Changelog (against current release 2.2.2):
- Automatic name for rule translateable (ie. if user has not filled rule name)
- New translations: polish, russian, swedish, Taiwanese
- Existing translations updated from transifex

slarti 2013-01-14 15:28

Re: [Announce/WIP] ProfileMatic for Harmattan
 
1 Attachment(s)
I may have found a bug. I have a rule set up as described here. Today, for some reason it didn't fire off the script when I locked the screen. A reboot cured this but I got some logs before doing that. The name of the rule is "UpdateBB".

ajalkane 2013-01-18 23:56

Re: [Announce/WIP] ProfileMatic for Harmattan
 
Quote:

Originally Posted by slarti (Post 1314734)
I may have found a bug. I have a rule set up as described here. Today, for some reason it didn't fire off the script when I locked the screen. A reboot cured this but I got some logs before doing that. The name of the rule is "UpdateBB".

Thanks,

from the logs I can see you apparently want the script to be invoked immediately when lock screen is activated. The idle condition is optimized on the other hand for longer periods for power consumption, so it can be that in these cases the script can be triggered 1-4 seconds after locking screen. And if the device is unlucked during this time, the script is not executed. Can this be the case here? If this is a realworld problem I can see for a different, more immediate, handling for the "0 minute" idle case.

If this is not the case here, do you remember anymore at what time did this problem happen?

From the logs I see the script was fired at these times:

Code:

ma tammikuuta 14 08:06:35 2013 RulesManager::refresh()
ma tammikuuta 14 08:07:45 2013 RulesManager::refresh()
ma tammikuuta 14 08:09:44 2013 RulesManager::refresh()
ma tammikuuta 14 08:09:59 2013 RulesManager::refresh()

Judging by the logs everything happened as it should... but I may have missed something that more information could reveal.

slarti 2013-01-19 07:42

Re: [Announce/WIP] ProfileMatic for Harmattan
 
It was like that all morning. I waited a while for the script to fire before unlocking but nothing happened. Like I said, a reboot cured it and I haven't seen this behaviour after that. If I see it again, do you have any suggestions what information to collect?

A completely different question:

I started writing a simple dbus listener in python which listens to dbus messages from the timed daemon and updates a profilematic rule's activation time or active status according to the message.

I wanted to know if using the updateRule method this way would have any adverse effects?

ajalkane 2013-01-19 09:16

Re: [Announce/WIP] ProfileMatic for Harmattan
 
Quote:

Originally Posted by slarti (Post 1315821)
It was like that all morning. I waited a while for the script to fire before unlocking but nothing happened. Like I said, a reboot cured it and I haven't seen this behaviour after that. If I see it again, do you have any suggestions what information to collect?

Logs as now are useful. But as I said in the logs it was clear that the script was launched, so it's probably something that the script does that doesn't work. If that happens again try running the script manually and see if it does anything: First run it through ProfileMatic's UI with Test button in custom action. If that doesn't work, run it from terminal. See if there's any output.

Quote:

I started writing a simple dbus listener in python which listens to dbus messages from the timed daemon and updates a profilematic rule's activation time or active status according to the message.

I wanted to know if using the updateRule method this way would have any adverse effects?
That's safe, but I'm surprised that you can use it. It takes as parameter a serialized C++ object. I don't even know how it looks like building that from python or using dbus-send. Out of curiosity do you have some working sample?

The only caveat is that the object usually changes between each ProfileMatic release. But of course if you take an existing rule and only modify the parts you want, then that's pretty future proof also.

slarti 2013-01-19 14:59

Re: [Announce/WIP] ProfileMatic for Harmattan
 
1 Attachment(s)
Quote:

Originally Posted by ajalkane (Post 1315829)
Logs as now are useful. But as I said in the logs it was clear that the script was launched, so it's probably something that the script does that doesn't work. If that happens again try running the script manually and see if it does anything: First run it through ProfileMatic's UI with Test button in custom action. If that doesn't work, run it from terminal. See if there's any output.

I think I did run the script in terminal and it worked. I should have remembered the test button since I'm the one who requested it. I'll keep my eyes open for similar cases.

Quote:

Originally Posted by ajalkane (Post 1315829)
That's safe, but I'm surprised that you can use it. It takes as parameter a serialized C++ object. I don't even know how it looks like building that from python or using dbus-send. Out of curiosity do you have some working sample?

The only caveat is that the object usually changes between each ProfileMatic release. But of course if you take an existing rule and only modify the parts you want, then that's pretty future proof also.

I have no idea how to build the object from scratch. I just dumped an existing rule's object and modify that.

I told you it's simple...;)

At the moment it just listens for the next_bootup_event signal which just so happens to be an epoch timestamp or zero for no alarms. This example works but is pretty stupid at the moment.

You'll need python python-dbus and python-gobject.

slarti 2013-01-23 07:30

Re: [Announce/WIP] ProfileMatic for Harmattan
 
Want your phone to do something when an alarm with a certain name goes off? Use this:

The basic idea is to set a special profilematic 'alarm rule' which executes its actions when an alarm with a certain title goes off. The rule gets deactivated when the next active alarm is not one with the set title or there are no alarms. The alarm title is set in the script as the passwd variable. By default, it's Test.

When the script is running, it will create an 'empty' alarm rule once you set or unset any alarm in the clock application. You can modify the rule freely in profilematic, but don't change the name (probably a good idea to not have another rule with the same name). The time and day will be set by the alarm. This rule is basically meant for 'one-shot' actions so design the actions with that in mind.

If you want to try it out, you'll need to apt-get install python python-dbus python-gobject (as root). Start the script and leave it running in terminal. Try setting and unsetting various alarms and see what happens in profilematic.

To make it run on startup, add it to the default rule as custom action.

The script can be found here.

I've tested this for months without any problems or battery drain.

Added some screenshots to maybe make this a little clearer.

http://i.imgur.com/ub1WY3u.png

ajalkane 2013-01-23 21:26

Re: [Announce/WIP] ProfileMatic for Harmattan
 
Quote:

Originally Posted by slarti (Post 1316870)
The basic idea is to set a special profilematic 'alarm rule' which executes its actions when an alarm with a certain title goes off. The rule gets deactivated when the next active alarm is not one with the set title or there are no alarms. The alarm title is set in the script as the passwd variable. By default, it's Test.

Very nice.

A couple of questions:
- Is this basically implementing the functionality you've requested about alarms?
- I see you require only one rule, but since ProfileMatic's interface only provides getting all rules, you need to iterate through them. Would a getRule(ruleId) be something that'd be useful for this?

Quote:

Now, how to make it run as a daemon on startup?
Easiest way is to put it into ProfileMatic's Default rule's custom action. That way it gets started during every reboot of the phone (after the customary 2-4 minutes beyond homescreen becoming visible).

A more robust way, which will have the benefit of restarting the service if it crashes, is to use Upstart. Simply create a configuration file into /etc/init/apps. You can see profilematicd.conf for example, or anything else that is there. More comprehensive help is in harmattan dev docs and of course in Upstart's docs.

slarti 2013-01-24 07:13

Thanks, I went with the default rule as that seems to be enough for now. Should have thought of that myself.

Yes, a getRule(ruleid) method would help getting rid of iterating through a list for a list containing a string. On the other hand the weakness of the script is probably more in the way it creates the alarm rule if one doesn't exist and the way that everything is relying on the string 'Alarm rule'. It seems that the appendRule method doesn't care what ruleid it's fed, it creates a new id for it anyway. That's why the script has to ask for it after creating the rule. Of course, this only applies when there isn't an Alarm rule and I guess I wont be deleting it all the time.

This script does do the job for reacting to an alarm but I still like your idea for setting an alarm as an action.

ajalkane 2013-01-25 10:40

Re: [Announce/WIP] ProfileMatic for Harmattan
 
Quote:

Originally Posted by slarti (Post 1317180)
On the other hand the weakness of the script is probably more in the way it creates the alarm rule if one doesn't exist and the way that everything is relying on the string 'Alarm rule'. It seems that the appendRule method doesn't care what ruleid it's fed, it creates a new id for it anyway. That's why the script has to ask for it after creating the rule.

AppendRule returns a string, which is the id that was created for the rule. That's one small simplification you can do.

zappAtom 2013-01-25 16:19

Possible bug?
 
I have set up a rule which sets availibility to offline when connected to a mobile network. This seems to work recently only for my XMPP account and the Skype account goes always online when I connect to a mobile network (means the rule does have no affect).

I don't want that my XMPP/Skype accounts sign me in when I connect to 3g, only when I connect to some selected wireless networks...

ajalkane 2013-01-26 06:36

Re: Possible bug?
 
Quote:

Originally Posted by zappAtom (Post 1317747)
I have set up a rule which sets availibility to offline when connected to a mobile network. This seems to work recently only for my XMPP account and the Skype account goes always online when I connect to a mobile network (means the rule does have no affect).

You said recently, so this used to work? Have you deleted and re-added your Skype account since then? In the Availability action, have you selected the all offline option, or do you have the accounts individually selected to offline?

zappAtom 2013-01-26 12:41

Re: [Announce/WIP] ProfileMatic for Harmattan
 
It never really worked 100%, but recently only skype makes this problem (Have 1 XMPP & 1 Skype account). I set it with the "all offline option".
I have 2 other rules (home/work) which set my status to online and available(home)/busy(work) with the option to restore previous status on rule deactivation. I can imagine that this causes the problem....so the most easiest way to solve it might be a 3rd option for rules with availability changes to say "set offline" on deactivation.

ajalkane 2013-01-26 15:28

Re: [Announce/WIP] ProfileMatic for Harmattan
 
Quote:

Originally Posted by zappAtom (Post 1317945)
It never really worked 100%, but recently only skype makes this problem (Have 1 XMPP & 1 Skype account). I set it with the "all offline option".
I have 2 other rules (home/work) which set my status to online and available(home)/busy(work) with the option to restore previous status on rule deactivation. I can imagine that this causes the problem....so the most easiest way to solve it might be a 3rd option for rules with availability changes to say "set offline" on deactivation.

One possibility is to put into Default rule "all offline", and only put online to the special cases.

But you can also send me the logs when this problem happens and I'll see if anything is visible.

lorenzo 2013-01-26 19:18

Re: [Announce/WIP] ProfileMatic for Harmattan
 
do someone know what is the command to activate/deactivate "calendar notification" ?

tonyhuynh 2013-01-27 04:12

Re: [Announce/WIP] ProfileMatic for Harmattan
 
I everyday manually update feeds (stock one) at 6:00 and leave for work at 6:30. It's great if profilematic can auto update feeds for me at 6:00...

tonyhuynh 2013-01-27 09:01

Re: [Announce/WIP] ProfileMatic for Harmattan
 
Dears,

Sorry if I donot follow the topic well. Can I set time : 18:00-06:00, wlan connection at home and the rest time is mobile connection. and the switch between these time should be automatically in background. Tks!

ajalkane 2013-01-27 09:44

Re: [Announce/WIP] ProfileMatic for Harmattan
 
Quote:

Originally Posted by tonyhuynh (Post 1318051)
I everyday manually update feeds (stock one) at 6:00 and leave for work at 6:30. It's great if profilematic can auto update feeds for me at 6:00...

That probably can be done with Custom action and sending a DBus message to com.nokia.home.EventFeed. But I don't know the details.

Quote:

Originally Posted by tonyhuynh (Post 1318051)
Sorry if I donot follow the topic well. Can I set time : 18:00-06:00, wlan connection at home and the rest time is mobile connection. and the switch between these time should be automatically in background. Tks!

I'm not sure I understand the question, but yes that kind of conditions can be specified with ProfileMatic.

slarti 2013-01-27 11:08

Re: [Announce/WIP] ProfileMatic for Harmattan
 
Quote:

Originally Posted by ajalkane (Post 1318080)
That probably can be done with Custom action and sending a DBus message to com.nokia.home.EventFeed. But I don't know the details.

I think it can't be done that way. It sends out a signal refreshRequested, but triggering that signal can't be done with any of its methods.

Everything that puts stuff on the eventfeed should have a dbus service of its own that listens for that signal. For example, the stock twitter client has one and I think a refresh can be done with:

Code:

qdbus com.nokia.twittermeego /twittermeego com.nokia.twittermeego.refreshEventFeed


All times are GMT. The time now is 22:01.

vBulletin® Version 3.8.8