more G-Labs products

Author Topic: Trying to get email notification working with this link-a note of caution  (Read 1434 times)

January 10, 2017, 02:38:00 AM
Read 1434 times

petediscrete

  • ****
  • Information
  • Sr. Member
  • Posts: 220
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

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.


January 18, 2017, 12:00:02 AM
Reply #1

petediscrete

  • ****
  • Information
  • Sr. Member
  • Posts: 220
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.

January 18, 2017, 12:39:24 AM
Reply #2

bkenobi

  • *****
  • Information
  • Global Moderator
  • Posts: 1525
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 ***

January 18, 2017, 02:31:01 AM
Reply #3

petediscrete

  • ****
  • Information
  • Sr. Member
  • Posts: 220
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.

January 18, 2017, 05:39:49 PM
Reply #4

bkenobi

  • *****
  • Information
  • Global Moderator
  • Posts: 1525
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.

January 19, 2017, 03:04:35 AM
Reply #5

petediscrete

  • ****
  • Information
  • Sr. Member
  • Posts: 220
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.

January 19, 2017, 05:18:17 PM
Reply #6

bkenobi

  • *****
  • Information
  • Global Moderator
  • Posts: 1525
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.

January 26, 2017, 02:54:26 PM
Reply #7

Doc

  • *
  • Information
  • Newbie
  • Posts: 8
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.

January 26, 2017, 05:11:24 PM
Reply #8

petediscrete

  • ****
  • Information
  • Sr. Member
  • Posts: 220
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.

January 26, 2017, 09:43:22 PM
Reply #9

Doc

  • *
  • Information
  • Newbie
  • Posts: 8
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?

January 26, 2017, 11:06:39 PM
Reply #10

petediscrete

  • ****
  • Information
  • Sr. Member
  • Posts: 220
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.

 

January 27, 2017, 10:34:48 AM
Reply #11

Doc

  • *
  • Information
  • Newbie
  • Posts: 8
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.

January 27, 2017, 05:04:26 PM
Reply #12

bkenobi

  • *****
  • Information
  • Global Moderator
  • Posts: 1525
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.

January 27, 2017, 06:08:02 PM
Reply #13

petediscrete

  • ****
  • Information
  • Sr. Member
  • Posts: 220
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.

January 27, 2017, 11:35:03 PM
Reply #14

bkenobi

  • *****
  • Information
  • Global Moderator
  • Posts: 1525
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.