HG process dies after about a day or so on raspberry Pi

Is anyone else experiencing this?
Homegenie process seems to just die after being up for a day or so. I’ll go to load the page and can’t connect. I initially thought Pi might be hanging so just blindly rebooted the Pi, but turns out Pi’s working fine, it’s just that the HG process dies.
Don’t know if it’s homegenie or the mono framework it’s running on… I run a standard install of r526 on Pi3 B+, I installed from a deb package. I don’t know how to debug it either, or if it’s even possible…

You might find that the Pi 3B+ is the issue. A lot of teething trouble being experienced with the release of this new board.

Do you have a Pi 3 or a Pi 2 you can do some comparison tests on. Ideally a Pi 2 would be better deployed here with HomeGenie 526

My instance of HG r526 has been crashing as well. However, the time period has been significantly longer… From your post, there is no information to compare HG usage. My HG configuration is set for now. I will access HG via the web browser or the Android app to manually turn on/off one of the nodes. Most of the activity in HG is from the automated functions. My crash interval is about three to four weeks. I don’t have the problem solved, but here is what I know so far. One is a known issue and the other is up for debate at least with me. As a point of reference, I am using a RPi 3B with Sandisk C10, 32G SD cards, connected to a X10 USB interface.

Known issue: Raspbian (Debian) uses the lircd package to interface IR controllers to top level applications. There is a mile long thread of denial on the Debian forum that started over a year ago about the problem with lircd. Finally, September 2017, there was an admission that a problem was found and corrected. There is no r52x that could adjust for the changes. One recommendation is to apt-get remove lircd. When I tried this, HG stopped working altogether. Even though, I do not use the IR functionality, there is no way for the average user (me) to unhook lircd from HG. There is a fairly simple temporary fix. Before I get into that, lets see if this is the problem you are experiencing.

When HG crashes, viewing /usr/local/bin/homegenie/log/homegenie and /var/log/syslog is helpful. Hopefully your Pi will reboot. Look at the homegenie. There should be a time break in log entries. HG is constantly making log entries, so any large gap in time is due to a crash. Note the time. Now look at syslog. First if you see references to glob every 1 or 2 seconds, the problem is related to lircd. Go back to the time noted. There might (should) be a reference to memory overflow. The fix I am using for now is as follows. From a terminal session on the RPi. Enter this after HG start up:

systemctl stop lircd

systemctl disable lircd

Syslog entries will no longer be in the glob. I am not sure that all the lircd entries are over running memory, stopping lircd seams to help.

Part two-debated. SD cards have a finite lifespan. My debate is the recommend use of USB flash drive will solve the problem. Both SD cards and flash drives, as I understand, use the same nand memory technology. Maybe there is something in the USB vs. SD interface that makes USB last longer. I have not found any factual data to support one way or the other. Most RPi recommendations are for class 10 SD cards. Here is what I am doing for now. Since my HG configuration is not changing, I created a backup image of a SD card with windisk32. When HG crashes I will try to look through the log files and see if there is more for me to troubleshoot. I will then restart HG on a copy of the saved image. The only loss is recent log entries. Until the next time.

Here is the debate. I have a few extra Sandisk C10 SD cards. So, when the crash occurs, I restart with a newly imaged card. Then take the removed card and transfer the saved image onto it again. I don’t see where windisk32 is blocking out bad memory locations. I have set up another RPi to boot from a USB drive for testing. There is a change needed in the RPi boot. The following link has instructions:


My first pass was with a PNY flash drive. It works, but really slows down the RPi. Not sure why. Will do another trial with one of the recommended drives, a Sandisk Cruzer.

Sorry to be so long here, but I really like HomeGenie. To the point, I have trashed other home automation systems just because it would not load properly straight out of the box. HomeGenie has, to me, a reasonable learning curve. As compared to some of the packages that require a high level of fluency in at least one computer language. I can stumble though code. To turn on a light at sunset, I don’t think so. Hope this helps getting you started on troubleshooting.

Thank you both for your suggestions!

I’m afraid I’m still none the wiser. The Pi itself is not crashing and is working fine (no reboot). It’s just the HomeGenie.exe process that eventually dies. The longest it’s been on was about 2 days. Unfortunately I don’t have a Pi2 to hand to verify if it really is the board…
I’m not running much on it, I’ve only just started playing with MySensors, and have only one prototype MySensors serial gateway set up and just one temp/humidity sensor paired as I wanted to test HG before I start building. So far not very impressed :slight_smile:

Such a shame. But as I mentioned above the Pi 3 B+ has been causing issues for others using different HA systems.

It would be worth your while sourcing a Raspberry Pi 2 or a Pi 3 to run HomeGenie on. I can assure you it operates fine on these boards.

I assume you have carrier out a sudo apt-get update and sudo apt-get upgrade and have the latest stable version of Mono installed.

