Reply
Thread Tools
Posts: 539 | Thanked: 165 times | Joined on Feb 2010 @ Berlin, Germany
#11
Here is an example of a SMS which also includes usage and remaining traffic of the data plan. Carrier is sunrise in switzerland, the currency is CHF which cannot be converted to a nice symbol. (I guess no one yet found out how to make a symbol for chocolate )

Code:
Ihre aufgelaufenen Kosten ohne Abogebühr: CHF 1.20. Limite: CHF 5,000. Stand: 27.02.2010 11:49.Verbleibende Inklusiv-Leistungen:122.19 MB (surf) gültig bis 06.03.2010.
Angaben ohne Gewähr. Details unter www.sunrise.ch/costcontrol
The output shall look like

Code:
CHF 1.20 - 122.19 MB
Here we go: USSD-Widget has to setup to using code "*133#" which is the one used by this carrier. One instance of DCE has to get installed the same way as described in post #1, using the following code:

Code:
sqlite3 -separator ": " /home/user/.rtcom-eventlogger/el.db \
 "SELECT free_text FROM Events WHERE event_type_id = '7' AND free_text LIKE 'Ihre aufgelaufenen Kosten%' ORDER BY end_time DESC LIMIT 1"\
 | sed s/Ihr.*hr:.// | sed s/..Limite.*ungen:/' - '/ | sed s/..surf.*$//

Last edited by x-lette; 2010-03-07 at 17:22. Reason: forgot spaces and a dash
 
Posts: 77 | Thanked: 8 times | Joined on Feb 2010
#12
First of all i have to say thank you for editing the script to fit with sunrise
I tried it out and have a problem. When i test the script in xterm it seems to work, even when i think the displayed infos aren't right right now, but when i try to put the script in a widget it only showes "invalid command"
I wrote the chmod line as root in xterm and into the dce i wrote /home/user/Guthaben.sh (where the file is)

what can be wrong?
When i tipe in xterm as user the file can't be opened, as root it works. is that wright?
 
Posts: 539 | Thanked: 165 times | Joined on Feb 2010 @ Berlin, Germany
#13
Originally Posted by moerderameise View Post
First of all i have to say thank you for editing the script to fit with sunrise
I tried it out and have a problem. When i test the script in xterm it seems to work, even when i think the displayed infos aren't right right now, but when i try to put the script in a widget it only showes "invalid command"
I wrote the chmod line as root in xterm and into the dce i wrote /home/user/Guthaben.sh (where the file is)

what can be wrong?
When i tipe in xterm as user the file can't be opened, as root it works. is that wright?
Did you follow the steps in first posting? I just described the changes you have to make to USSD-Widget and inside the script I called Guthaben.sh. Don't create this skript as root but as user, i.e. open an xterm and right begin to edit the file, don't 'root up'. If the file is already owned by root you can re-own it to user by typing (as root):

chown user Guthaben.sh

Doing an "ls -l" will show you exactly the owner of the file.

Inside DCE you just call the script, not the sqlite command or the sed commands!
 
Posts: 77 | Thanked: 8 times | Joined on Feb 2010
#14
ok ok now it works

but it is displayed like this:

CHF 0.00249.88 MB

so there is no "-" between the different things. how to fix it?

and another question:

now i click on the ussd widget to get the sms, then the sms arrives and the dce shows the actual costs. but the sms is still unread and so the led blinks until i read the sms. is it also possible to mark the sms as read through the script? and the incomming message desktop widget shows also the unread sms. is there also a way to fix this?
and last: is it possible to execute the script once a day automaticly? so that i have not to click onto the ussd widget? would save me space on the desktop
 
Posts: 539 | Thanked: 165 times | Joined on Feb 2010 @ Berlin, Germany
#15
Originally Posted by moerderameise View Post
ok ok now it works

but it is displayed like this:

CHF 0.00249.88 MB

so there is no "-" between the different things. how to fix it?
Ooops, my failure, didn't insert the spaces and the dash. Will fix it in the original post.

and another question:
You're welcome

now i click on the ussd widget to get the sms, then the sms arrives and the dce shows the actual costs. but the sms is still unread and so the led blinks until i read the sms. is it also possible to mark the sms as read through the script? and the incomming message desktop widget shows also the unread sms. is there also a way to fix this?
In fact, I don't know. I guess there are several points where an SMS might be marked as read/unread. But even if there is only one single field in the database it would need a writing access to this database which is what I want to avoid. Until now all accesses to the database are read-only and therefore cannot be harmful in any way to the system. Implementing a read/write-access would lead to many checkings and I would have to take care about consitency all over the device. That's pretty way out of goal. Therefore: no, I won't implement a check-as-read-feature.

and last: is it possible to execute the script once a day automaticly? so that i have not to click onto the ussd widget? would save me space on the desktop
There are several tools which offer you a kind of cron-like behaviour, i.e. executing a command at a defined interval. But as far as I know they all are not really stable and still reside in -devel. If you dare installing them you might set up a daily execution of a USSD command line.

But if you just want to save space, you also might shorten the title of the widget. A single character doesn't take much space on desktop
 
Posts: 77 | Thanked: 8 times | Joined on Feb 2010
#16
Hmm ok then lets forget my questions

but to your point to make the ussd widget smaller: i did what you wrote in first post but it didn't change anythin... still the fat text "Vielen Dank für Ihre Anfrage blablabla...."
 
Posts: 539 | Thanked: 165 times | Joined on Feb 2010 @ Berlin, Germany
#17
Which version of USSD-Widget do you use? Might be it was implemented in a version which still is only in -devel. In current version there is a a field called "Parser for widget" which will rewrite the output.

Here are my current settings for USSD-Widget:
USSD number: *100#
Execute query on start: no
Name: Guthaben abfragen
Parser for widget: echo "Guthaben abfragen"
Enable banner: yes
Parser: echo "%"
Chain: <empty>
Regular expression: <empty>
Update every 0 minutes
Retry pattern: 10-30-300

Most of these settings are well documented via the question sign beneath them.

Forgot to mention: the point where you can shorten the output for space saving is to replace both strings "Guthaben abfragen" by something you like.

And if you don't want to see the answer at all you might also want to disable banner, which puts the answer as a temporary banner over your desktop, just like any incoming message.

Last edited by x-lette; 2010-03-07 at 18:04. Reason: addon
 
Posts: 77 | Thanked: 8 times | Joined on Feb 2010
#18
ok now it worked. had to restart the widget and than changes took effekt.
thank you very much looks good.
 
Posts: 254 | Thanked: 122 times | Joined on Nov 2009
#19
New version has support for taking reply from SMS. Please test, if it works. Some instructions are available here:
http://kibergus.su/node/19
 
Posts: 77 | Thanked: 8 times | Joined on Feb 2010
#20
Originally Posted by KiberGus View Post
New version has support for taking reply from SMS. Please test, if it works. Some instructions are available here:
http://kibergus.su/node/19
Don't know how to set up... Will look at it today or tomorrow maybe i get it worked. If i understand you right, it showes the costs just like the script, so it would not longer be necessary?
 
Reply


 
Forum Jump


All times are GMT. The time now is 11:07.