maemo.org - Talk

maemo.org - Talk (https://talk.maemo.org/index.php)
-   Applications (https://talk.maemo.org/forumdisplay.php?f=41)
-   -   Google Voice Notifier *Alpha* (https://talk.maemo.org/showthread.php?t=29981)

addisjon 2009-06-29 17:07

Google Voice Notifier *Alpha*
 
2 Attachment(s)
I mentioned several weeks ago in the Dialcentral thread that I was working on an SMS notifier, and finally there is a first version ready to be tried out :). Keep in mind that it is definitely alpha level and requires some setup on the command line.

Also, a big thanks to mrdally204 for his great suggestions, testing, and feedback.

Ok, on to the program. It works as an add-on to Dialcentral. The code borrows heavily from epage's work on Dialcentral, while adding alarmd functionality similar to that of flipclock.
For now it creates an alarmd event which executes the notifier on a recurring basis (e.g. 10 minutes) and plays a sound (thanks gogol!)* and blinks the LED.

*Note: The sound can be customized by swapping the alert.mp3 in /usr/lib/gv-notifier with one of your choosing. The default sound is the new email indicator from Modest.

Dependencies:
python2.5
Dialcentral (only for copying the login cookie, and then for reading/replying to the messages you've been notified of)

*UPDATED 08/11/09
To install:
1) download and install gv-notifier-0.0.3-all.deb

2) edit the configuration file called conf.xml
  • to do this, first open xterm and enter 'vi /home/user/.gv-notifier/conf.xml'
  • edit the username and password elements with your Google Voice username and password
  • change the start-time element to the initial time you would like the alarm to go off. So if you would like the notifier to run every 30 minutes at exactly the top and bottom of the hour, you would set the start time to 05:00 (it's 4PM here for me, so 5 is the next up). Or if you have a few other mail notifiers running and you don't want them all trying to run at the same time you can set it to 05:01.
  • change the recurrence-time element to the number of minutes between notifications. In the example above this would be 30 (the default is 10).
  • and finally, the urls section controls which Google Voice events you'd like to be notified of. You can find a list of possible urls in this post. By default only SMS and Missed Calls are included (and only SMS is required). Feel free to delete the Missed Calls url.
  • save and exit

3) **This only has to be done once, to set the alarm**
in xterm run the command '/usr/bin/python2.5 /usr/lib/gv-notifier/gv_notifier_alarmd.py'

If successful there should be an extra event added to /var/lib/alarmd/alarm_queue.xml, and if there are new messages you should see the LED blinking. To stop the LED (and launch Dialcentral) there is a duplicate Dialcentral icon created in Extras. I use this icon in place of the regular Dialcentral icon, but it could also be changed to launch Google Voice in the browser.

There is also a GV Notifier icon which will run the notifier manually in case you pick a long recurrence time and want to check in between.

To uninstall:
1) /usr/bin/python2.5 /usr/lib/gv-notifier/gv_notifier_alarmd_delete.py
this removes the alarmd entry (I have tried doing this with the .postrm script but no luck as yet)

2) uninstall through application manager

epage 2009-06-29 18:05

Re: Google Voice Notifier *Alpha*
 
This is great!

Depending on how this evolves, if you want we can merge this into Dialcentral.


Some notes:

Username and password could be pulled from the dialcentral settings file which could ease user hassle a bit.

I'm fully willing to help in understanding my support/builddeb.py script which uses py2deb to generate packages.

How come you copied code rather than having a dependency and import my gv_backend to manager all the GV stuff for you?

So alarmd spawns a program for each alarm event? Have you benchmarked running this to see how much memory/CPU it uses (for how much user interruption and battery drain it causes). Also what about when not connected to a network how should this act and how much should it drain resources?

Is the LED API really that simplistic that you globally turn it on or off rather than giving some kind of token so that on/offs can stack (be kind of weird if led was turned on for emails but launching Dialcentral disables the led).

addisjon 2009-06-29 18:20

Re: Google Voice Notifier *Alpha*
 
Hey epage, I actually have a version which imports gv_backend directly. But I was talking to mrdally204 and we wondered if it should be standalone in case someone wanted to use it only with the Google Voice website instead of Dialcentral. But it will work either way if you wanted to integrate it.

As for the alarm benchmarking, I've been using the program for a couple of weeks, with a recurrence time of 10 min, and it seems to be quite good on battery life. I'm very picky about this actually, and I've been happy with it.

I have added settings to the alarm to have it run only when connected to the internet, so when not connected it does nothing, just like the Modest notifier.

I've tested the LED functionality and it doesn't turn off the LED for emails or chats, at least from what I've seen. So I think they are each independent, but I'm no expert so someone can correct me.

