Stokerforum

Interface => Interface til varme systemer => Emne startet af: kivi efter Jan 08, 2016, 16:42

Titel: Pellmon opdatering
Indlæg af: kivi efter Jan 08, 2016, 16:42
Jeg har nu efter lang tids tilløb taget mig sammen til at opdatere Pellmon på min Raspberry.

Det er gået fint bortset fra at min forbrugshistorie er væk, jeg synes jeg kan mindes at jeg tidligere har fået den frem igen, men husker ikke hvordan.

Jeg kan heller få ramdisk til at virke, der kommer bare en masse fejl ved opstart.

Nogen der kan hjælpe?

Titel: Sv: Pellmon opdatering
Indlæg af: motoz efter Jan 08, 2016, 17:50
Of course...

First, did you make a backup of your configuration file before installing the new version, and then move it back to /etc/pellmon/pellmon.conf  without any modifications after installing? The default configuration from a new installation is radically different, but your old config file should work as it is without any modifications at all. If you are using the new default configuration (which is split up in several files to make it easier to find stuff) and redoing your own configuration in those files then you have probably made some mistake there which need to be fixed.

The history is in the database, by default in /usr/local/var/lib/pellmon/rrd.db, or since you have been using a ramdisk the permanent database is in /usr/local/var/lib/pellmon/nvrrd.db, what errors do you get?


Titel: Sv: Pellmon opdatering
Indlæg af: kivi efter Jan 08, 2016, 18:07
Thank's motoz

Jeg har ikke brugt den gamle config file, da jeg hellere ville have den nye opdeling, men har lagt mine ændringer ind i de nye.

Vedr. ramdisk får jeg disse fejl ved opstart.

Titel: Sv: Pellmon opdatering
Indlæg af: kivi efter Jan 08, 2016, 18:10
Og det her er fra første opstart efter opdatering.

Titel: Sv: Pellmon opdatering
Indlæg af: motoz efter Jan 08, 2016, 18:36
The error 'found extra data on  update' is returned from the 'rrdtool update' command that pellmon calls to update the database. It means that your configuration does not match the database as it is defined. The rrd database is picky when updating, the update needs to contain all defined data 'columns' in the correct order as when the database was created. You need to set up the [rrd_ds_names] and [pollvalues] sections in your new configuration (conf.d/database.conf) so they are exactly the same as in the old single file.

In the second picture I see that it has created a new database in the default location as when not using a ramdisk, /usr/local/var/lib/pellmon/rrd.db, your original database should be in /usr/local/var/lib/pellmon/nvrrd.db. This is probably the reason for the mismatch.

Check that the 'database' and 'persistent_database' settings in the database.conf file matches your old file. One or both of these are wrong so it created a new database with the new standard definition that doesn't match your configuration.

To edit the files you can use the included 'pellmonconf' tool, run
Kode: [Vælg]
sudo pellmonconf on the raspberry, then you can open a nice text editor for the config files on http://<raspberryip>:8083 in your browser.

Hope this helps, just ask if you need more help.
Titel: Sv: Pellmon opdatering
Indlæg af: kivi efter Jan 08, 2016, 19:39
Can i just copy the old pellmon.conf back and use that instead.
Titel: Sv: Pellmon opdatering
Indlæg af: motoz efter Jan 08, 2016, 20:15
Yes, absolutely. I try hard to keep backwards compability while simultaneously improving things for new installs so the old config should always work.
Titel: Sv: Pellmon opdatering
Indlæg af: kivi efter Jan 08, 2016, 20:39
I just tried to use the old config and then the front page is blank but i can get into parameters.

The log file shows this.

Titel: Sv: Pellmon opdatering
Indlæg af: motoz efter Jan 08, 2016, 21:13
You probably have to add this to your config (cut from the recent default config):
Kode: [Vælg]
[frontpage_widgets]
# Select which widgets are displayed on the frontpage

#########################################
# Choose what is on the front page here #
#########################################
row_1 = systemimage,events
row_2 = graph
row_3 = consumption24h,silolevel

The contents of the frontpage is completely configurable now, this config snippet is from the default configuration and adds the stuff you probably had there. I actually don't quite remember now when I added the configurable frontpage, but your installation is probably older than that. So yes, without adding anything to [frontpage_widgets] your frontpage will be completely empty, sorry about that, it slipped my mind.
Titel: Sv: Pellmon opdatering
Indlæg af: kivi efter Jan 08, 2016, 21:22
Ahh of course.

