Trobleshooting clean install on Stretch

I tried going back to 525 but it would not load. I think the issue is that I already had mono 4.6.2 installed and the old HG won’t run on the newer version. I figured I’d try making a new image without updating mono (hopefully meaning I’d end up with mono 3.2.8). Well, apparently mono Stretch is updated too, so HG 525 and 526 still failed to run.

My next thought was to try Jessie and my old installation instructions. Well, that may work and it may not…but it doesn’t load on the RPi3. I believe my Jessie image is old enough that it won’t run on the RPi3 out of the box meaning I can’t log in via SSH. I could probably log in locally if I dug out an HDMI adapter and a USB keyboard, but I didn’t have time yesterday.

Stepping back for a second here… My goal is to try running 525 or 526 on the RPi3 so that I can confirm that my backup image will run on the RPi3 prior to adding 1.1.15 into the mix. My script installs everything including Mono 4.6.2 which apparently Gene’s HG doesn’t like. Is there a way to install Mono 3.2.8 on Stretch or am I wasting my time?

It’s really strange, as I used Mono 4.6 to run HG 525, 526 and 1.1.15 and had no issues. So I think that Mono version doesn’t matter in your case.
Can you simply download archive with HG version you need, extract it somewhere and then from that folder run sudo mono HomeGenie.exe? HomeGenie will then write it’s output to the console, so you will be able to see every exception occurred during the start.
And please, let’s start separate thread to solve this particular issue.

Links to the archives of HomeGenie:
r525: https://github.com/genielabs/HomeGenie/releases/download/v1.1-beta.525/homegenie_1_1_beta_r525.tgz
r526: https://github.com/genielabs/HomeGenie/releases/download/v1.1-beta.526/homegenie_1_1_beta_r526.tgz

You could be right as I thought I had 526 running on the RPi3 at some point. I have been using the .deb files but will try the tarball method.

Same here Bounz.

Running HG V526 on the Raspberry Pi 3 in Raspbian Stretch with Mono 4.6. No problems here. The only problem I encountered was trying to restore my v526 backup settings to v1.1.15

What I will try to do is create a vanilla version of Raspbian Stretch with the latest version of Mono v5.10 install HG526 and see what happens.

I imagine Bkenobi’s version is heavily modified to suit his purposes so maybe certain dependencies haven’t transferred over as they should have. I’m only guessing here.

I started with a fresh image and my script. I downloaded 525 tarball and extracted. I successfully launched 525 with

sudo mono HomeGenie.exe

I see a few error messages on launch

2018-03-08 18:32:40.3584 Error HomeAutomation.HomeGenie Service.Utility.RunAsyncTask    Object reference not set to an instance of an object    Exception.StackTrace      at HomeGenie.Automation.ProgramManager.RoutePropertyBeforeChangeEvent (System.Object eventData) [0x0003c] in <4019aa132a1b41ad93c0376d6b693dbc>:0
  at HomeGenie.Automation.ProgramManager.SignalPropertyChange (System.Object sender, HomeGenie.Data.Module module, MIG.MigEvent eventData) [0x0002b] in <4019aa132a1b41ad93c0376d6b693dbc>:0
  at HomeGenie.Service.HomeGenieService+<migService_InterfacePropertyChanged>c__AnonStorey4.<>m__1 () [0x00001] in <4019aa132a1b41ad93c0376d6b693dbc>:0
  at HomeGenie.Service.Utility+<RunAsyncTask>c__AnonStorey4.<>m__0 () [0x00002] in <4019aa132a1b41ad93c0376d6b693dbc>:0

...

2018-03-08 18:32:40.3627 Error HomeAutomation.HomeGenie Service.Utility.RunAsyncTask    Object reference not set to an instance of an object    Exception.StackTrace      at HomeGenie.Automation.ProgramManager.RoutePropertyBeforeChangeEvent (System.Object eventData) [0x0003c] in <4019aa132a1b41ad93c0376d6b693dbc>:0
  at HomeGenie.Automation.ProgramManager.SignalPropertyChange (System.Object sender, HomeGenie.Data.Module module, MIG.MigEvent eventData) [0x0002b] in <4019aa132a1b41ad93c0376d6b693dbc>:0
  at HomeGenie.Service.HomeGenieService+<migService_InterfacePropertyChanged>c__AnonStorey4.<>m__1 () [0x00001] in <4019aa132a1b41ad93c0376d6b693dbc>:0
  at HomeGenie.Service.Utility+<RunAsyncTask>c__AnonStorey4.<>m__0 () [0x00002] in <4019aa132a1b41ad93c0376d6b693dbc>:0