Quote:

Originally Posted by epage (Post 300864)
This is great!

Depending on how this evolves, if you want we can merge this into Dialcentral.


Some notes:

Username and password could be pulled from the dialcentral settings file which could ease user hassle a bit.

I'm fully willing to help in understanding my support/builddeb.py script which uses py2deb to generate packages.

How come you copied code rather than having a dependency and import my gv_backend to manager all the GV stuff for you?

So alarmd spawns a program for each alarm event? Have you benchmarked running this to see how much memory/CPU it uses (for how much user interruption and battery drain it causes). Also what about when not connected to a network how should this act and how much should it drain resources?

Is the LED API really that simplistic that you globally turn it on or off rather than giving some kind of token so that on/offs can stack (be kind of weird if led was turned on for emails but launching Dialcentral disables the led).


mrdally204 2009-06-30 07:35

Re: Google Voice Notifier *Alpha*
 
Hey addisjon,

I'm not sure if I did something incorrectly or if there was a problem updating over the previous beta I had installed but I'm now in an infinate loop on start up. After I installed the latest one you sent to me in the email, I noticed that the lock, unlock icons at the top of the screen (when you lock the device) were red x's instead of the normal icon. I then restarted the device to see if it was something that could fix it. It will attempt to load, the nokia screen is present and the LED is lit. It goes about 95% across (the blue line at the bottom) the light then goes off and the unit restarts. I'm attempting to reformat the tablet and see what we have left. I'll get back and let you know. I have been trying other software as well so I'm not 100% positive this is the issue, but it was right after I installed the latest update

mrdally204 2009-06-30 07:40

Re: Google Voice Notifier *Alpha*
 
I would also like to note that integration into dial central can be a great option as well as leaving it as its own stand alone app. That way if you use dial central it gets the added feature people are looking for. If you do not use it, then you still have the option to install it on its own. However if its going to be a stand alone app, you need to figure out a better way to disable the LED because the Dial Central icon would not make sense in that situation.

Have you made any progress in having the notification box pop up like it does for new emails/missed calls? That would be ideal.

Are you still planning on having the option for sound notifications as well as visual?

addisjon 2009-06-30 18:08

Re: Google Voice Notifier *Alpha*
 
I've restarted many times without an issue. And just untar'ing the files shouldn't affect anything. It's a very benign program and I can't think of anything that would keep the tablet from starting up. Is it possible that you installed a few programs at one time, with the notifier being last, but only restarted once? That would mean one of the other programs could be the problem.

Quote:

Originally Posted by mrdally204 (Post 301035)
Hey addisjon,

I'm not sure if I did something incorrectly or if there was a problem updating over the previous beta I had installed but I'm now in an infinate loop on start up. After I installed the latest one you sent to me in the email, I noticed that the lock, unlock icons at the top of the screen (when you lock the device) were red x's instead of the normal icon. I then restarted the device to see if it was something that could fix it. It will attempt to load, the nokia screen is present and the LED is lit. It goes about 95% across (the blue line at the bottom) the light then goes off and the unit restarts. I'm attempting to reformat the tablet and see what we have left. I'll get back and let you know. I have been trying other software as well so I'm not 100% positive this is the issue, but it was right after I installed the latest update


mrdally204 2009-07-01 03:21

Re: Google Voice Notifier *Alpha*
 
I guess it is somewhat possible, but it seemed to cause noticeable changes right after doing the instructions. I am going to give it another shot right now. I am doing a back up on my settings just in case. I could not get it to install properly with the original instructions, and I asked Epage if he knew why I was getting the Permission denied error. He thought that running in root would fix it. I ran it in root and afterwords all the items in the menus disappeared except for on my personal menu. And when I tried to run anything from the personal menu it would say loading xterm no matter what I clicked on. Xterm never loaded so I rebooted and bam, looped at the Nokia screen. I do not mind reformatting as all my settings are backed up so I will continue to try and get it going here. I will post back in a few to let you know how it goes.

***EDIT Still getting permission denied when attempting to create the folder usr/lib/gv-notifier Not sure how to proceed

icbolsh 2009-07-01 07:57

Re: Google Voice Notifier *Alpha*
 
Quote:

Originally Posted by addisjon (Post 300843)
I mentioned several weeks ago in the Dialcentral thread that I was working on an SMS notifier, and finally there is a first version ready to be tried out :). Keep in mind that it is definitely alpha level...

I just want to thank you. I am cheering you on from the side lines. Getting a notification for a SMS would be extremely helpful. Thanks again. Come on Beta!!!

fatboyxpc 2009-07-03 17:59

