Har du lyst til at støtte Stoker Pro? Læs mere her: Støt Stoker Pro Forum

Raspberry Pi

Spørgsmål vedr. Woody samt det tilbehør der laves til Woody pillefyret
Besvar
Brugeravatar
motoz
Stoker IV
Stoker IV
Indlæg: 124
Tilmeldt: 14 feb 2013 08:06
Mit fyr: BioComfort 30kW + termax 25cr
Geografisk sted: Ostrobothnia
Modtaget likes: 11 gange
Kontakt:

Raspberry Pi

Indlæg af motoz » 03 mar 2013 13:25

Hi Peter,
I've been busy lately so I only found time to check out your work just now. Looks very good and just works so I pulled it.
The auth.py module is copied from the cherrypy wiki, I guess that the login and logout page handlers can be moved to pellmonwebb.py (really should rename that... somehow I managed to spell web wrong..) and make a mako template out of get_loginform. By the way, I didn't really choose mako because of some preference of mine or any technical quality, but rather since I am completely new to web development I figured it was a waste of time to even try to evaluate the numerous options there seems to be so I just used the first one mentioned here http://docs.cherrypy.org/stable/proggui ... plate.html... If you wish feel free to use any other. And if you feel that cherrypy is crippling you I would be open to scrapping that also, it was a really neat way to get started for a web noob like me, but I wouldn't want you to feel forced to work with it.

Steen, what do you think about adding an optional item to the config file, eg. 'persistent-db = /path/to/persistent-db', when that's present the server copies the file pointed by it over the database at startup, and copies it back at a regular (configurable) interval, and also on shutdown. Ie. just like your scripts but easier to set up. Then the user would be free to add a ramdisk and set the database to point there and set persistent-db to a location on the sd-card. I wouldn't want it to be a requirement to know how to set up a ramdisk.

/AN
PellMon open source pellet logger at https://github.com/motoz/PellMon


Brugeravatar
motoz
Stoker IV
Stoker IV
Indlæg: 124
Tilmeldt: 14 feb 2013 08:06
Mit fyr: BioComfort 30kW + termax 25cr
Geografisk sted: Ostrobothnia
Modtaget likes: 11 gange
Kontakt:

Raspberry Pi

Indlæg af motoz » 03 mar 2013 20:17

Just pushed a version with support for rrd db in ramdisk, pretty much as described above.
PellMon open source pellet logger at https://github.com/motoz/PellMon

peterfarsinsen
Stoker V
Stoker V
Indlæg: 167
Tilmeldt: 30 jan 2012 21:22
Mit fyr: Woody 10kw
Areal: 165
Brændsel: Træpiller
Fremviser gerne i postnummer: 9280
Årligt forbrug: ~6 ton
Geografisk sted: Sejlflod, Nordjylland

Raspberry Pi

Indlæg af peterfarsinsen » 03 mar 2013 21:45

Hi

Both MAKO and Cherrypy seems good choices to me. I have been programming PHP for some years now, so it's really just a question of learning a new language and new frameworks. Lets stick to these until there is a reason to switch ;)

Maybe I'll have a go at moving the page handlers to pellmonwebb.py if I find the time. There are some concepts that I have a hard time understanding. Not really sure if it's Python or Cherrypy :P

Anyhow, I broke something:

Kode: Vælg alt

pi@raspberrypi ~/PellMon $ ./pellmonwebb.py start
Traceback (most recent call last):
  File "./pellmonwebb.py", line 234, in <module>
    pelletService = bus.get_object('org.pellmon.int', '/org/pellmon/int')
  File "/usr/lib/python2.7/dist-packages/dbus/bus.py", line 241, in get_object
    follow_name_owner_changes=follow_name_owner_changes)
  File "/usr/lib/python2.7/dist-packages/dbus/proxies.py", line 248, in __init__
    self._named_service = conn.activate_name_owner(bus_name)
  File "/usr/lib/python2.7/dist-packages/dbus/bus.py", line 180, in activate_name_owner
    self.start_service_by_name(bus_name)
  File "/usr/lib/python2.7/dist-packages/dbus/bus.py", line 278, in start_service_by_name
    'su', (bus_name, flags)))
  File "/usr/lib/python2.7/dist-packages/dbus/connection.py", line 651, in call_blocking
    message, timeout)
dbus.exceptions.DBusException: org.freedesktop.DBus.Error.ServiceUnknown: The name org.pellmon.int was not provided by any .service files
I'm running the latest version from GitHub, and I didn't change anything on my system. Any idea what's going on?
Woody 10Kw, BS20, etc., etc.
http://peterfarsinsen.stokerlog.dk

