more G-Labs products

Author Topic: Problem with sending email alerts HG on a Raspberry Pi  (Read 3568 times)

September 16, 2015, 12:55:36 PM
Read 3568 times

petediscrete

  • ****
  • Information
  • Sr. Member
  • Posts: 220


I'm using an RPI with the latest HG release as of 14th September 2015. I've tried installing Mono to deal with possible SSL issues on Gmail but as of yet still no success. I've tried all possible ports, I've dropped the @gmail.com on the username option and SSL=TRUE but still no success.

Does anyone have a working Gmail alert on a Raspberry Pi in HG and if so could you possibly post exactly what you did to achieve this, including settings and any other adjustments you had to make to achieve this. I've spent so much time on this with very little success. I do have another Debian based program running on the RPI, MotionPie, a video based security system which sends email alerts so I know that this function works on the RPI.

September 16, 2015, 01:11:14 PM
Reply #1

Gene

  • *****
  • Information
  • Administrator
  • Posts: 1472
  • Tangible is the future!
    • Yet Another Programmer
try

Code: [Select]
sudo apt-get install ca-certificates-mono

if this package is not found, try upgrading mono from official repository: http://www.mono-project.com/docs/getting-started/install/linux/
After that you should be able installing the ca-certificates-mono package also.


September 16, 2015, 03:59:08 PM
Reply #2

petediscrete

  • ****
  • Information
  • Sr. Member
  • Posts: 220
Ok I installed Mono from official repository but when trying to install CA certificates I get the message E:unable to locate package ca-certificates-mono

September 16, 2015, 04:14:24 PM
Reply #3

jshan

  • ***
  • Information
  • Full Member
  • Posts: 71

September 16, 2015, 05:43:40 PM
Reply #4

petediscrete

  • ****
  • Information
  • Sr. Member
  • Posts: 220
Thanks. I've tried that too. No solution there either.

As with all versions of Linux, the more options you try the more likely it is that you will have broken packages and dependency issues. Some of the older solutions are now not relevant owing to the newer version of Mono. As per suggestion from Gene above I've installed the newest version of Mono from the official repository so I can't install on older version on top of it.

It's not looking good for a solution to my problem.

September 16, 2015, 06:01:45 PM
Reply #5

Gene

  • *****
  • Information
  • Administrator
  • Posts: 1472
  • Tangible is the future!
    • Yet Another Programmer
Did read here http://www.mono-project.com/docs/getting-started/install/linux/  under Usage and Notes ?
The package is in that repos, so if you don't find it something is wrong with the apt configuration I guess.

http://origin-download.mono-project.com/repo/debian/pool/main/m/mono/
« Last Edit: September 16, 2015, 06:04:43 PM by Gene »

September 16, 2015, 06:17:04 PM
Reply #6

petediscrete

  • ****
  • Information
  • Sr. Member
  • Posts: 220
Just to update on this post. As I mentioned previously, I tried every solution I could possibly find. The last solution I tried is outlined here http://askubuntu.com/questions/647808/unable-to-locate-mono-packages-in-ubuntu-14-04 and I rebooted the Raspberry Pi. I can now send an email using the C# program snippet mentioned in an earlier program. I'm not actually sure what resolved the problem but I'm going to try incorporating this feature into my X10 setup.

Thanks to everyone who provided solutions. The annoying part is I can't say for sure which one solved the problem

September 17, 2015, 08:01:50 AM
Reply #7

bkenobi

  • *****
  • Information
  • Global Moderator
  • Posts: 1525
Well now I'm in a predicament.  I found that my email wasn't working anymore, so I followed the steps both Gene and others posted and now I've broken HG.  I think the issue is related to momo though as when I run mono--version I get a segmentation fault.  I checked the service status and it indicates HG is not running which is confirmed by my inability to log in to the web or android app.  any recommendations would be very much appreciated!

September 17, 2015, 04:38:49 PM
Reply #8

petediscrete

  • ****
  • Information
  • Sr. Member
  • Posts: 220
Bkenobi, I'd try that link I posted just above. It seems the latest version of MONO resolves any SSL certificate issues. Again I can't say that for certain it I went through that process as a last resort, rebooted my RPI and email alert was working. A lot of other Linux HA programs require MONO and it seems to be an unwieldy beast particularly if program developers don't keep up to speed with its update cycles.

September 17, 2015, 04:50:23 PM
Reply #9

bkenobi

  • *****
  • Information
  • Global Moderator
  • Posts: 1525
Thanks for the reply.  That's one of the links I did try.  I got frustrated and stopped working on this last night when all of the responses from my RPi were similar to those of the "solution" in that link.  It was making the right responses (giving only updated version numbers but the rest was identical).

When I was trying to update the system, I started with the first links in the thread that Gene posted:

http://www.mono-project.com/docs/getting-started/install/linux/

When I ran through the different installs, I got a lot of lines that were errors, but I assumed that was simply due to them being already present.  I think I must have some kind of corrupted version control type issue where components aren't working together or something.  Perhaps I could uninstall mono and start from scratch?  Suggestions are appreciated as I'm not an expert with managing Linux though I've been a user for a long time.

September 17, 2015, 04:55:04 PM
Reply #10

bkenobi

  • *****
  • Information
  • Global Moderator
  • Posts: 1525
I just googled "apt-get reinstall" and the first link suggests that I can simply add "--reinstall" when running the commands above to force the packages to reinstall.  I'll try that tonight.

Code: [Select]
You can reinstall a package with sudo apt-get install --reinstall packagename.
This completely removes the package (but not the packages that depend on it),
then reinstalls the package.

This can be convenient when the package has many reverse dependencies.

From:
http://superuser.com/questions/102449/how-to-reinstall-a-package-using-apt-get
« Last Edit: September 17, 2015, 05:00:14 PM by bkenobi »

September 18, 2015, 05:52:41 PM
Reply #11

bkenobi

  • *****
  • Information
  • Global Moderator
  • Posts: 1525
I don't understand why, but apparently mono is broken badly.  I'm not that familiar with repairing Linux and looking on Google seems to suggest that it's easier to just start over on RPi since it's such a small image.  I have a backup so I loaded it and everything is back up and running.  I guess I'll just back up this image to the broken card and perform updates.

The backup is running r478 and the primary difference between it and the broken card is updates.  I've added/updated a couple APPs but basically the broken card is running the current version of HG.  I find it odd that the old version sent emails without issue and the new version is non-functional.

Can I simply copy the xml files from the /usr/local/bin/homegenie path to the backup card's homegenie path?  I can't run HG on the broken card anymore, so I can't use the standard backup method.  I plan on restoring the most recent backup and copying those xml files as a final step.

December 04, 2015, 01:37:12 AM
Reply #12

maxflax

  • ***
  • Information
  • Full Member
  • Posts: 90
Did you solve this with install the ca-certificates-mono without breaking mono?

December 04, 2015, 01:52:14 AM
Reply #13

bkenobi

  • *****
  • Information
  • Global Moderator
  • Posts: 1525
The last go around I did not attempt to force an update to mono 4 and everything seems to have worked correctly.  I have a step-by-step guide that I put together that should be reliable in creating an RPi iinstallation with working HG including email notification.

December 04, 2015, 04:02:24 AM
Reply #14

maxflax

  • ***
  • Information
  • Full Member
  • Posts: 90
which step did you do to make notification with gmail to work?