Raspberry Pi Install - Embarrassing question?

How do I do that?

Ok, will look for it

Hope so :slight_smile:

[ol][li]Run the system for a while.[/li]
[li]make the exit request via your browser[/li]
[li]send the log file /etc/cmh-ludl/LuaUPnP.log[/li][/ol]

Here you go.

The previous one I shared in reply #16, was from /var/log/cmh , in /etc/cmh-ludl there are 6 versions of LuaUPNP. Most with a number suffix, Attached is the no.5, which looks to be the latest one.

Ok, something has changed and progress, is being made, and I think I might be onto something.

Now, keep in mind that my primary device is an iPad, so I do everything on that - If I run this.

$ cd /etc/cmh-ludl $ ./openLuup_reload

Then the AltUI via this URL works. (But !)

http://192.168.1.77:3480/data_request?id=lr_ALTUI_Handler&command=home#

It looks like if/when I disconnect/close down the SSH utility app I’m using to connect to the Pi and run all the comand lines, it stops OpenLuup from running !!

Does anyone know the command line that will keep the process running, after I log off/disconnect?

[quote=“parkerc, post:24, topic:191960”]If I run this.
[…]
Then the AltUI via this URL works.[/quote]

Progress indeed!

It looks like if/when I disconnect/close down the SSH utility app I'm using to connect to the Pi and run all the comand lines, it stops OpenLuup from running !!

Yes, it would.

Does anyone know the command line that will keep the process running, after I log off/disconnect?

You have to detach the running process from the console before you disconnect. Depending on your system there’s a number of ways of doing it.

At the simplest level, you simply spawn a separate process like this:

$ ./openLuup_reload &

If that still dies when you disconnect, then it may be that this invocation works (it does on my Debian system)

$ nohup ./openLuup_reload &

“nohup” stands for no hangup, which should give the desired effect.

The turnkey systems which @CudaNet has crafted use a different way, they create the openLuup process on system boot.

from @CudaNet’s guide: http://forum.micasaverde.com/index.php/topic,34480.msg256123.html#msg256123

Adjust startup(server) script for openLuup persistence…

/etc/cmh-ludl$ sudo nano /etc/rc.local

You will see the following:

#!/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.

Add these lines…

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

		exit 0
> IMPORTANT : 'exit 0' must NOT be removed.
> If using nano, press cntrl-o, press [enter], press cntrl-x to exit editor.

Hope this helps.

Thanks @akbooer

Regarding the OpenLuup_reload, the Linux Apitude guide I was following had the following which is slightly different and misses the ‘exit 0’ part.

Copy the below contents:
	--

	[begin below this line]

load openLuup

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

	[end above this line]</blockquote>

I’ve updated it, and have also tried your suggestions for it to run as a separate process.

root@raspberrypi:~# cd /etc/cmh-ludl root@raspberrypi:/etc/cmh-ludl# ./openLuup_reload & [1] 7826 root@raspberrypi:/etc/cmh-ludl#

Actually it doesn’t… Step 27.B has you copy and step 27.C has you pasting just above the ‘exit 0’…

Paste the contents into the PuTTY window just above 'exit 0'.

[quote=“parkerc, post:26, topic:191960”]Thanks @akbooer

Regarding the OpenLuup_reload, the Linux Apitude guide I was following had the following which is slightly different and misses the ‘exit 0’ part.

Copy the below contents:
	--

	[begin below this line]

load openLuup

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

	[end above this line]</blockquote>

I’ve updated it, and have also tried your suggestions for it to run as a separate process.

root@raspberrypi:~# cd /etc/cmh-ludl root@raspberrypi:/etc/cmh-ludl# ./openLuup_reload & [1] 7826 root@raspberrypi:/etc/cmh-ludl# [/quote]

Thanks CudaNet, it got confused as I already had some things in that file above the exit 0, see below

So should I have two ‘exit 0’ , or should there only be one, the very last thing?,

** Currently nothing OpenLuup related is working :frowning: **

# Print the IP address _IP=$(hostname -I) || true if [ "$_IP" ]; then printf "My IP address is %s\n" "$_IP" fi /usr/local/sbin/ser2net -c /etc/ser2net.conf exit 0

