more G-Labs products

Author Topic: Errors after 447->493 update - help please  (Read 3733 times)

August 02, 2015, 10:37:37 PM
Read 3733 times

jshan

  • ***
  • Information
  • Full Member
  • Posts: 71
I updated my rPi from an error-free r474 to r493.  Now I am unable to send e-mails or Android Push Notification.  This is my second try from a new install and then an update path with the same error results.

I had SQLite errors in the log which I believe I've fixed  by following http://www.homegenie.it/forum/index.php?topic=976.0.  I also had MIG errors which I believe I fixed by stopping the HG service (sudo service homegenie stop), editing the systemconfig.xml file (sudo nano systemconfig.xml) as per http://www.homegenie.it/forum/index.php?topic=997.msg6087#msg6087 and then restarting the service.

I found 2 other errors in the log that seem to relate to my email/apn issues.  Can anyone please help me resolve these?  Thanks for your help!

2015-08-02T15:17:17.1064750-05:00   HomeAutomation.HomeGenie.Automation   NetHelper   Error getting response stream (Write: The authentication or decryption has failed.): SendFailure   Exception.StackTrace     at System.Net.HttpWebRequest.EndGetRequestStream (IAsyncResult asyncResult) [0x00000] in <filename unknown>:0
  at System.Net.HttpWebRequest.GetRequestStream () [0x00000] in <filename unknown>:0
  at System.Net.WebClient.UploadDataCore (System.Uri address, System.String method, System.Byte[] data, System.Object userToken) [0x00000] in <filename unknown>:0
  at System.Net.WebClient.UploadData (System.Uri address, System.String method, System.Byte[] data) [0x00000] in <filename unknown>:0

2015-08-02T15:17:25.6307550-05:00   HomeAutomation.HomeGenie.Automation   NetHelper   Message could not be sent.   Exception.StackTrace     at System.Net.Mail.SmtpClient.Send (System.Net.Mail.MailMessage message) [0x00000] in <filename unknown>:0
  at HomeGenie.Automation.Scripting.NetHelper.SendMessage (System.String from, System.String recipients, System.String subject, System.String messageText) [0x00000] in <filename unknown>:0 
« Last Edit: August 02, 2015, 11:27:42 PM by jshan »

August 05, 2015, 03:41:16 PM
Reply #1

jshan

  • ***
  • Information
  • Full Member
  • Posts: 71
Could Mono be the issue?  I'm running version 3.2.8.  Anyone running r491 or r492 or r493 on an rPi and successfully using e-mail?  If so, what version of Mono are you on?  Thanks for any input you can provide.

August 05, 2015, 05:01:19 PM
Reply #2

dani

  • *****
  • Information
  • Global Moderator
  • Posts: 535
Under Linux Debian on a PC my Mono version is :
Mono JIT compiler version 4.0.1 (tarball Tue May 12 15:39:23 UTC 2015)
Copyright (C) 2002-2014 Novell, Inc, Xamarin Inc and Contributors. www.mono-project.com

Under RaspIan, my Mono version is :
Mono JIT compiler version 3.2.8 (Debian 3.2.8+dfsg-4+rpi1)
Copyright (C) 2002-2014 Novell, Inc, Xamarin Inc and Contributors. www.mono-project.com

On the two version I can send email from program. Only SSL on gmail doesn't want to work.

August 05, 2015, 06:30:33 PM
Reply #3

jshan

  • ***
  • Information
  • Full Member
  • Posts: 71
Thank you, Dani!  We're running the same Mono version under Raspian so it does not look like Mono is my issue.  I will have to keep researching - frustrating.

August 09, 2015, 12:55:04 AM
Reply #4

jshan

  • ***
  • Information
  • Full Member
  • Posts: 71
I did a clean install: new raspbian image, new mono install (3.2.8), new HG (r491) install.  Restored my backup.  Everything seemed to come up fine.  Tried sending a test e-mail and got the same error as before:

2015-08-08T22:42:03.5472460+00:00   HomeAutomation.HomeGenie.Automation   NetHelper   Message could not be sent.   Exception.StackTrace     at System.Net.Mail.SmtpClient.Send (System.Net.Mail.MailMessage message) [0x00000] in <filename unknown>:0
  at HomeGenie.Automation.Scripting.NetHelper.SendMessage (System.String from, System.String recipients, System.String subject, System.String messageText) [0x00000] in <filename unknown>:0

