Run-Away 'Controller did not respond' message

Tonight my RPi3 rebooted due to a power outage. I restarted openLuup and it initially seemed fine, but then I noticed the yellow message box. When opened, it continued to increment up the counter with the message “Controller did not respond” and devices can not be controlled using ALTUI. The interface continues to run, but the functionality is severely diminished.

Tried a complete reboot of the PI and openLuup with no better results. PI works fine and I can ssh into it but openLuup is stuck in this endless loop. What do I do now?

Well, it sounds like openLuup is not running at all. Can you look at running processes and see it there?

What process do you use to start it up after a system reboot? Perhaps that’s not working.

Just to test this idea you could try and run it manually. If you get an error message that another copy is running, then you know it’s something else.

AK,

Thanks for the feedback. You are correct, openLuup was NOT running. But… I did learn a couple valuable lessons from this.

  1. On my system it takes a solid 90 seconds for openLuup to load and be ready. I clearly did not recognize this until this event occurred. Im not sure why it takes this much time, but it does.
  2. As a very novice RPI user, I continue to learn every day. Some days i go forward, other I go backward. But thankfully this forum is here to help.

My typical startup procedure was this (in Terminal):

cd /home/pi/ect/cmh-ludl
/home/pi/ect/cmh-ludl/openLuup_reload

In each case this is what I would see:

pi@raspberrypi:~ $ cd /home/pi/ect/cmh-ludl pi@raspberrypi:~/ect/cmh-ludl $ /home/pi/ect/cmh-ludl/openLuup_reload cp: cannot stat ?/www/cmh/skins/default/icons/MString.png?: No such file or directory

In addition, the terminal app seems to hang on this command, meaning that the typical “pi@raspberrypi:~/ect/cmh-ludl $” prompt not does display after I execute the above command.

Recently I have learned how to update the rc.local file using this command:

sudo cp -i /home/pi/Documents/rc.local /etc/rc.local

My edited rc.local looks like this:

#!/bin/sh -e
#
# rc.local
#
# This script is executed at the end of each multiuser runlevel.
# Make sure that the script will "exit 0" on success or any other
# value on error.
#
# In order to enable or disable this script just change the execution
# bits.
#
# By default this script does nothing.

# Print the IP address
_IP=$(hostname -I) || true
if [ "$_IP" ]; then
  printf "My IP address is %s\n" "$_IP"
fi

sleep 20
cd /etc/cmh-ludl
./openLuup_reload

exit 0

However I am not sure if the path is defined correctly. Should it read :
cd /home/pi/etc/cmh-ludl
OR
cd /etc/cmh-ludl

Again, the terminal app does seem to hang after this, and that MAY be part of the 90+ second delay in openLuup running and becoming responsive. I am beginning to think that once Terminal see’s the “?/www/cmh/skins/default/icons/MString.png?: No such file or directory” it takes up to 90 seconds for the app to timeout before becoming active again, thus the delay in my startup. Of course this is my rookie interpretation of what might be happening.

Lastly, I can not get my system to respond with any message like “Another copy is running” once I am SURE that openLuup is running. Maybe it is because of the error that the startup generates, or maybe I am simply not waiting long enough for the message to pop up.

So to summarize, I was able to get openLuup running again, but I still am not certain that it is starting completely and successfully, due to the error generated and the long delay before the site will load successfully.

Any suggestions would be appreciated. Thank you.

OK, there’s lots to say about this.

In fact, openLuup itself starts up in under 2 seconds (before the HTTP port 3480 server starts.) Plugins themselves, can take longer, but that’s up to them. What I think you’re talking about is the startup time after a system reboot? In which case, this is rather out of my control.

Your manual startup procedure:

cd /home/pi/ect/cmh-ludl
/home/pi/ect/cmh-ludl/openLuup_reload

invites some comments:

[ul][li]I continue to be bemused by the appearance of “ect” instead of “etc”. This may be at the root of some problems. Perhaps you have both directory trees on your system somehow. But this must, originally, have been a typo somewhere.[/li]
[li]having done the [tt]cd[/tt] to your openLuup home directory, there’s no need to specify the full path, in fact that could be prone to error. You would be better off simply with [tt]./openLuup_reload[/tt][/li][/ul]

