Side 10 af 14

Raspberry Pi

: 23 dec 2013 21:04
af Juel
Nice, i havent tried the other news yet, im still makeing the Whole wiresystem in the house.. Im using the DS18B20 sensors for temperature monitoring :)

Raspberry Pi

: 02 jan 2014 08:52
af motoz
New year, new (optional) PellMon feature: graphical view of pellet silo level:
Billede
Billede
Calculated from the 'silo fill up date' to current time, by subtracting consumption from the set 'silo fill up level'. Fill up time is automatically set when writing the 'silo fill up level' parameter, but can be changed afterwards.

Raspberry Pi

: 16 feb 2014 15:54
af motoz
Latest updates to PellMon:

The RaspberryGPIO plugin now makes it possible to easily use all I/O pins of the raspberry as inputs / outputs / counters. There is also a special input mode called latched_input, that causes an input to read as active one time if it has been briefly activated since it was read last time. This makes sure inputs are not missed when using slow polling. There is also a 'tachometer' mode that can be used for accurate rpm measurement up to 5000rpm, for instance for measuring and logging of the blower speed. Ideal for monitoring what the oxygen controller (lambda) is up to...
Billede
The Calculate plugin has been updated with new syntax, lots of new instructions, if..then..[else]..end statement, local and global variables, execution when reading or writing the connected dataitem, cyclical execution and descriptive error messages in the log. All in all this makes it possible to implement almost any functionality, and in combination with onewire sensors and RaspberryGPIO this means that there are an unlimited number of sensors an 17 freely programmable I/O's available for any imaginable feature. For instance add 10 temperature sensors and show (and log) minimum, maximum and average, add any sort of filtering to a sensor reading, control the circulation pump, make your own weather compensation, add a big button next to the pellet silo that resets the silo level when pressed, or add 20 kg each time pressed, calculate solar panel power from flow-counter and temperature diff and so on...

Silly example, flash an alarm light connected to pin 16 at 1Hz if the boiler temperature is above 90 degrees:

[plugin_RaspberryGPIO]
gpio23_function = output
gpio23_item = out
gpio23_pin = 16

[plugin_Calculate]
blink_prog = if boiler_temp get 90 > then out get 0 1 ? out set end
blink_taskcycle = 0.5

and by adding:
blink_progtype = R/W
the 'blink_prog' item holding the script becomes a read/write item, meaning that it can be edited in the parameters view of the webinterface.

Raspberry Pi

: 02 mar 2014 09:47
af motoz
The PellMon demo at http://motoz.pythonanywhere.com/ is now up to date with the newest version.

Raspberry Pi

: 18 mar 2014 20:07
af Juel
Cool! how do I upgrade without deleting my data and settings?

Raspberry Pi

: 19 mar 2014 08:28
af Juel
Hi motoz im having a problem with the scotte protocol :/

Im getting this error after maybe 1 minute or maybe 10 minutes. Then the program stalls and nothing Works :/

Traceback (most recent call last):
File "/home/pi/HeatController.py", line 237, in <module>
BoilerMode()
File "/home/pi/HeatController.py", line 239, in BoilerMode
Bmode = p.getItem('mode')
File "/home/pi/protocol.py", line 128, in getItem
raise IOError(0, "GetItem failed")
IOError: [Errno 0] GetItem failed

My pi setup is: im running Pellmon, and then this program. Is it becurse both programs are talking to the Boiler at the same time?

My script is here if you want to have a look ;) http://starchild.dk/temp/pi.zip

The first version of the script have been running without any errors when i use the p.setItem('boiler_temp_set', '70') command.

but when i start using the p.getItem('mode'), then it stalls with the error from above..

Can you help me?

Kind regards
Morten

Raspberry Pi

: 19 mar 2014 08:38
af motoz
The safe way to upgrade is to:

1. Take a copy of the settings file /etc/pellmon/pellmon.conf
2. Remove the old installation by executing 'sudo make uninstall' from the old source checkout.
3. Download, unzip the new version (or 'git pull origin master' if you have cloned the repository)
4. Check that you have all listed dependencies installed, there might be additions.
5. Follow 'system installation'
6. Open the new configuration file /etc/pellmon/pellmon.conf and compare it to the saved copy of your configuration. Sometimes quite a lot happens in the configuration file, so it's best to use the new one and transfer your configurations to the new one from the copy, but when there are no new additions you can just move your copy back in place.

Step 2 can most often safely be skipped, it's just to make sure that when an installed file has been renamed/moved/deleted the old one won't be left on the system.

Step 1 is really important, because the new installation will overwrite the old configuration and you don't want to lose that.

The database and log file won't be touched by a new installation (or removed by uninstall)

(Just realized that this should be on the wiki so I added it here https://github.com/motoz/PellMon/wiki/H ... %20PellMon)

Raspberry Pi

: 19 mar 2014 08:55
af Juel
Cool thanks, im gonna try that in the weekend :) Any input on the IOError: [Errno 0] GetItem failed issue?

Kind regards
Morten

Raspberry Pi

: 19 mar 2014 09:16
af motoz
You really shouldn't open ttyUSB0 from several programs at the same time. Surprisingly linux allows you to do that, but then there is no one preventing the two programs corrupting the data transfers by reading/writing at the same time. I designed pellmonsrv to be the mediator that owns the serial bus, then you can use it's dbus interface to read/write and the server will queue up and serialize requests from several clients. If you don't want to deal with dbus (it's a bit complicated but pellmoncli.py shows how it can be done) then you can just use python's os interface to call out the installed pellmoncli command line client and parse the result from stdout.
Like this:
import subprocess
proc = subprocess.Popen(['pellmoncli.py', 'get', 'mode'], stdout=subprocess.PIPE)
(out, err) = proc.communicate()
print 'Boiler mode:', out

The third option would be to shut down pellmonsrv, but what's the fun in that...

Hope this helps. Thanks for sharing your program, and I'm glad that you found PellMon useful. Maybe you could check out the OWFS plugin. Combined with RaspberryGPIO and Calculate, PellMon could possibly do what you need by itself, but there is of course a limit to what can be sanely expressed by the 'calculate' scripts and then again what's the fun in that when you can make your own program!

Then there is also the option of converting your program to a pellmon plugin. An just thinking out loud here... a plugin that outputs to a sql database would probably be useful.

Raspberry Pi

: 19 mar 2014 09:27
af motoz
I should add that the precise reason why it fails when you added BoilerMode() would be that then you are accessing the serial bus every 30s, before that only when the burner needed to be started/shut off so the probability of collisions are much higher.