maemo.org - Talk

maemo.org - Talk (https://talk.maemo.org/index.php)
-   Applications (https://talk.maemo.org/forumdisplay.php?f=41)
-   -   [HACK] Display remaining minutes left out of free minutes (https://talk.maemo.org/showthread.php?t=74904)

rajil.s 2011-07-13 20:17

[HACK] Display remaining minutes left out of free minutes
 
2 Attachment(s)
Some places like in UK here allot free minutes each month. The scripts attached are to display the remaining minutes and the used minutes each month.

Steps:
1. Enable endtime recording in database following the triggers script here
2. Copy freecalls.sh and calltimerpopup.sh in /home/user/scripts and make them executable (chmod +x freecalls.sh calltimerpopup.sh).
3. Copy callhangup and freecalllimit to /etc/dbus-scripts.d
4. Edit freecalls.sh for the freeminutes, starting date and number of sms which count to 1 minute. Leave SMSPERMINUTE=0 if they are not counted in minutes.
5. If there any phone numbers which shouldnt be counted edit FREE line. For me numbers 123 and 333 are free.
6. Reboot device and make a gsm call. Popup will appear after the call is terminated.

*Dbus-scripts need to be installed.
*Thanks to DocScrutinizer for sorting out the niggles.

Jigzy 2011-07-13 20:35

Re: [HACK] Display remaining minutes left out of free minutes
 
looks good will give it a try

moepda 2011-07-13 21:38

Re: [HACK] Display remaining minutes left out of free minutes
 
will try now as my minutes change at 12 !

update : followed install instructions and did reboot , made 1st call and message worked with used and remaining minutes.
will test again after midnight as my minutes for month restart then...

moepda 2011-07-13 23:37

Re: [HACK] Display remaining minutes left out of free minutes
 
tested after midnight and not working , message pops up ok but says used and remaining minutes but no numbers only blanks...

rajil.s 2011-07-14 05:50

Re: [HACK] Display remaining minutes left out of free minutes
 
Quote:

Originally Posted by moepda (Post 1050523)
tested after midnight and not working , message pops up ok but says used and remaining minutes but no numbers only blanks...

That probably happened because there were no calls in the database. I have updated the freecalls.sh script to consider that.

moepda 2011-07-14 08:44

Re: [HACK] Display remaining minutes left out of free minutes
 
used original script this morning and working . updating script anyway though . cheers for the update :)

t4ure4n 2011-07-14 10:43

Re: [HACK] Display remaining minutes left out of free minutes
 
I am going to give this a try and let you know how it goes?

t4ure4n 2011-07-14 11:34

Re: [HACK] Display remaining minutes left out of free minutes
 
My Data-plan is Flext 35 (T-Mobile UK). I get 900 Minutes or 1800 Text Messages..
i.e 2 text messages equates 1 minute

I just have 2 questions

1. Does your script count messages as well? If not can your script be enhanced to do it?

2. I am not sure about T-Mobile but some companies charge you by minute i.e even if you talk for say 30 seconds you will still be charged for a minute. Do you round of seconds to minutes?

Regards

t4ure4n 2011-07-14 15:06

Re: [HACK] Display remaining minutes left out of free minutes
 
I have managed to get it working on my N900.

The problem I am getting this message

Free minutes consumed: 0
Remaining minutes: 900

I have followed step by step instructions and updated the freecalls.sh for freeminutes and starting date too.

I have restarted the phone and made few calls but it does not show correct information.

rajil.s 2011-07-14 17:41

Re: [HACK] Display remaining minutes left out of free minutes
 
@t4ure4n. Sms capability is now added. Set SMSPERMINUTE=2 to in freecalls.sh in your case. Also, the minutes are rounded off to a minute.

With regards to your free minutes not being updated, i think your triggers function in the database (Step 1) is not working. The triggers script i linked to is for firmware 1.2 and above.

cutehunk04 2011-07-14 20:07

Re: [HACK] Display remaining minutes left out of free minutes
 
will this work in india ?

Estel 2011-07-14 20:40

Re: [HACK] Display remaining minutes left out of free minutes
 
Why it should not? Just use common sense. This application (with database triggers enabled, as per first post) keep and eye on time of You'r every call, + number of sms, if You want it too. You set all parameters manually. So, what is it there, that can work in Antarctica, and can't for India?

----

As for scripts itself - here in Poland, most operator count free minutes/sms/mms as follows:
1 sms = 1 minute = 1 mms (under 100 kb)

As You can easily presume, it's much more cost effective to always use mms instead of sms - even, when You want to type only text. Is it possible to add any param to count mms just like You did with sms?

I know that this may be complicated, cause mms is suported via fMMS... I don't even know if such a connections are even stored in evenlogger. Especially Havoc mode.

Just my little uneducated suggestion - mms always use different settings (ap) - so maybe tracking data connections from configurable (via user setting it) connection point only (to not confuse it with normal data connections) may help to achieve this? Is data connection stored in eventlogger?

rajil.s 2011-07-16 10:54

Re: [HACK] Display remaining minutes left out of free minutes
 
@Estel couldnt find anything in eventlogger related to mms. So unfortunately cant be done at present.

Estel 2011-07-16 12:59

Re: [HACK] Display remaining minutes left out of free minutes
 
AFAIK fMMS use just data connection (every mms phone do it, although hiding it from user) via 2.5G. The point is, that it connect to "different" provider, aka mobile access point (or how it's called?). The point is that using predefinied access point for mms, You're not charged for data connection (although physically it *is* data connection).

That's why I suggested, that it may be worth checking eventlogger for data connections - if it is possible to determine which ("connection settings"), ap was used.

Sorry if You already checked for that - I wanted to be sure that my suggestion wasn't understand wrong way ;) BTw, maybe it's possible to ask fMMS developer to add some backend, that You can use in this hack? Is it possible?

t4ure4n 2011-07-16 13:30

Re: [HACK] Display remaining minutes left out of free minutes
 
Quote:

Originally Posted by rajil.s (Post 1051053)
@t4ure4n. Sms capability is now added. Set SMSPERMINUTE=2 to in freecalls.sh in your case. Also, the minutes are rounded off to a minute.

I am going to check the SMS functionality now.

:):):)Glad that you added functionality for free numbers,:):):)
I had already updated your SQL for this as I make lots of calls to 150 which is free for T-Mobile.