However, this last point may also be key to some of your observations. In fact, the openLuup_reload script is essentially an infinite loop and will never return (or, at least, until you force an exit, not a reload, of openLuup) so you ought to hang there forever.

If you want to detach the process and get on with other things, then use

./openLuup_reload &

or

nohup ./openLuup_reload &

if you want to log out and keep the process running.

I’m not sure where this comes from:

cp: cannot stat ?/www/cmh/skins/default/icons/MString.png?: No such file or directory

but I would guess that it’s from a plugin (perhaps the MultiString plugin) which has tried to use os.execute() to copy a non-existent file. It’s definitely not an openLuup diagnostic message. The fact that the file is not found is almost definitely because the directory [tt]/www/cmh/skins/default/icons/[/tt] does not exist, or, at least, does not contain that file. One option might be to create a symbolic link so this becomes an alias to the openLuup icons/ directory.

You rc.local file contains a [tt]sleep[/tt] directive which will force a 20 second wait anyway. I think this is there to help ensure that network services have started up before openLuup tries anything. But here, the etc/ect bug might be biting you, since it does [tt]/etc/cmh-ludl[/tt]. Again, that’s a directory that may or may not exist, but I think you mean to use the one in your pi home directory. So check your file system for these paths… it’s quite possible, now, that you have multiple copies of an openLuup installation and things might not be where you expect them to be. Don’t know how this has all happened, since I’m not sure how you set up the system in the first place, but it’s not something which the default openLuup_install script has created. Perhaps this was a turnkey system?

So a few things to sort out here, which might be a bit challenging if you’re not that familiar with RPi or Linux, but not really all that difficult. Let us know how you get on.

AK,

As usual, you are 100% correct on each of your points.

  1. ect vs etc - Clearly my brain REFUSES to accept the proper way. I only have one occurrence on the directory tree, and YES it was incorrect. I will get that fixed and hope it does not affect the ALTUI registration, although I don’t think it will.
  2. MString - Yes, there is an instance of Multi-String running on the PI, so you are probably correct there. I will look into creating the symbolic link.
  3. This chunk of code comes right from the openLuup users guide, so I assumed it was necessary to keep the Sleep 20 line.
> Add these lines...
         sleep 20
         cd /etc/cmh-ludl
         ./openLuup_reload
exit 0
> IMPORTANT : 'exit 0' must NOT be removed.

I think that the vast majority of my (self-inflected) issues have come from my brain’s inability to recognize /etc/ versus /ect/. I’m glad you were bemused, but more importantly that you were still willing to help even after pointing it out TWO times!

Thank you again for everything you do to help guys like me!

There are some threads on starting openLuup using systemctl here: http://forum.micasaverde.com/index.php?topic=48431.0

Some more info here: http://forum.micasaverde.com/index.php?topic=35681.0

Thanks for reminding me of that. In fact, I’ve just switched to using systemctl on RPi and that seems great. I’m updating the documentation to include more on three different approaches for starting at boot time.

[quote=“kartcon, post:5, topic:198616”]AK,

As usual, you are 100% correct on each of your points.

  1. ect vs etc - Clearly my brain REFUSES to accept the proper way. I only have one occurrence on the directory tree, and YES it was incorrect. I will get that fixed and hope it does not affect the ALTUI registration, although I don’t think it will.
  2. MString - Yes, there is an instance of Multi-String running on the PI, so you are probably correct there. I will look into creating the symbolic link.
  3. This chunk of code comes right from the openLuup users guide, so I assumed it was necessary to keep the Sleep 20 line.
> Add these lines...
         sleep 20
         cd /etc/cmh-ludl
         ./openLuup_reload
exit 0
> IMPORTANT : 'exit 0' must NOT be removed.

I think that the vast majority of my (self-inflected) issues have come from my brain’s inability to recognize /etc/ versus /ect/. I’m glad you were bemused, but more importantly that you were still willing to help even after pointing it out TWO times!

Thank you again for everything you do to help guys like me![/quote]

Sorry but I have to admit this was entertaining.

One addition you could consider for the startup would be to add the use of “screen” with a bash script. It was helpful for me to be able to switch between different services as I have various bridges and local APIs running on the same machine.

At least one system I tried (think it was an openWRT version?) didn’t support screen.

My preferred option now is the systemctl method described here:
http://forum.micasaverde.com/index.php/topic,48431.0.html