...

2018-03-08 18:32:40.3627 Error HomeAutomation.HomeGenie Service.Utility.RunAsyncTask    Object reference not set to an instance of an object    Exception.StackTrace      at HomeGenie.Automation.ProgramManager.RoutePropertyBeforeChangeEvent (System.Object eventData) [0x0003c] in <4019aa132a1b41ad93c0376d6b693dbc>:0
  at HomeGenie.Automation.ProgramManager.SignalPropertyChange (System.Object sender, HomeGenie.Data.Module module, MIG.MigEvent eventData) [0x0002b] in <4019aa132a1b41ad93c0376d6b693dbc>:0
  at HomeGenie.Service.HomeGenieService+<migService_InterfacePropertyChanged>c__AnonStorey4.<>m__1 () [0x00001] in <4019aa132a1b41ad93c0376d6b693dbc>:0
  at HomeGenie.Service.Utility+<RunAsyncTask>c__AnonStorey4.<>m__0 () [0x00002] in <4019aa132a1b41ad93c0376d6b693dbc>:0

Otherwise, everything looks ok. However, the web server is not running confirmed by a service scan. The only open ports are 22, 139, and 445. I checked again and HG stopped and now won’t start again. I have no data in the homegenie/log/homegenie.log file (empty).

I repeated the installation for 526 and ran HG. This time I had no errors in the output. However, after it got to the UPNP step it froze (same line where it froze on 525) and I had to reconnect. After that point, HG once again would not start.

EDIT: I downloaded 1.1.15 tarball and was going to try that, but chores got in the way. I’ll try to run it before work tomorrow.

Well, I had a couple strange issues that I’m working through that just started up the last time I flashed the SD and ran the script.

  1. for some reason Samba service started failing. I reinstalled it a couple times, but I couldn’t get it back up so another round of writing SD. Now it won’t show up in Windows but I can navigate to the share via the IP. Strange…

  2. The extraction of the tarball for 1.1.15 fails. I think this may be an issue with Stretch as the archive checks out fine in Windows and works in Jessie on the RPi1. I get the following error if anyone has any thoughts:

pi@raspberrypi:~ $ tar -xvzf homegenie_1.1.15_all.tgz

gzip: stdin: not in gzip format
tar: Child returned status 1
tar: Error is not recoverable: exiting now

I’m not clear what the issue is though I’ll do a little more digging when I get a chance. Also, I know these growing pains I’m posting about are related to the new release as they pertain to generation of a bulletproof script for new users, but should this be split off into a new topic somewhere so that the original release thread can be kept more clean? If so, maybe a mod could move my content and related responses to a more appropriate location.

Try tar xzvf instead of the command you are using. Possibly a syntax error is throwing the error.

I figured it out with the help of the RPi forum. The file isn’t a tgz, it’s actually just a .tar with the wrong extension. I was able to use tar 1.27.1 on Jessie without issue, but when I use tar 1.29 on Stretch it does not work. I’d recommend Bounz look into this and verify the compression as it seems to be a problem for at least some people (one user on the RPi forum tested with his file on PRi3/Stretch and got the same failure).

Anyway, it is not extracted and I am running HG 1.1.15 from the command line out of the tgz file rather than the deb installation. I am able to log in via web and it’s currently not crashing. When I try the same with 525 and 526 they both crash. Strange.

EDIT: Since Gene’s versions didn’t run, I went back to Bounz’s and now it crashes too. I’ll upload anything that might help debug either my bad setup or a potential issue with HG…

May be of use to you.

I uninstalled v526 on Raspbian Stretch, installed V1.1.15 and successfully restored my v526 backup settings to V1.1.15.

Everything working as normal.

As mentioned by David Wallis don’t use the latest version Mono 5.10. It’s throwing an error which halts HG. I’m using Mono 5.4

How do you select the version of mono that’s installed when using apt-get? I am using the code that David posted for my script and it results in an installation of 4.6.2.

