HomeGenie Forum

General Category => Troubleshooting and Support => Topic started by: petediscrete on January 10, 2017, 02:38:00 AM

Title: Trying to get email notification working with this link-a note of caution
Post by: petediscrete on January 10, 2017, 02:38:00 AM
I've been trying to get email notification working for the last couple of days and used the following link that I used a while back.

http://www.homegenie.it/forum/index.php?topic=466.0 (http://www.homegenie.it/forum/index.php?topic=466.0)

Exercise a note of caution. The Mono-devel actually installs Mono 4.6.2 on top of my Raspbian Wheezy where I had originally Mono 3,2.or possibly earlier.This has effectively deprecated Mozroots and I'm not even sure if HG has been tested in Mono 4x.

Trouble ahead possibly...............

Does anyone have a working version of HG running on Raspbian Jessie on the Pi.

Title: Re: Trying to get email notification working with this link-a note of caution
Post by: petediscrete on January 18, 2017, 12:00:02 AM
I started again from the last working version of a Homegenie rc525 on Raspbian Wheezy.I had imaged. I first attempted sudo apt-get update. Surprised this time it went through the update. Next I sudo apt-get dist-upgrade. It took about an hour and I noticed that Mono 4.2 was installed and a major overhaul of the security certs was carried out.

It now looks like the issue with security certs for sending email via Gmail is resolved. Email notifications are being sent now.

The Mozroots solution for installing certs is no longer valid. For anyone who is struggling to set up email notification I suggest you do a little research into the latest version of Mono and how it handles security certs.
Title: Re: Trying to get email notification working with this link-a note of caution
Post by: bkenobi on January 18, 2017, 12:39:24 AM
Should my install instructions be updated?  If so, could you modify step 6 as appropriate?

Code: [Select]
6) Set up SSL certificates
   sudo apt-get install mono-complete
   sudo apt-get dist-upgrade
   sudo mozroots --import --ask-remove --machine
   sudo certmgr -ssl smtps://smtp.mail.yahoo.com:465
   sudo certmgr -ssl smtps://smtp.gmail.com:465
   *** yahoo and most likely google require an app specific password ***
Title: Re: Trying to get email notification working with this link-a note of caution
Post by: petediscrete on January 18, 2017, 02:31:01 AM
From what I could take from the installation, Mono 4 is now handling all the heavy lifting with security certs. There was no manual intervention on my behalf. I'm using the same Gmail address to send and receive notification.

I suggest you follow what I did using a working spare SD card image. That Mozroots doesn't work anymore as far as I can see. It seems that Mono 4.2 has resolved a lot of outstanding cert issues with Gmail and probably Yahoo.

My Gmail email settings in the Email Account program are as follows:

Sender :[email protected]
Smtp server:smtp.gmail.com
Smtp user name:abcd
Smtp password:*******
Port : 587
SSL: tick
Receive address: [email protected]

Just a side note. I never installed SSMTP nor configured it so that's why I was curious in a previous post what email client Homegenie was using. All I do know is that email notification via Gmail is now working.
Title: Re: Trying to get email notification working with this link-a note of caution
Post by: bkenobi on January 18, 2017, 05:39:49 PM
Since Jessie is now the standard distro, if I rewrite the instructions I'll probably just start from scratch with a Jessie image.  I was able to locate a Wheezy image but it was archived (so maybe not available for long) with the other alternative being P2P.  If Jessie is intended as the future, I don't think we should recommend installation instructions based on old/unavailable software.
Title: Re: Trying to get email notification working with this link-a note of caution
Post by: petediscrete on January 19, 2017, 03:04:35 AM
Agreed but the majority of Gene's development was carried out on Wheezy I assume. Jessie and Mono 4+ are clearly the way forward but until Gene recommences development/testing we are left to our own devices.

I spent a considerable amount of time trying to get email notification back working and while I enjoy the challenge I'd prefer to have a reliable home automation system doing what it should do.

The idea of leaving Homegenie untouched when you find a working solution in Linux is not really an option for me. Linux needs regular updating and package dependencies change as was experienced by me with Google's change in security certificates.

 HG is back working fine at the moment but that could easily change.
Title: Re: Trying to get email notification working with this link-a note of caution
Post by: bkenobi on January 19, 2017, 05:18:17 PM
IMO, if the HA system is behind a firewall/NAT and you trust that barrier, you shouldn't need to touch Linux unless something needs updating for other reasons.  I assume anything behind my router is secure/not malicious so I don't add real security to my HA system.  If something breaks, I will swap in the backup SD card and restart.  If there's an attack from inside, I've got other problems.

So, IMO the issue here is getting a stable installation that includes email notification support that functions.  I have a working instruction set for Wheezy circa 2015 but when Linux updates are installed, it breaks them.  The instructions are for people installing a new instance of HG today, so it would be ideal that those instructions could be used...today.  I can update the instructions to remove the mozroots line (which I believe you are saying is the issue).  But, my point with Jessie is that although HG hasn't been tested thoroughly on it by Gene (that we know of), it's really the option forward for the RPi.

I posted the instructions to provide a useful guide for others and myself.  If they don't work, that's frustrating.  I just want to make sure my instructions still work and, if not, fix them in as minimal a way as possible for now.
Title: Re: Trying to get email notification working with this link-a note of caution
Post by: Doc on January 26, 2017, 02:54:26 PM
To Petediscrete, sorry to ask directly but I build a working HG security system on RPi2 3 years ago but just moved house, just tried to install the alarm and gmail does not work. Found an old image of Wheezy and rebuilt everything but when I did sudo apt-get dist-upgrade mono did not upgrade to 4.2. I am desperate to get this working again but tried loads of rebuilds using both wheezy and Jessie but my gmail fails. I ever dropped the security on gmail but no luck.
Is there any info you are aware of on how to get a working copy of HG on any distro please?
One last point, on all my builds the update manager fails with a 'connection error'.
Appreciate any assistance you can offer.
Title: Re: Trying to get email notification working with this link-a note of caution
Post by: petediscrete on January 26, 2017, 05:11:24 PM
Doc, firstly could you tell me what version of Homegenie you are using.