Re: Google Voice Notifier *Alpha*
 
I am getting permission denied too. I'm not running it in root because of the first step in the instructions. I also have not restarted my N810 since I tried this nor have I tried launching gv-notifier yet. I also was not able to edit the conf.xml, although I didn'tg gainroot to do that so I wsas wonderfing if that was tghe issue. That's also why I havedn't tried launching gv-notifier, since I was unable to edit conf.

mrdally204 2009-07-05 22:15

Re: Google Voice Notifier *Alpha*
 
Do not install in root! That seems to be the cause for the reboot loop. I believe addisjon is looking into what the issue is. Check and see if your apps load as expected. I was having issues with email and contacts when I was falling into the loop. If those are loading up fine I do not think you will have an issue with a restart.

icbolsh 2009-07-18 00:20

Re: Google Voice Notifier *Alpha*
 
Quote:

Originally Posted by addisjon (Post 300843)
b) set the start-time and recurrence-time for alarmd

Okay I have a maybe dumb question...what is the start time for? Is is for setting your timezone? I set the recurrence time but not sure what to do with the start time. Thanks for the help.

mrdally204 2009-07-18 22:07

Re: Google Voice Notifier *Alpha*
 
you set the start time for the first time you want it to check for a message.

icbolsh 2009-07-19 02:41

Re: Google Voice Notifier *Alpha*
 
I finally got it all installed and working. Had to change permissions for some folders from root and then esc to continue installation. So it works. There are a few weird side effects. Sometimes when I get an alarm from an email(not GV notifier), the LED light won't turn off until I start Dialcentral just like when I get a new SMS. So far I can live with these issues until a beta version comes out. I am an avid text-er and really needed a notifier solution. Thank you so much for making this notifier. Please keep it coming, though. I would love to see it fully integrated with Dialcentral. Even if someone liked using the GV mobile interface better...Dialcentral is such a lightweight program I'm sure they wouldn't mind having it just for the SMS notifier.
Thanks for the hard work.

icbolsh 2009-07-19 08:40

Re: Google Voice Notifier *Alpha*
 
A new issue. The LED light keeps going off even though I don't have a new SMS message. I emptied my inbox completely...and still the LED light with go off eventually. Can anyone help? Did I get a setting wrong?

The issue might be in all the reconfigurations I did to get it installed. I think I'm going to reflash and install it one more time.

mrdally204 2009-07-20 22:16

Re: Google Voice Notifier *Alpha*
 
I had this happem to me as well with the initial install. Go back into the config and delete out the missed calls option and I think it may fix it. Also if you could give a little write up as to how you got it working correctly I would appreciate it. I have not been able to get it going agian as you can read from my previous posts.

(sms and missed calls included by default, only sms is required) (voicemails, recent calls, received calls, etc. can also be added)

icbolsh 2009-07-21 07:41

Re: Google Voice Notifier *Alpha*
 
Quote:

Originally Posted by mrdally204 (Post 305660)
I had this happem to me as well with the initial install. Go back into the config and delete out the missed calls option and I think it may fix it. Also if you could give a little write up as to how you got it working correctly I would appreciate it. I have not been able to get it going agian as you can read from my previous posts.

(sms and missed calls included by default, only sms is required) (voicemails, recent calls, received calls, etc. can also be added)

Well I reflashed my NIT and installed the GV notifier taking notes to share with you how I did it. And of course, I can't get it to work anymore. So yeah, I am uninstalling it and waiting for the beta version. I'm also having issues with Dialcentral since reflashing.

icbolsh 2009-07-21 08:00

Re: Google Voice Notifier *Alpha*
 
Okay when I installed GV notifier, for some crazy reason it shrunk my "lock touch screen and keys, offline mode, lock device and switch off" window. It is a weird side effect. After I uninstalled the application. That window is still super small. I can't find where I can change it to regular size. Can someone help?

fatboyxpc 2009-07-22 21:47

Re: Google Voice Notifier *Alpha*
 
I am getting the permission denied error, so should I change the permissions to the folders being denied like icbolsh is talking about to fix that issue?

icbolsh 2009-07-22 23:36

Re: Google Voice Notifier *Alpha*
 
Even though I couldn't get it working again and decided not to mess with it again. (just will wait for the Beta version....Please hurry). I'll say how I approached it.
When I first untar everything, I got nothing bu permission errors. So I did it this way.

in root, chmod 777 for directories /usr, /usr/bin & /usr/lib (one at a time of course)
exit root
untar
permission error for /hildon. So back into root. chmod 777 for that directory also.
exit root
Then I did untar again, this time with not errors.
exit root
then continue with his instructions.