pi@raspberrypi:~ $ mono --version
Mono JIT compiler version 4.6.2 (Debian 4.6.2.7+dfsg-1)
Copyright (C) 2002-2014 Novell, Inc, Xamarin Inc and Contributors. www.mono-project.com
        TLS:           normal
        SIGSEGV:       normal
        Notifications: epoll
        Architecture:  armel,vfp+hard
        Disabled:      none
        Misc:          softdebug
        LLVM:          supported, not enabled.
        GC:            sgen

EDIT: Apparently when I was testing different things that were/weren’t working, I disabled the lines that install the updated mono. I’m writing another image and running the script again to verify that I have an updated version of mono installed.

EDIT 2: I started over and ran David’s commands (same as what the mono project guide says). After completion, I have mono 5.10.0.160. However, HG now won’t run at all. I think I need an older version (as David and Petediscrete mentioned). But, I’m still not sure how to select the version I want to install when using apt-get.

I believe I need to install a snapshot of the older version (5.4.0) to get things working. The code I am trying to use does not work as the “apt-get update” says ignoring on every line.

# Install Mono
yes | sudo apt-get install dirmngr
sudo apt-key adv --keyserver hkp://keyserver.ubuntu.com:80 --recv-keys 3FA7E0328081BFF6A14DA29AA6A19B38D3D831EF
echo "deb http://download.mono-project.com/repo/debian/dists/stable-stretch/snapshots/5.4.0/ raspbianstretch main" | sudo tee /etc/apt/sources.list.d/mono-official.list
sudo apt-get update
yes | sudo apt-get install mono-complete

pi@raspberrypi:~ $ sudo apt-get update
Ign:1 http://download.mono-project.com/repo/debian/dists/stable-stretch/snapshots/5.4.0 stable-raspbianstretch InRelease
Ign:2 http://download.mono-project.com/repo/debian/dists/stable-stretch/snapshots/5.4.0 stable-raspbianstretch Release
Hit:3 http://archive.raspberrypi.org/debian stretch InRelease
Hit:4 http://mirrordirector.raspbian.org/raspbian stretch InRelease
Ign:5 http://download.mono-project.com/repo/debian/dists/stable-stretch/snapshots/5.4.0 stable-raspbianstretch/main all Packages
Ign:6 http://download.mono-project.com/repo/debian/dists/stable-stretch/snapshots/5.4.0 stable-raspbianstretch/main armhf Packages
Ign:7 http://download.mono-project.com/repo/debian/dists/stable-stretch/snapshots/5.4.0 stable-raspbianstretch/main Translation-en
Ign:5 http://download.mono-project.com/repo/debian/dists/stable-stretch/snapshots/5.4.0 stable-raspbianstretch/main all Packages
Ign:6 http://download.mono-project.com/repo/debian/dists/stable-stretch/snapshots/5.4.0 stable-raspbianstretch/main armhf Packages
Ign:7 http://download.mono-project.com/repo/debian/dists/stable-stretch/snapshots/5.4.0 stable-raspbianstretch/main Translation-en
Ign:5 http://download.mono-project.com/repo/debian/dists/stable-stretch/snapshots/5.4.0 stable-raspbianstretch/main all Packages
Ign:6 http://download.mono-project.com/repo/debian/dists/stable-stretch/snapshots/5.4.0 stable-raspbianstretch/main armhf Packages
Ign:7 http://download.mono-project.com/repo/debian/dists/stable-stretch/snapshots/5.4.0 stable-raspbianstretch/main Translation-en
Ign:5 http://download.mono-project.com/repo/debian/dists/stable-stretch/snapshots/5.4.0 stable-raspbianstretch/main all Packages
Ign:6 http://download.mono-project.com/repo/debian/dists/stable-stretch/snapshots/5.4.0 stable-raspbianstretch/main armhf Packages
Ign:7 http://download.mono-project.com/repo/debian/dists/stable-stretch/snapshots/5.4.0 stable-raspbianstretch/main Translation-en
Ign:5 http://download.mono-project.com/repo/debian/dists/stable-stretch/snapshots/5.4.0 stable-raspbianstretch/main all Packages
Ign:6 http://download.mono-project.com/repo/debian/dists/stable-stretch/snapshots/5.4.0 stable-raspbianstretch/main armhf Packages
Ign:7 http://download.mono-project.com/repo/debian/dists/stable-stretch/snapshots/5.4.0 stable-raspbianstretch/main Translation-en
Ign:5 http://download.mono-project.com/repo/debian/dists/stable-stretch/snapshots/5.4.0 stable-raspbianstretch/main all Packages
Err:6 http://download.mono-project.com/repo/debian/dists/stable-stretch/snapshots/5.4.0 stable-raspbianstretch/main armhf Packages
  404  Not Found [IP: 72.21.81.200 80]