I would suggest that you backup all your Homegenie settings, remove all traces of Homegenie from your current Raspbian Wheezy installation and manually install the version of Homegenie that you require. I find that easier than trying to update your version from within the Homegenie installation.

What is Wheezy reporting when you try update, upgrade or dist-upgrade.To be honest, dist-upgrade should do the trick.

If you do a quick search on my previous posts you should find enough information to do this.
Title: Re: Trying to get email notification working with this link-a note of caution
Post by: Doc on January 26, 2017, 09:43:22 PM
Hi, thanks for your quick response, I am using the latest HG release and installed it on both new installs of Jessie and Wheezy. I used the same gmail settings as yours but when I trigger the alarm I do not get an email. When I try to upgrade mono from 3.2 it says I have the latest version. I did a manual install in line with the HG website. I also noticed that every time I enter maintenance settings the update manager states 'connection error' which led me to believe it's certificate problems.
I assume the demo alarm should still send emails or is that my problem?
Title: Re: Trying to get email notification working with this link-a note of caution
Post by: petediscrete on January 26, 2017, 11:06:39 PM
Doc, I too was stuck on Mono 3x until I performed a dist-upgrade.

As I said previously. try update first.If that does not work try upgrade.If you find that does not work sudo apt-get dist-upgrade should get you the latest versions of the packages plus their dependencies which includes Mono 4x and all the security certificates needed to handle email.Keep trying sudo apt-get dist-upgrade until you connect as fewer mirrors are hosting Wheezy updates these days.

Not sure what email you are using, but you could try setting up a GMX email account and see if you can send email via its smtp server which is smtp.gmx.com if memory serves me correctly. The security issue is not as strict with this.

The HG built in upgrade option is showing the same error for me.

I couldn't resolve email notification with HG under Jessie so I stuck with Wheezy.It's not ideal but it works.

Going forward we all need to update to Jessie as Wheezy support has basically ended.

 
Title: Re: Trying to get email notification working with this link-a note of caution
Post by: Doc on January 27, 2017, 10:34:48 AM
petediscrete, thanks for the information, really appreciate your time. I will keep trying to sort the RPi platform and trying to upgrade Mono to 4.2 before installing HG. BTW my email is gmail. Thanks.
Title: Re: Trying to get email notification working with this link-a note of caution
Post by: bkenobi on January 27, 2017, 05:04:26 PM
I haven't updated/upgraded my linux dist in a while.  I do remember that one time I had an issue where the primary mirror was down so it ran through the full list of updates and said something to the affect of "nope".  I think it was over a weekend and by the next business day, someone had reset the server (probably) because everything started working magically.  If you really need something, there may be a way to force a different server, I just don't know it.
Title: Re: Trying to get email notification working with this link-a note of caution
Post by: petediscrete on January 27, 2017, 06:08:02 PM
Doc, are you updating Wheezy locally on the Pi or are you doing it via a remote PC. I suggest using a Terminal session directly on the Pi to do what I suggested earlier if you are not already doing so. It's just a thought I had.

Is there any change that a firewall on either your computer or your router is blocking the update.
Title: Re: Trying to get email notification working with this link-a note of caution
Post by: bkenobi on January 27, 2017, 11:35:03 PM
Doc, are you updating Wheezy locally on the Pi or are you doing it via a remote PC.

There is no difference between the update (or really anything else related to setup) when considering ssh versus plugging a monitor/keyboard directly into the RPi.  I find it significantly easier to simply ssh in but the other option is perfectly viable too.  Maybe I misunderstood what you were getting at.
Title: Re: Trying to get email notification working with this link-a note of caution
Post by: Doc on January 28, 2017, 09:41:20 AM
Hi I just connect the RPi to the network and ssh in via my Mac. I managed to update Jessie with mono 4.6 but it broke the build. So I will focus on wheezy again as you have got that working. I am now trying to focus on getting a distro with mono 4 working before I install HG. Thanks
Title: Re: Trying to get email notification working with this link-a note of caution
Post by: Bounz on February 19, 2017, 07:40:10 PM
Yesterday I have made a fresh installation of HG on the brand new microSD. I have used Raspbian Jessie and have no problem with HG running.
There was a problem with sending email, but it was solved by correcting settings (on the help page of my mail service they wrote I should use port 465 with SSL enabled, but after 3 hours of logging and investigating I tried to use port 25 and everything began to work).
Title: Re: Trying to get email notification working with this link-a note of caution
Post by: petediscrete on February 19, 2017, 07:53:02 PM
Jessie seems to have sorted out the email notification issue. Port 25 should be the only port needed to send an email within HG. Could never understand why port 465 or 587 were ever required. Hopefully that's the email notification saga resolved now.

I do recommend that anyone still using Wheezy follows your example and does a fresh install of Jessie. I have an SD card version of both but find Jessie a lot more stable.
Title: Re: Trying to get email notification working with this link-a note of caution
Post by: bkenobi on February 20, 2017, 04:35:41 PM
I've had no issues with Jessie for the last couple weeks.  The install did seem to take longer when updating, but that's most likely because I used an older version of the distro (wanted to make sure ssh was enabled by default).  Other than that, everything seems to be functioning as well as it did on Wheezy.  To be fair, I never had any issues with Wheezy once configured.