Again it worked okay with some quirks. But I reflashed my NIT and now I cannot get it to work, but I also don't want to mess with it too much. I also can't get Dialcentral to dial out since reflashing. It does SMS and everything else.

gogol 2009-08-02 07:02

Re: Google Voice Notifier *Alpha*
 
wow, i got around permissions by installing as root and/or using chmod. works like it's supposed to with no weird side effects of any kind.

i put in another vote to integrate this into dialcentral, it is such a needed part of a messaging application. i really hope to see sound notifications too, that would make dialcentral complete!

thank you for your hard work, i hope you come back around some day

icbolsh 2009-08-02 08:11

Re: Google Voice Notifier *Alpha*
 
Please add GV notifier to Dialcentral.

addisjon 2009-08-04 22:35

Re: Google Voice Notifier *Alpha*
 
I apologize for the permissions problems you guys have had. After a reflash I've been able to reproduce (and hopefully fix) the problem, so I've added a .deb file with updated instructions to my first post.

munky261 2009-08-05 15:29

Re: Google Voice Notifier *Alpha*
 
Is there something we can add to the file to make it play a sound as well as flash the LED?

icbolsh 2009-08-07 16:46

Re: Google Voice Notifier *Alpha*
 
so has anyone had any issues will installing it as a deb file? I would like to hear some feed back before I attempt it again(leaving me to reflash if things don't go well). I really, really would like this application before I start traveling in a 4 weeks. I was holding out for a Beta version, but am willing to try again if everyone has good success with the deb. file.

gogol 2009-08-07 18:30

Fixing File Comparisons
 
I've found a bit of a problem. In trying to hack on a sound notification I noticed that the script is comparing the filesize of sms.html and last.sms.html. I kept sending test SMS's to my google number and then running gv_notifier but it wouldn't think the files were any different and so, wouldn't notify me.

I ls -lh'ed before and after, showing 34 bytes each time. I catted the contents of sms.html showing the only thing that had changed was the timestamp of the last sms (the phone number was of course the same), which wasn't enough to change the filesize.

I guess I'll have to look up a way to do diff or something in python. I hardly know a thing about python but have some general understanding of programming languages. I'll give a whack at fixing it and post anything I figure out here.

----EDIT----
So here's how I replaced filesize comparison:
with your imports,
import filecmp
....
(line 161ish, #comment the two other if statements and replace with:)
Code:

if filecmp.cmp((self._data_path + filename),(self._data_path + "last." + filename),0) != True:
And did some mild testing. It seems to work fine, catching two SMS's from the same person in a row where the old filesize comparison did not.

gogol 2009-08-07 20:37

Re: Google Voice Notifier *Alpha*
 
In the meantime I figured out how to have a nice long ringing sound when you receive a new text/voicemail/missed call. It's ghetto and hackish but that's how I roll.

You need mplayer installed to do this. I don't know how to play WAV files with python and it looked difficult from a few googles.

I copied /usr/share/libsipphoneapi/sounds/ring.wav to gv-notifier's dir:
cp /usr/share/libsipphoneapi/sounds/ring.wav /usr/lib/gv-notifier/

I then opened up the gv_notifier.py script and added these lines at line 161, directly below self.ledOn()

from subprocess import call
gogol=call("mplayer -ao alsa /usr/lib/gv-notifier/ring.wav",shell=True)


you could of course substitute any wav/mp3/whatever you like. I have the sound turned down on the n810 so a long one is more likely to alert me.

Hope that's useful to somebody!

mrdally204 2009-08-08 19:50

Re: Google Voice Notifier *Alpha*
 
thanks for the info. you should try and get in touch with addisjon and get ur changes added to the deb file. hes cool. I tried helping him troubleshoot the permission errors earlier in its development and he was very open to suggestions. good luck and please do what u can to improve this ever needed app!

gogol 2009-08-08 20:20

Re: Google Voice Notifier *Alpha*
 
Thanks mrdally for the encouragement. I hope he's into the lil contributions I've made. It's been a lot of fun exploring and googling and exploring some more...

And...yet another problem arises with the file comparison technique of determining when you have new messages...if you have sent a text message to someone else since last check, that will count as change...meaning you get alerted for responding to a text. Then someone texts you again, meaning another alert...pretty soon the thing is ringing at whatever interval you set and you're just constantly refreshing the SMS page to check until the conversation winds down. Not really at all like receiving a 'push' alert.
There must be another way...

mrdally204 2009-08-08 20:29

Re: Google Voice Notifier *Alpha*
 
i was having this happen on my first testing of the app. I found that after a while the light would just blink regardless of messages not being sent. I am hoping that google releases a little bit more info for us to use as they are now releasing apps for phones to take advantage of googlevoice. I noticed they are available for blackberry and android. Since android is open source(at least I thi k I remember it being soK maybe they will release the source so we can adapt it to our beautiful nokias Wishful thinking I know!

gogol 2009-08-11 05:27

Re: Google Voice Notifier *Alpha*
 
2 Attachment(s)
EDIT: This is old info. Both the GV changes and the use of a sound file has been included in the latest .deb, found in the first post of this thread.

Fixed the script for the latest GV changes.

Strip the .txt off the end, cp it to /usr/lib/gv-notifier. Only two lines were changed, just some regex to keep up-to-date with Google. Thanks to epage's work I just did a diff and saw what needed to be updated ;)

...And then there's my version of the script with the different file comparison technique, and a sound notification instead of the LED. *No Longer Requires Mplayer* I found a dbus command that will play either a .wav or .mp3. Drop something into /usr/lib/gv-notifier called ring.wav and off you go.

addisjon 2009-08-11 07:03

Re: Google Voice Notifier *Alpha*
 
Thanks gogol, I had already updated the deb in the first post to fix the Google changes. But I'll add in your sound code tomorrow morning.

gogol 2009-08-11 23:01

Re: Google Voice Notifier *Alpha*
 
Quote:

Originally Posted by addisjon (Post 310730)
I'll add in your sound code tomorrow morning.

Great! I'm honored. You plan to create a default sound and package it in the .deb? Either way, glad to be able to contribute.

mrdally204 2009-08-11 23:09

Re: Google Voice Notifier *Alpha*
 
i like the idea of adding a default sound to the deb. that way it will be much easier for the everyday user to set up. the more advanced can always change the sound if they want

** edit thanks for the continued work on the notifier.

munky261 2009-08-12 01:31

Re: Google Voice Notifier *Alpha*
 
Has the sound been added to the .deb yet?

addisjon 2009-08-12 05:51

Re: Google Voice Notifier *Alpha*
 
Quote:

Originally Posted by munky261 (Post 311068)
Has the sound been added to the .deb yet?

Just uploaded a new version which includes sound and updated the notes on the first page. The default sound is the same one used by Modest for new emails, but downmixed from wav to mp3 to save space. You can swap it out by replacing /usr/lib/gv-notifier/alert.mp3 with your own file. Thanks gogol for the contribution!

gogol 2009-08-12 06:50

Re: Google Voice Notifier *Alpha*
 
I see you used my new filecmp too! Woot!

mrdally204 2009-08-12 09:25

Re: Google Voice Notifier *Alpha*
 
awesome work fellas! I do have a bug to report. I was listening to a podacst prior to installing the latest notifier. I have noticed that when I receive a new sms, the sound plays as it should but then starts up the podcast from the begining! I can not stop the sound without actually opening up media player and closing it manually. pretty funny :)

**Edit if I remove the podcast from the now playing list, the sound is all that I hear. Does this mean that media player is still now running in the background even though I hear no other sound(playlist has ended but application does not close)? guess I'm curious as to how it works and why it wanted to play my playlist :)

jalladin 2009-08-12 09:47

Re: Google Voice Notifier *Alpha*
 
Quote:

Originally Posted by gogol (Post 310718)
Fixed the script for the latest GV changes.

Strip the .txt off the end, cp it to /usr/lib/gv-notifier. Only two lines were changed, just some regex to keep up-to-date with Google. Thanks to epage's work I just did a diff and saw what needed to be updated ;)

...And then there's my version of the script with the different file comparison technique, and a sound notification instead of the LED. *No Longer Requires Mplayer* I found a dbus command that will play either a .wav or .mp3. Drop something into /usr/lib/gv-notifier called ring.wav and off you go.


hey would you happen to know how to receive yahoo mail using the mail notifier/ native mail fetching system for the n810..

munky261 2009-08-12 15:38

Re: Google Voice Notifier *Alpha*
 
I was also going to ask something similar, since the notification and sound work perfectly for me, is there any way i can enter any url to get it to check gmail...not to retrieve any details of course, just to let me know theres mail....Ive always hated how the sound file plays twice when using the built in mail, and now I can finally use my sound file of R. Lee Ermey shouting "Mail Call!" with this.

falconx 2009-08-12 19:38

Re: Google Voice Notifier *Alpha*
 
I am a newbie at all of this i instaaled the deb instalation got the gv icon now how and where do i go to configure this as nothing happens when i hit the icon. i am a qucik learner with good directions :) thanks


All times are GMT. The time now is 08:08.

vBulletin® Version 3.8.8