Ign:7 http://download.mono-project.com/repo/debian/dists/stable-stretch/snapshots/5.4.0 stable-raspbianstretch/main Translation-en
Reading package lists... Done
W: The repository 'http://download.mono-project.com/repo/debian/dists/stable-stretch/snapshots/5.4.0 stable-raspbianstretch Release' does not have a Release file.
N: Data from such a repository can't be authenticated and is therefore potentially dangerous to use.
N: See apt-secure(8) manpage for repository creation and user configuration details.
E: Failed to fetch http://download.mono-project.com/repo/debian/dists/stable-stretch/snapshots/5.4.0/dists/stable-raspbianstretch/main/binary-armhf/Packages  404  Not Found [IP: 72.21.81.200 80]
E: Some index files failed to download. They have been ignored, or old ones used instead.

EDIT: If I’m reading the output correctly, I think I just need to modify my request slightly.

# Install Mono
yes | sudo apt-get install dirmngr
sudo apt-key adv --keyserver hkp://keyserver.ubuntu.com:80 --recv-keys 3FA7E0328081BFF6A14DA29AA6A19B38D3D831EF
echo "deb http://download.mono-project.com/repo/debian/dists/stable-stretch/snapshots/5.4.0/ stable-raspbianstretch main" | sudo tee /etc/apt/sources.list.d/mono-official.list
sudo apt-get update
yes | sudo apt-get install mono-complete

As far as I understand you need to tie your installation of Stretch to a particular version of Mono to ensure it doesn’t update to the latest.

I happened to have Mono 5.4 on my HG V526 so I just uninstalled v526 and installed v1.1.15.

We need to get it working with Mono 5.10 otherwise we will end up with SSL security certificates issues again (no emails being sent)

I agree we need to make sure HG stays compatible with the current version of mono, but my primary concern at the moment is getting a working installation so I can finalize a new user script. That script may need updating from time to time, but it has to work day 1.

I think I figured out the issue with installing an older version of mono.

# Install Mono
yes | sudo apt-get install dirmngr
sudo apt-key adv --keyserver hkp://keyserver.ubuntu.com:80 --recv-keys 3FA7E0328081BFF6A14DA29AA6A19B38D3D831EF
echo "deb http://download.mono-project.com/repo/debian stable-raspbianstretch/snapshots/5.4.0 main" | sudo tee /etc/apt/sources.list.d/mono-official.list
sudo apt-get update
yes | sudo apt-get install mono-complete

There is one danger with locking mono to an older version that needs to be addressed. From my reading (while I had 5.10 installed), I found that downgrading mono to something older is ridiculously complicated. It requires generating a command to downgrade each dependency, not just the main mono-complete command. IMO, it’s easier to write a new image rather than downgrading.

HG 1.1.15 is currently running on my RPi3 with stretch under mono 5.4.0.210. I didn’t install things like Samba or Mosquitto this time to limit the potential causes of problems (was a mono issue though). I also deleted all components that Gene had in there as examples and turned off all programs. Assuming things continue working for a day or so, I’ll backup the setup and start trying to get my backup to work. I may have to manually reinstall things, but I’ll try the brute force and restore my potentially problematic backup first.

Still running this morning, so assuming that’s the case this afternoon I’ll restore my backup.

I had the same problem when I did update (and mono was updated from 4.6.2 to 5.1…).
HG was running for 3 month’s but after the update & upgrade it was giving :

error%20HG%20after%20upgrade%20debian%20mono

First I tryed to install this version Version 1.1.15 released
but it was giving now a mig.service error

Did clean install on new image, as descripted on the website, and was working again with mono 4.6.2

Hope you can use the info

I tried restoring and the process froze on lirc. I don’t use IR remotes, so this isn’t an issue except that I can’t stop it from installing. I’ll try removing it from my working setup and creating a new backup.

The stripped down version of my backup restored almost instantly. I deleted all programs I don’t typically use including many of Gene’s codes. I don’t know what the issue was, but HG 1.1.15 is currently running with my backup.