Any new ideas how to get email working in HG?

Tuicemen, I deserve and accept the rebuke. My only comment in my defense is I would NEVER do that to my good working HG pi; but for this test unit on my workbench that I did not plan to continue using other than a second email tester, I was rude to it. I have since shut down properly. :slight_smile:

I discovered my router decided to disconnect both piā€™s and my Broadlink from the network! Weird! The other 15 network connected items are still online just fine! But these 3 disappeared from my IP scanner, I tried pinging them and nothing, yet both piā€™s seemed to be communicating with my browser, switching screens and letting me change settingsā€¦ I did not know cached pages would go that far! So I may have been offline with them and browser cache was giving me the weirdness? I had one pi on chrome, other on firefox and both seemed to be workingā€¦the new one even was popping up the boiler sw demo thing occasionally. What alerted me to being offline was the email test program stopped going green when run and I stopped getting failed to send noticesā€¦ reset router and they are backā€¦ sheeshā€¦

Of course they do.

Open databases do not close themselves no matter whether they are SQL Lite or MariaDB. No application would tolerate pulling the plug with open unsaved files.

The problem here is the lack of knowledge of the API and front end recent members are experiencing now. What they need to do is learn a little more about HG and what it is before ploughing through it. This would save hours of troubleshooting users problems.

My comment was not intended to be a dig at any one.
A ungraceful shutdown of HG doesnā€™t have to be cause by a plug pull.

When you remove a program that you have made changes to and input settings changes, you need to go and tell HG to forget those programs other wise when you reload the program HG will still see those programs and their settings from before.

I did not take it as a dig Tuicemen, just a well deserved comment! Anyway, I am onto something: Gene may have hard coded the Email Account as pid 142 and his software calls that pidā€¦ I see I still have a 142.dll & also a 142.dll.mbd, but when I deleted it on new SD card and iimported it again, it imported as pid 1003. I assume the options data is stored in the old access database file (.mbd) but no converter tools I have will convert it to readable info. I am going to research how to maybe force an import to use a given pid numberā€¦

well, pid number is not the issue. I went back to my working HG system with pid 142 E-Mail Account original name and it too does not take changes given in the Options screen of config->settingsā€¦

Maybe this shows something?

142 -0 ConfigureOptions.Email.SmtpPort 587
192.168.7.234 HTTP POST 200 /api/HomeAutomation.HomeGenie/Config/Modules.Update/ [OPEN]
142 -0 ConfigureOptions.Email.SmtpUseSsl

Then I try to send and it sends to:

2019-03-04 14:45:28.6531 Trace SendMessage: going to send email System.Net.Mail.MailMessage using mailService ā€˜smtp.gmail.comā€™, port ā€˜465ā€™, credentials System.Net.NetworkCredential, using SSL = True

It accepted my Options changes but did not change the email account info inside HG from previos 465&SSL to 587&noSSL?

I am convinced the issue is HG has timing issues on reading the Options input from startup tab of the program e-Mail Accounts and then running the program portion of it where it compares the values to the old valuesā€¦ I have not found the pause/delay/sleep whatever command yet that is a stand alone that I can put in between lines to slow it down or I would have elminated this possible problem already. But it seems it never gets all the input options at the same time, just one now and then? The result seems to be the smtp data is never quite right.

With help from tuicemen, a new HG install allowed me to enter fresh email account info and it is working on the test pi. From this I have found the account data is stored in the HG directory in a file called systemconfig.xml Unfortunately I do not know how to decode the data into decimal. For example, smtpPort 587 is stored as value caeClBc1p9PQAKw2Fuu3VA.

I am going to go into my working pi and edit this file, putting this and SSL line back to default and see if then reentering will overwrite thisā€¦

A shame I am back to relearning how to make email changes take affect againā€¦ Anyone ever find a simpler way than editiing systemconfig.xml file?

How about someone with programming experience telling me how to modify the built in emailer program to ALWAYS rewrite instead of trying to fancy and onlly rewrite if changes - which does not work.

here is that program 142, E-mail account:

// detect when an option of this program is changed and store the new value to system settings
When.ModuleParameterChanged((module, parameter)=>{
if (module.Instance.Equals(Program.Module) && parameter.Name.StartsWith(ā€œConfigureOptions.ā€)) {
var settingName = parameter.Name.Substring(17); // skip ā€œConfigureOptions.ā€ part
Settings.Parameter(ā€œMessaging.ā€+settingName).Value = parameter.Value;
}
return true;
});
Program.GoBackground();

Would it write everytime if I changed it to:

// detect when an option of this program is changed and store the new value to system settings
When.ModuleParameterChanged((module, parameter)=>{
if (module.Instance.Equals(Program.Module) && parameter.Name.StartsWith(ā€œConfigureOptions.ā€)) {
var settingName = parameter.Name.Substring(17); // skip ā€œConfigureOptions.ā€ part
Settings.Parameter(ā€œMessaging.ā€+settingName).Value = parameter.Value;
}
return true;
});
Program.GoBackground();