sandr
Stoker I
Stoker I
Indlæg: 16
Tilmeldt: 26 jul 2012 21:53

Raspberry Pi

Indlæg af sandr » 03 mar 2013 23:05

Undskyld det manglende svar på om jeg kan lave en beskrivelse af opsætning mht RRD-databasen i ramdisk.
Jeg skal få den lavet snarest

Amnd for Anders ;-)
Sorry for my late reply regarding the RRD-db in ramdisk.
I'll make a description soon

BR
Steen

Brugeravatar
motoz
Stoker IV
Stoker IV
Indlæg: 124
Tilmeldt: 14 feb 2013 08:06
Mit fyr: BioComfort 30kW + termax 25cr
Geografisk sted: Ostrobothnia
Modtaget likes: 11 gange
Kontakt:

Raspberry Pi

Indlæg af motoz » 04 mar 2013 06:43

seems as pellmonsrv isn't running, maybe it crashed. Did you try the previous version?
PellMon open source pellet logger at https://github.com/motoz/PellMon


Brugeravatar
motoz
Stoker IV
Stoker IV
Indlæg: 124
Tilmeldt: 14 feb 2013 08:06
Mit fyr: BioComfort 30kW + termax 25cr
Geografisk sted: Ostrobothnia
Modtaget likes: 11 gange
Kontakt:

Raspberry Pi

Indlæg af motoz » 04 mar 2013 09:04

I tested it again with the git version, I can only reproduce the error by shutting off pellmonsrv myself.
Btw, it seems as autorefresh is always running regardless of the state of the button. I think it has to do with this:
if($('input[name="autorefresh"]').val() != '') {
startImageRefresh();
It runs on page load even as the button state is off. When pressing the button a new timer is created, so I think the reason is that there is now one timer running with the button off, and two timers running with the button on.

Edit: Just found this: http://view.jquerymobile.com/1.3.0/docs ... -demo.html
I think such a floating linkbar at the right would be great for navigating in the parameter view, would that be possible?
PellMon open source pellet logger at https://github.com/motoz/PellMon

peterfarsinsen
Stoker V
Stoker V
Indlæg: 167
Tilmeldt: 30 jan 2012 21:22
Mit fyr: Woody 10kw
Areal: 165
Brændsel: Træpiller
Fremviser gerne i postnummer: 9280
Årligt forbrug: ~6 ton
Geografisk sted: Sejlflod, Nordjylland

Raspberry Pi

Indlæg af peterfarsinsen » 05 mar 2013 18:00

Hi

Fixed in this commit: https://github.com/peterfarsinsen/PellM ... 783322fb30

Maybe we should add an ajax handler for the autorefresh button? I only noticed it now, but since I made it a button it's not in any way clear that it's submitted by the lines form :)

I like the plugin you've found, but a ton of things could be done to the params page: grouping them, client side validation, hiding the 'set' button for non writable values. Etc. maybe we should start a brainstorm somewhere?
Woody 10Kw, BS20, etc., etc.
http://peterfarsinsen.stokerlog.dk

sandr
Stoker I
Stoker I
Indlæg: 16
Tilmeldt: 26 jul 2012 21:53

Raspberry Pi

Indlæg af sandr » 08 mar 2013 10:25

Hi Anders.

Would it be possible to have a file written with the latest data read every time a request is received?
Such a simple file is very usefull for displaying latest values on a webpage since it's very easy to parse a simple file, instead of having to extract latest data from the rrd-databases

BR
Steen

Brugeravatar
motoz
Stoker IV
Stoker IV
Indlæg: 124
Tilmeldt: 14 feb 2013 08:06
Mit fyr: BioComfort 30kW + termax 25cr
Geografisk sted: Ostrobothnia
Modtaget likes: 11 gange
Kontakt:

Raspberry Pi

Indlæg af motoz » 08 mar 2013 14:03

How about I add command line argument parsing to the client program? Then you can call eg.

Kode: Vælg alt

pellmoncli.py get boiler_temp >> file.txt 
in a script to get fresh readings.
PellMon open source pellet logger at https://github.com/motoz/PellMon

sandr
Stoker I
Stoker I
Indlæg: 16
Tilmeldt: 26 jul 2012 21:53

Raspberry Pi

Indlæg af sandr » 08 mar 2013 15:02

Both would be nice ;-)


Besvar