This all worked fine in r474.  Anyone have any suggestions for how to proceed?  It would be really great to get a solution because I need this basic functionality.

Thanks,
John S.

August 09, 2015, 01:54:16 AM
Reply #5

Gene

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

August 09, 2015, 02:10:12 AM
Reply #6

Gene

  • *****
  • Information
  • Administrator
  • Posts: 1472
  • Tangible is the future!
    • Yet Another Programmer
Usually installing ca-certificates-mono package solves the issue.

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

g.

August 09, 2015, 06:48:14 AM
Reply #7

jshan

  • ***
  • Information
  • Full Member
  • Posts: 71
Gene, thanks for your replies!  You solved my problem - THANKS, very much appreciated!  Here's what I did:

I tried to install ca-certificates-mono but got an error that I could not fix:

sudo apt-get install ca-certificates-mono
Reading package lists... Done
Building dependency tree
Reading state information... Done
E: Unable to locate package ca-certificates-mono

I then tried mozroots:
First I had to: sudo apt-get install mono-complete (otherwise mozroots won't run)
sudo mozroots --import --ask-remove --machine  <-- fixed Push Notifications
sudo certmgr -ssl -m smtps://smtp.gmail.com:465

I use yahoo mail, so I also tried:
sudo certmgr -ssl -m smtps://smtp.mail.yahoo.com:465

For e-mail, this is working for me:
E-Mail address:           [email protected]
SMTP Mail Server address: smtp.mail.yahoo.com
SMTP username (optional): myname
SMTP password (optional): mypassword
SMTP Mail Server port:    587
SMTP Mail Server use SSL: TRUE
« Last Edit: November 24, 2015, 05:25:50 PM by jshan »

November 24, 2015, 06:04:38 AM
Reply #8

bkenobi

  • *****
  • Information
  • Global Moderator
  • Posts: 1525
There's a typo in the certmgr line for yahoo (yaoo instead of yahoo).

November 24, 2015, 05:26:09 PM
Reply #9

jshan

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

January 09, 2016, 05:53:29 PM
Reply #10

howardtopher

  • *
  • Information
  • Newbie
  • Posts: 2
Gene, thanks for your replies!  You solved my problem - THANKS, very much appreciated!  Here's what I did:

I tried to install ca-certificates-mono but got an error that I could not fix:

sudo apt-get install ca-certificates-mono
Reading package lists... Done
Building dependency tree
Reading state information... Done
E: Unable to locate package ca-certificates-mono

I then tried mozroots:
First I had to: sudo apt-get install mono-complete (otherwise mozroots won't run)
sudo mozroots --import --ask-remove --machine  <-- fixed Push Notifications
sudo certmgr -ssl -m smtps://smtp.gmail.com:465

I use yahoo mail, so I also tried:
sudo certmgr -ssl -m smtps://smtp.mail.yahoo.com:465

For e-mail, this is working for me:
E-Mail address:           [email protected]
SMTP Mail Server address: smtp.mail.yahoo.com
SMTP username (optional): myname
SMTP password (optional): mypassword
SMTP Mail Server port:    587
SMTP Mail Server use SSL: TRUE


This was a huge help, but mine was a little different.  Just putting it out there in case others run into the issue as well.

I'm running CentOS 6.7 and manually installed Mono from source.  Mono 3.12.1 to be exact.

After mono install:
1. cert-sync /etc/pki/tls/certs/ca-bundle.crt
2. certmgr -ssl -m smtps://smtp.gmail.com:465 (and say "y" to all questions)
3. restart homegenie

Email Account program in homegenie settings:
1. E-Mail address: <email>@gmail.com
2. SMTP Mail Server address: smtp.gmail.com
3. SMTP username: <email>@gmail.com
4. SMTP password: <app specific password since I'm using 2 step verification>
5. SMTP Mail Server port: 587
6. SMTP Mail Server use SSL: TRUE

According to http://www.mono-project.com/docs/faq/security/ that Gene linked to earlier, after mono 3.12 you don't have to worry about mozroots anymore and just use the cert-sync tool. However, after doing the cert-sync tool it still wasn't able to send mail. After trying the certmgr step it started working.

Frustrating that it's this difficult to get mono to send mail (I've been googling and trying stuff for a while now), but glad I got it working and I'm documenting it in my mono installation steps on my server.

January 22, 2016, 08:02:21 PM
Reply #11

ivn

  • **
  • Information
  • Jr. Member
  • Posts: 32
Works fine!!!

Thank you so much!!