Or might the issue be an extra ā€œ)ā€ just before
Program.GoBackground(); ? I do not see a matching ( upstream of itā€¦

I just cannot get this systemconfig.xml file to change from (smtp.gmail.com:587)!
I know my gmx.com with port 465 worked without the typical certificate time out issue very few weeks/monthsā€¦ but I just cannot get HG to accept the new values!
DANG!

Here is my email program data, but the HG log shows it is still internally using gmail and port 567:

I gave up on those free email applications. Too much hassle with authentication setup.

My broadband provider supplies smtp server facilities so I use that server and port 587 and have no issues sending email notifications.

Youā€™ll find that you may get GMX setup successfully with HG then after a while GMX start blocking your notifications. Probably realise that itā€™s being used for purposes other than plain email. Same with Gmail. They both have very sophisticated spam filters built in and even when you allow a sender they somehow mark your notifications as spam.

Enquire from your internet provider if they allow you to use their smtp server for sending mail.

I thought gmx was one that did not have that certificate issue in a month or twoā€¦ I would appreciate it if you confirm it DOES have the issue before I use it for new HG install email!!

I am getting close with my new 8GB SD card buster cardā€¦

Please tell me: If I RESTORE HG using my last good HG zip backup, it will have the GMX/GMAIL mixed up email data, right? Yet I do not want to spend another 12 hours reprogramming all the other HG data instead of using my backup file in a restore.

I know from experience I get only one try to set HG email smtp data.

Do I use my backup or am I stuck spending the next week reprogramming everything?

I have our own company server with our own dedicated computer for our email. Are you saying I should use it for HG smtp? It did not work in the past but again probably due to the defect in HG rewriting email data.

Ok. I stopped using free email account options as they come with limitations. Entirely my decision and I did what best suits me. Totally your decision what you want to do.

When restoring a HG backup you are given a choice of what you want to restore. Examine that option carefully and decide what you want restored to your new setup and tick the appropriate boxes.

So I have email working again on new HG install. Yes, I cheated and used Juicemenā€™s image. Pete, know we are not given the choice to restore the basic built in HG programs - like email account send program #142. Luckily being a fresh install, even tho it populated my last gmx.com attempt, it DID overwrite it with my own email account that will not expire. Thanks for tip to turn off the log file - great advice.

So bottom line is still this: if one needs to change the user info in email account program, they can only do it by reinstalling HG from scratch. Wish this would be updated!

So you discovered the source of that original phantom GET call in your original post. That was the reason you embarked on rebuilding your HG install I assume.

Iā€™m also assuming you only have HG running on your Raspberry Pi. Remember you asked for instructions on how to remove HA Bridge.

As an exercise I really do suggest you try and install HG from the official HG repository. Itā€™s very straightforward and you can always restore your HG backup Configuration onto this. This of course can be done on a separate SD card while keeping your current SD safely tucked away. Itā€™s best to stick with the official source if, for no other reason anyone helping you knows where your files system is located on whatā€™s on your SD card.

Remember too, when restoring a HG backup Configuration you donā€™t have to restore every program. You get that option during the restore process. You tick the ones you want and leave the other check boxes blank.

Finally under Programs check each section to ensure you donā€™t have duplicates of some programs. This can happen after a restore onto a fresh install.

Anyway good luck with the new install.

I have a good buster/HG install. updated to latest HG. No questions there.

Pete, please learn that any ā€˜programā€™ with an ID below 1000 gets installed automatically and the user has NO way to prevent its installation. You can help more people, better, if you realize, and accept, this.

My new install is working as before. I have no extraneous programs. I do NOT have some X10 programs I had in the past. I believe they were removed - like the one that shows the X10 code received - it is gone. Also gone appears to be ALL capability to receive security codes thru the CM15. This disappeared about 1 year ago. Sure, yuo showed us how to SEND security codes via the api, and I thank you for that. But Gene seems to have removed all capacity to receive security codes. My DS10ā€™s stopped working a year ago. Even this new build refuses to acknowledge extended security codes. It also refuses to show any X10 codes received in that old program. I will be starting a new post asking if anyone has any security modules still working in HG.

Well your answer to security code sending is yes they work perfectly here with the latest version of Raspbian and HG. Nothing has changed on that front. Iā€™ve just tested them to make sure.

All you need to do if you want to to refresh a program below 1000 is to delete it , clean up in the modules section and reinstall it.

By all means start a new post and see if anyone else would like to contribute. Not a lot of X10 users here but you never know.

Pete, you say ā€œAll you need to do if you want to to refresh a program below 1000 is to delete it , clean up in the modules section and reinstall it.ā€

How do I reinstall it when I donā€™t have it? I feel some built in (below 1000 number) old standard programs in HG are no longer installed in newer versions of HG, so I do not think I can delete them and reinstall them?

Thanks for ideas!

You have two choices here. With a vanilla install of HG export all programs below 1000 so you always have a factory installed version of them on your local drive

Just download the required program from the GitHub.

I believe youā€™ve tracked down the source of your RX/TX problem to a faulty CM15. Iā€™m assuming you have this issue resolved now.