Quote:

Originally Posted by rajil.s (Post 1051053)
With regards to your free minutes not being updated, i think your triggers function in the database (Step 1) is not working. The triggers script i linked to is for firmware 1.2 and above.

I found the problem:
My minutes update on the 9th of every month,
I used MONTH_STARTDAY=09 but it didn't work but when I used MONTH_STARTDAY=9 it worked... so I guess it will be a good idea to have your script check this.


A potential Bug

I have noticed that If you clear the "Recent Calls List" the counter starts again. This may not be a problem for people who leave their call log but I clear my recent call list every few days.

Can any one else please varify this?

kralde 2011-07-16 13:39

Re: [HACK] Display remaining minutes left out of free minutes
 
I need help... I am so noob I guess XD

What means that...? "1. Enable endtime recording in database following the triggers script here"

helppp?
?

t4ure4n 2011-07-16 13:46

Re: [HACK] Display remaining minutes left out of free minutes
 
Quote:

Originally Posted by kralde (Post 1052112)
I need help... I am so noob I guess XD

How I can change the free minutes value?? I dont understand the thing that the 1st post said about trigger... help? :(

To Update the free minutes value, open freecalls.sh either on PC and update values as shown red

Code:

# the day of the month at which your provider starts counting minutes
MONTH_STARTDAY=here
# Free minutes alloted in the month
FREEMINUTES=here
#Number of sms messages per minute (has to be integer)
SMSPERMINUTE=here

You have to set up triggers by downloading triggers.txt from the link
copy it to MyDocs folder on N900 and run these commands from terminal

1. Open terminal

2. Navigate to MyDocs Folder
Code:

cd /home/user/MyDocs
3. Setup triggers

Code:

sqlite3 -batch /home/user/.rtcom-eventlogger/el-v1.db < triggers.txt
The last command (step 3) is in single line

skip0pot2mus 2011-12-15 10:43

Re: [HACK] Display remaining minutes left out of free minutes
 
This looks like a good hack, but the instructions are too techy for me, can anyone simplify them?

Cheers

dfries 2012-02-19 02:14

Re: [HACK] Display remaining minutes left out of free minutes
 
Quote:

Originally Posted by skip0pot2mus (Post 1137767)
This looks like a good hack, but the instructions are too techy for me, can anyone simplify them?

Cheers

Well, I creaed and uploaded a new package to the extras-testing repository
minutemonitor that packages a daemon to update end_time and provide a call period summary GUI. I wrote it to match the call plan I have, some of the details are in the description, but for someone non-technical it comes working out of the box.
http://maemo.org/packages/view/minutemonitor/


All times are GMT. The time now is 14:59.

vBulletin® Version 3.8.8