But for now I have reinstalled the old version and everything is fine.

I will try the new one when I have some time to play again and will probably need your help again.

Thank You very much for your help and good night.
Titel: Sv: Pellmon opdatering
Indlæg af: motoz efter Jan 22, 2016, 20:25
Hello, new release of PellMon, 0.6.1.

The biggest change is that there is now a debian installation package which makes installation trivially easy https://github.com/motoz/PellMon/wiki/How%20to%20install%20PellMon. To upgrade from an old manual install from source code to the new debian package there is a procedure that has to be followed exactly, otherwise it does not work. The wiki has the instructions: https://github.com/motoz/PellMon/wiki/How%20to%20upgrade%20PellMon

In the future upgrading PellMon is as easy as downloading the newest package and simply installing it over the old with a single command.

(And I also fixed the problem you had with the frontpage, if there is no [frontpage_widgets] section at all the frontpage will be the old default one)

Titel: Sv: Pellmon opdatering
Indlæg af: kivi efter Jan 23, 2016, 08:55
Thanks, thats great news.

Can I still use the old pellmon.conf or should I use the new conf files.

Will it keep my old history on consumption and log?

Titel: Sv: Pellmon opdatering
Indlæg af: motoz efter Jan 23, 2016, 10:21
Yes, and yes. When you follow the upgrade procedure I linked to above everything will stay the same (that's the idea anyway).
Titel: Sv: Pellmon opdatering
Indlæg af: kivi efter Jan 23, 2016, 13:37
Is it possible to make a back up of the history before I try to update.
Titel: Sv: Pellmon opdatering
Indlæg af: motoz efter Jan 23, 2016, 13:53
Of course, your config file has the paths to your database file and your event log, just copy those two elsewhere. (It's a good idea to make a backup copy every now and then anyway, no memory card lasts forever).

Edit: forgot to add that the config file(s) should be included in the backup also, but the upgrade instructions involves making a copy of the config file(s) anyway. Still a good idea to keep a copy of those along with the database/event log on another drive in case the sd-card fails.


Titel: Sv: Pellmon opdatering
Indlæg af: kivi efter Jan 26, 2016, 13:54
Hi

When I try to install the new version of Pellmon with the dbian installer I get this error.

pi@raspberrypi ~ $ sudo gdebi pellmon_0.6.1-1_all.deb
Reading package lists... Done
Building dependency tree       
Reading state information... Done
Building data structures... Done
Building data structures... Done
Denne pakke kan ikke installeres
Dependency is not satisfiable: python-argcomplete

I tried to install python-argcomplete but that did not help.

Can you tell what´s causing this.
Titel: Sv: Pellmon opdatering
Indlæg af: motoz efter Jan 26, 2016, 14:46
Are you still on the old raspbian wheezy release? I moved to raspbian Jessie quite a while ago so I didn't test with the old raspbian. The obvious way to deal with it would be to move to Jessie, but that is of course a hassle.
Titel: Sv: Pellmon opdatering
Indlæg af: motoz efter Jan 26, 2016, 14:53
There are ways to force an install even if a listed dependency is missing, but I've never done that and I think it will complicate things too much. The root cause is that python-arcomplete is not available in raspbian wheezy and 'sideloading' it with pip install does not help since the package manager doesn't know of it then.
Titel: Sv: Pellmon opdatering
Indlæg af: kivi efter Jan 26, 2016, 14:57
I guess that im still on the old wheezy as I have never updated my raspberry.

I´ll take a look at that to see if I can find a way to update.

If I update to jessie, can I still keep my history, I made a backup to my pc today, can I just copy that back after an update.

Thanks.
Titel: Sv: Pellmon opdatering
Indlæg af: motoz efter Jan 26, 2016, 15:29
There is no supported way to upgrade wheezy to Jessie, so you have to do a new install, install pellmon, and then move the database, log and config file back in place. If you have a spare memory card that would be the safest of course.

I really didn't make a conscious decision to obsolete wheezy now, it's just to hard to test everything. I'll update the release note so it's clear that Jessie is required.

(You could of course just reinstall the old version, or you could install the new version from the sources instead of using the deb file)
Titel: Sv: Pellmon opdatering
Indlæg af: kivi efter Jan 26, 2016, 15:37
For now I have just reinstalled the old version, which works just fine.

So no worries  ^-^

I think I might try your tip about the spare memory card to update some day.

Thanks for your reply.

Titel: Sv: Pellmon opdatering
Indlæg af: motoz efter Jan 26, 2016, 19:49
I added a wiki page listing the files needed to not lose anything when moving to another sd-card/computer.
https://github.com/motoz/PellMon/wiki/Backup-or-Move-PellMon
Titel: Sv: Pellmon opdatering
Indlæg af: kivi efter Jan 31, 2016, 13:04
Just bought a new sd card and will try to install jessie and the new Pellmon.

I just have one question, if I want to use the new config file structure, is there anyway to keep the consumtiondata and log or will they be lost.

I know I have to ajust the new config files, but thats not a big problem.
Titel: Sv: Pellmon opdatering
Indlæg af: motoz efter Jan 31, 2016, 13:42
The config file structure is completely arbitrary.  Pellmon only looks at one configuration file, whose path is given as a command line argument when pellmon is started. This is normally /etc/pellmon/pellmon.conf. That file can contain the whole configuration, or it can contain the 'configdir' directive which gives a path to additional configuration files to read. Every file with an extension of '.conf' in the 'configdir' path will be read, and if it contains subdirecories they will also be (recursively) searched for config files. When every .config file is read their contents are merged into one configuration. This means that you could split up your configuration in any way you like and the end result is exactly the same as when everything is in one file.

Long story short, to keep your old history data you copy over your old database and logfile, and make sure the configuration for the database is exactly as it was before.

If you use the new config file structure and move bits and pieces from your old config into the new files you have to make sure you end up with everything the same, then it will work. The really important sections are [rrd_ds_names], [rrd_ds_types] and [pollvalues].  A 'section' in a config file starts with the name of the section in square brackets and ends when the next section starts or when the file ends. They either all have to be exactly the same as before, or you really have to know what you are doing...
Titel: Sv: Pellmon opdatering
Indlæg af: kivi efter Jan 31, 2016, 14:50
Thanks.

Btw is there an easy way to uninstall when I have used the deb installer?
Titel: Sv: Pellmon opdatering
Indlæg af: motoz efter Jan 31, 2016, 14:56
Yes,

Uninstall:
Kode: [Vælg]
sudo dpkg -r pellmon
Uninstall and also remove configuration files, database and event log (use with caution):
Kode: [Vælg]
sudo dpkg --purge pellmon
Titel: Sv: Pellmon opdatering
Indlæg af: khe efter Jul 29, 2016, 16:32
Hi Motoz!

Hope you are enjoying summertime  ;)

I'm preparing for next season, and decided to update my Pi to Weezy and Pellmon 0.6.1, and got it all up and running, except from the database with consumption log - is it possible to transfer it to the new version?

I have copied  RRD database from the old install: /usr/local/var/lib/pellmon/rrd.db to the new install: /var/lib/pellmon/rrd.db - do I miss some point of config setup or so, to get it to work?

I have followed the description in your Wiki here: https://github.com/motoz/PellMon/wiki/Backup-or-Move-PellMon

Thanks in advance - Kristian.
Titel: Sv: Pellmon opdatering
Indlæg af: motoz efter Jul 29, 2016, 18:02
Hello Kristian,

I suppose you did not move your old configuration file over to the new install then? If you do that everything should work without any changes. Or if you did move the configuration file, your database file is still in the same place as before since the path to the database is set in the configuration. If you have the database in the wrong place according to your config you should get a line in the event log saying that pellmon has created a new (empty) database.

If you want to use the new 'default configuration' that is split up in several files then you have to make some changes to it since the default configuration for the database setup has changed (probably, I don't remember when I changed it or when you installed...). Look in the file conf.d/database.conf and make sure you edit it to match the same sectiones in your old configuration, mainly the section [rrd_ds_names] must be exactly as in your old config. Then look in the event log when you restart, there should be some clues to what's wrong if you don't get it right in the first try.

Titel: Sv: Pellmon opdatering
Indlæg af: khe efter Aug 02, 2016, 17:16
Oh, that makes sense, because I did move the old config files over to the new installation, but in the directories described for the new installation, and not in the same places as the old installation. I will look at it as soon as I get the time  ;)


Thank You for quick reply, and sorry for double posting in different treds, but it seems like the system wouldnt accept my post in this tread at the first, so I posted in the other tread we used before...