load openLuup

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

exit 0

The code after the first exit will not be run.

Exactly, and feel free to tweak the sleep 20 to your liking. It’s only there for rPi’s which need a bit of time to acquire network time data. If your running Raspbian Jessie you can remove (sleep 20) all together IF you have the system waiting for network on boot (see Raspbian Jessie guide). As AK indicated, remove that 1st ‘exit 0’…

# Print the IP address
_IP=$(hostname -I) || true
if [ "$_IP" ]; then
  printf "My IP address is %s\n" "$_IP"
fi
/usr/local/sbin/ser2net -c /etc/ser2net.conf

# load openLuup
sleep 20
cd /etc/cmh-ludl
./openLuup_reload

exit 0

Ok, thanks all, that Exit 0 seems to have helped things.

I’m now able to access the AltUI.

However that is still showing being ‘Oxford’ in the footer, and my location being Amsterdamn, yet I had changed that in the startup.lua. Need to work out what’s going on there…

Well, the ‘factory reset’ location is Greenwich, UK. Oxford is used in the startup example. So you can’t have dome it right. If you post your startup.lua, then we can see.

I’m not sure what to tell you, other that it is different, ( although I’d prefer not to share the exact one as it has my lon/lat and city location etc.) , but rest assured it’s not showing Oxford or Amsterdam anywhere.

Let me try a reboot of the Pi and see if that helps .

So have you explicitly set it to your location, as per the Oxford example in startup_example.lua ?

Hi, yeah, the startup.lua in etc/cmh-ludl/ has been updated, but does not seem to be doing anything to change Altui?

See extract below

do -- define top-level attributes required to personalise the installation local attr = luup.attr_set

attr (“City_description”, “London”)
attr (“Country_description”, “UNITED KINGDOM”)
attr (“KwhPrice”, “0.15”)
attr (“PK_AccessPoint”, “24710289”) – TODO: use machine serial number?
attr (“Region_description”, “England”)
attr (“TemperatureFormat”, “C”)

attr (“currency”, “?”)
attr (“date_format”, “dd/mm/yy”)

Refresh the browser and look again under the AltUI > More > Controllers menu?

Or reload the luup engine.

Have you actually ever run the startup_lua code?

[quote=“akbooer, post:36, topic:191960”]Refresh the browser and look again under the AltUI > More > Controllers menu?

Or reload the luup engine.

Have you actually ever run the startup_lua code?[/quote]

Hmm it’s very strange, a refresh of the browser and/or reload luup do not seem to do anything… Still shows Ocford and Amsterdamn.

And under More / Controllers, it does still show Ocford etc? Nit sure why it is not seeing my start up?

Doesn’t the start up.lua run when I reload/reboot etc?

[quote=“parkerc, post:37, topic:191960”]And under More / Controllers, it does still show Ocford etc? Nit sure why it is not seeing my start up?

Doesn’t the start up.lua run when I reload/reboot etc?[/quote]

As described in the guide, the startup.lua is a way of configuring a system from scratch. If you’ve never explicitly run it, as a parameter to openLuup_reload, then it’s not been run. When did you edit it to put your selections in? Have you run it since then? It is NOT run on every reload.

However, caution, if you run it now you will lose your system configuration.

The easiest way to set the top level attributes you want is to do so explicitly, on your running system, with code in the Test Lua box.

luup.attr_set ("City_description", "wherever")

Should do it. You will probably need to refresh your browser for AltUI to register the change.

Thanks @Akbooer

When you say 'if you run it now you will lose your system configuration." what does that mean exactly ? I’ve not set anything up yet ?

Meaning that the user_data.json file will be rebuilt startup. As rule of thumb, whenever installing a new plugin - backup the user_data.json file (e.g. user_data.{date_of_working_copy}) just in case. Also never stop openLuup by killing the PID, always use the id=exit within the URL… There have been incidents of people losing their .json file…

[quote=“parkerc, post:39, topic:191960”]Thanks @Akbooer

When you say 'if you run it now you will lose your system configuration." what does that mean exactly ? I’ve not set anything up yet ?[/quote]