Stop the HomeGenie service and launch it manually which will allow you to examine the log in real-time. You may be able to identify the offending process there.

I’ve had this happen to me running on a Zero W but it has been while attempting to configure something.
A Pi reboot doesn’t help nor does a total shutdown and power back up after a few mins, only a reinstall of HG then restore gets me back up again.
Initially I thought I just clicked the wrong thing ( I’m new to HG and a Pi) now I’m not to sure.

Testing and development of v525 on the Raspberry Pi platform stopped at version Pi 2B as far as I remember. I’m not even sure the Pi Zero was released at that stage.

It could be down to incompatible libraries and/or firmware.

@zapped, could you attach your logs after the process crash?
Without seeing the logs it’s almost impossible to find the problem causing the system to hang or crash.

Just a follow on here - Based on the HG log, my instance stopped yesterday at 11:11EDT. Raspbian was still running, so looked at syslog. Entry was “time has changed” No clue what that means, Yet. Restarted HG on same SD card. No problem. HG has been running over four weeks without a problem. Swapped in a new image of HG anyway. OK for now.

Reading the logs is really important. I have been thinking my HG crash is due to the SD card, “out of memory”. However, this might be due to a slow memory bleed in the 1G RAM. I have been though a number of rotations on the SD cards without fixing the HG crash.

I did try setting up a RPi on USB boot. The PNY flash drive was very slow. Tried one of the recommended, San Disk Cruzier. It did not even boot. Non issue at this point if memory bleed is the problem.

Now, Bounz has been very helpful in solving problems. I reread the thread here and see RPi3B+, My Sensors and Pi Zero. I am aware of these, but have no experience. My problems are probably not the same. Syslog can grow quite large. Running $ ps aux > runtime.txt, then sending along with the homegenie and syslog might help sort out the problem.

I setup HG on a 3B+ but had never used it as I was using the Zero W which continues to run without issue.Only if I attempt to restart the service from inside HG does it cause me a issue.

A few days ago I took my 3B+ to the cottage and now HG fails to start rebooting is no help so it looks like the only way to get back up and running is with a new SD card.
I tried a reinstall of HG which works for the Zerro but not on the 3B+ (yet ):roll_eyes::roll_eyes::frowning:
Is there a way to restart the HG service from the CLI?
Since I didn’t bring my backup SD card I’m lost.:frowning:


sudo /etc/init.d/homegenie stop
sudo /etc/init.d/homegenie start

I commented in another post today and it was also highlighted by bekenobi that you need to tie HomeGenie to version Mono 5.4 to avoid operational difficulties like these. Unless Bounz has made any recent changes to the package, it is recommended that you use Mono 5.4

HomeGenie v526 and v1.1.15 is working on the Raspberry Pi from version 2 upwards including the Zero and its variant with Mono 5.4

Just to follow up guys:
I’ve moved my HG installation to a PC machine running Windows 10 and have had no issues.
It’s clearly unstable on Pi (well, at least on the newest Pi running the newest raspbian).

Works on Raspberry Pi3 and Zero W as long as you tie it to Mono version as above. The latest Raspberry Pi 3+ has problems the developers are still trying to resolve.

Works fine on the pi… its not unstable. .but one of the programs may be…

Can you edit your nlog config file and set the logfile level to trace if not already.

I have a script for backing up my installations that I use from my desktop… but I did intend to add functionality to do a scheduled backup… just never got around to it. .

Ill post the script later, it was on the old forum… infact… let me google…

2 secs later:


That may indeed be so. However, I’ve already moved the installation to a PC machine and have already connected a MySensors gateway and started connecting some other devices as well, and will most probably use the pi board for another project.

I am experiencing some weird behaviour with the UdpClientHelper at the moment - I’m working on a Program and a Widget to connect my BMW Wallbox charger to HG. Depending on how I go, I might open a separate thread here asking for some help or share my success :stuck_out_tongue:

1 Like

what wierd behaviour are you seeing… I vaguely remember someone raising an issue with the TCP or UDP helper on the old forum… but that was a while ago…

I’m running a 3B+ and have been for a while now.
initially I was experiencing the Issue reported in this thread however I removed programs (not just disable) not required like Philips hue, the IR controller…….

I’ve not had HG hang or die since but my setup here at the off grid place is small and mostly just X10 devices.

Yes stripping back your HomeGenie package should help as you’ve probably eliminated the offending program that is causing the issue. The offending package is probably missing a dependency which is triggering the crash.

What version of HomeGenie and Mono are you using on the 3B+.

Looks like @bkenobi solution of tying HomeGenie to Mono 5.4 is now a problem. I was doing a fresh install for another user yesterday and Mono will not let me tie to 5.4 now. It’s reporting that this version could cause problems to the system and would not proceed with Mono installation. It worked three weeks ago when I tried it.