gulliverrr
Posts: 38
Joined: Wed Jan 02, 2013 1:38 pm

Re: Wifi Internet Boiler

Sun Feb 03, 2013 11:24 pm

Before updating to the new code I had the Raspi run for 4 days and I couldn't make it crash once!
Its always like that when you want it to crash :)

Will be updating the code now to the latest version and let you know of any issues.

gulliverrr
Posts: 38
Joined: Wed Jan 02, 2013 1:38 pm

Re: Wifi Internet Boiler

Mon Feb 04, 2013 8:22 pm

Hey there,

please note 3 mistakes in the instructions on git and the README.md inside the master.zip on the java side.

1. Please change this line:
sudo mv boiler-control-master/scripts/boilercontrol/* /etc/init.d/
to this:
sudo mv boiler-control-master/scripts/init.d/boilercontrol /etc/init.d/

2. Run this before trying to edit the ControlBroker.java and compiling:
sudo mv boiler-control-master/src/* /opt/boilercontrol/

3. And change this line:
uk/co/uk/jaynne/datasource/DbConfig.java
to this:
/opt/boilercontrol/uk/co/jaynne/datasource/DbConfig.java

After compiling and running I get again the same error with the boosts turning on and off like crazy all the time... I guess I need to change my button's wiring as you suggested before.

fruitloaf
Posts: 84
Joined: Sun Feb 05, 2012 11:41 am

Re: Wifi Internet Boiler

Mon Feb 04, 2013 8:41 pm

Thanks I've updated the documentation. If you're using the latest version then the pin state is now configurable from the database.
In the database there is a field in the configuration table (if you've installed phpmyadmin you can edit it online by visiting http://<pis ipaddress>/phpmyadmin). You need a field pinsHigh of type boolean. A value of false means your buttons are low (0V) when pressed, true means they are high.
Also I seem to be having much better success with the screen not garbling characters with the timing changes I made. Give it a shot and let me know if it works for you.

gulliverrr
Posts: 38
Joined: Wed Jan 02, 2013 1:38 pm

Re: Wifi Internet Boiler

Tue Feb 05, 2013 12:00 am

I did change the wiring to the upper schematic as you had suggested before (normal high is better-you were right :idea: ):
Image

I dont see garbled text (yet) but I am sure it was java crashing while writing on the screen.
I found the crash logs I was saying before. They are here:
/opt/boilercontrol/
in the form of
hs_err_pid<xxxx>.log
where <xxxx> is the process id java had when crashed

A brief look through the tracing information and I find traces of:
uk.co.jaynne.lcd.LcdDisplay.write
being one of the last calls in the stack. Anyway... let me run it a few days and report back. top now reports 14-20% cpu. Much better! Well done ;)

Will try to add the backlight functionality without messing up your code and leave both heating and hotwater there so that the backlight of the screen stays on for x seconds after the last time you pressed any button.

Im so tempted to move the 2 current statuses (not the boost status but the current) to 2 LEDs off the screen to make some space and show the remaining time of each boost. Not sure if they can still fit...

fruitloaf
Posts: 84
Joined: Sun Feb 05, 2012 11:41 am

Re: Wifi Internet Boiler

Tue Feb 05, 2013 8:19 am

If you do want to add status LEDs then I'd suggest you fork the project on github so the changes can later be merged in. If you use BoostMonitor.java as a template you could have the LEDs running in a few minutes. You launch the threads in BoilerControl.java (look at the BoostMonitor lines for how to do it).

What you might want to do (and I've been meaning to do this for a while but haven't had the time) is create a couple of values in the configuration database for controlHeating and controlWater as booleans. Then you can check those values and only launch boost monitors for the services you want to use (heating only presumably if you have a combi boiler). That can also be checked on the front end easily to only show the right controls. This would save you having to merge any changes you make every time I do an update.

dkoukoul
Posts: 4
Joined: Thu May 23, 2013 10:37 am

Re: Wifi Internet Boiler

Thu May 23, 2013 10:41 am

Hi guys, and well done on the great work.
I have followed your instructions with a small change, I installed the jdk7u10 version instead of the 7u6 that you are referring to in github.
That shouldn't be causing the problem I have...
Trying to run the compile and run give me the following error:
Compiling
Done, running
piBoardRev: Unable to determine board revision from 0
#
# A fatal error has been detected by the Java Runtime Environment:
#
# SIGSEGV (0xb) at pc=0x4cd5e814, pid=2607, tid=1075119216
#
# JRE version: 7.0_10-b18
# Java VM: Java HotSpot(TM) Client VM (23.6-b04 mixed mode linux-arm )
# Problematic frame:
# C [libpi4j.so+0x5814] wpiPinToGpio+0xc
#
# Failed to write core dump. Core dumps have been disabled. To enable core dumping, try "ulimit -c unlimited" before starting Java again
#
# An error report file with more information is saved as:
# /opt/boilercontrol/hs_err_pid2607.log
#
# If you would like to submit a bug report, please visit:
# http://bugreport.sun.com/bugreport/crash.jsp
# The crash happened outside the Java Virtual Machine in native code.
# See problematic frame for where to report the bug.
#
./compileandrun.sh: line 9: 2607 Aborted java -cp $LIBS uk/co/jaynne/BoilerControl
Any ideas, clues as to what it may be causing this?

User avatar
xranby
Posts: 539
Joined: Sat Mar 03, 2012 10:02 pm
Contact: Website

Re: Wifi Internet Boiler

Thu May 23, 2013 12:13 pm

dkoukoul wrote: Trying to run the compile and run give me the following error:
Compiling
Done, running
piBoardRev: Unable to determine board revision from 0
#
# A fatal error has been detected by the Java Runtime Environment:
...
# Problematic frame:
# C [libpi4j.so+0x5814] wpiPinToGpio+0xc
#
...
Any ideas, clues as to what it may be causing this?
Pi4j internally uses the wiringpi library:
https://projects.drogon.net/raspberry-pi/wiringpi/

Take a look at the misc. functions:
https://projects.drogon.net/raspberry-p ... functions/
in your case wiringpi piBoardRev() returns an invalid value instead of 1 or 2.
The invalid value confuses the wiringpi wpiPinToGpio function "This returns the BCM_GPIO pin number of the supplied wiringPi pin. It takes the board revision into account." For some reason this wiringpi wpiPinToGpio C function crashes when running on your raspberry pi board.

I would suggest you to try figure out and fix wiringpi to return a valid board revision for you raspberry pi board.
The latest wiring pi source-code is available from gordon's server:
git clone git://git.drogon.net/wiringPi

You can enable extra wiringpi debug output by setting the WIRINGPI_DEBUG environment variable.

You also need to look at the content of /proc/cpuinfo
most likely your board reports an incorrect revision value of 0000 (a fault by the manufacturer)
good news is that this is fixable by editing your systems config.txt
http://www.raspberrypi.org/phpBB3/viewt ... p?p=184410
http://www.raspberrypi.org/phpBB3/viewt ... 10#p184410
Xerxes Rånby @xranby I once had two, then I gave one away. Now both are in use every day!
twitter.com/xranby

dkoukoul
Posts: 4
Joined: Thu May 23, 2013 10:37 am

Re: Wifi Internet Boiler

Thu May 23, 2013 6:39 pm

Thanks for the reply,
I tried the solution with editing the program_board_rev=2 in the config.txt but I still get the same error :(
I will look into the wiringpi to see if I get any more information about what's going on...

dkoukoul
Posts: 4
Joined: Thu May 23, 2013 10:37 am

Re: Wifi Internet Boiler

Thu May 23, 2013 8:45 pm

So I did a few more things...
I downloaded and compiled the latest wiringPi code and gpio and pintest commands run fine showing that they recognise that my Raspi is a Rev2.
The problem though at trying to run the compileandrun.sh remains the same...
if it help the cpuinfo reports Revision 000e which is the correct Model B Rev2 by Sony [http://elinux.org/RPi_HardwareHistory]
Could it be something wrong with the libpi4j?

fruitloaf
Posts: 84
Joined: Sun Feb 05, 2012 11:41 am

Re: Wifi Internet Boiler

Thu May 23, 2013 8:54 pm

dkoukoul wrote:So I did a few more things...
I downloaded and compiled the latest wiringPi code and gpio and pintest commands run fine showing that they recognise that my Raspi is a Rev2.
The problem though at trying to run the compileandrun.sh remains the same...
if it help the cpuinfo reports Revision 000e which is the correct Model B Rev2 by Sony [http://elinux.org/RPi_HardwareHistory]
Could it be something wrong with the libpi4j?
It's quite likely, the bundled pi4j is quite old being version 0.0.2 and was written I think before the 512MB v2 boards were out. You can upgrade the pi4j version but I believe the api changed a bit in the 0.0.3 version so YMMV. Unfortunately I don't have anything but original version boards to test with.

I'm afraid I don't have the time just now to experiment with the new pi4j version but any changes due to the new version should only need to be made in one file GpioControlPi4J.java in the gpio folder. You can also switch to a couple of alternative gpio control methods (framboos and gpiojava) however they are both as old as pi4j I'm afraid.

dkoukoul
Posts: 4
Joined: Thu May 23, 2013 10:37 am

Re: Wifi Internet Boiler

Thu May 23, 2013 9:46 pm

fruitloaf wrote:
dkoukoul wrote:So I did a few more things...
I downloaded and compiled the latest wiringPi code and gpio and pintest commands run fine showing that they recognise that my Raspi is a Rev2.
The problem though at trying to run the compileandrun.sh remains the same...
if it help the cpuinfo reports Revision 000e which is the correct Model B Rev2 by Sony [http://elinux.org/RPi_HardwareHistory]
Could it be something wrong with the libpi4j?
It's quite likely, the bundled pi4j is quite old being version 0.0.2 and was written I think before the 512MB v2 boards were out. You can upgrade the pi4j version but I believe the api changed a bit in the 0.0.3 version so YMMV. Unfortunately I don't have anything but original version boards to test with.

I'm afraid I don't have the time just now to experiment with the new pi4j version but any changes due to the new version should only need to be made in one file GpioControlPi4J.java in the gpio folder. You can also switch to a couple of alternative gpio control methods (framboos and gpiojava) however they are both as old as pi4j I'm afraid.
So yes this seams to be the problem... I removed the pi4j-core-0.0.2....jar files you were using and updated them with the 0.0.5 core files http://pi4j.com/install.html
I don't get the piboardRev error anymore but I am getting a lot of errors from GpioControlPi4j I will try to solve them and when done I'll let you know. Thanks

kendler
Posts: 3
Joined: Tue Sep 02, 2014 12:39 pm

Re: Wifi Internet Boiler

Tue Sep 02, 2014 12:43 pm

Hi,
I can't get the LCD to work on a model B pi

gulliverrr
Posts: 38
Joined: Wed Jan 02, 2013 1:38 pm

Re: Wifi Internet Boiler

Tue Sep 02, 2014 2:48 pm

Hi,
does this mean that it works ok in RasPi Model A?

kendler
Posts: 3
Joined: Tue Sep 02, 2014 12:39 pm

Re: Wifi Internet Boiler

Sun Nov 02, 2014 5:45 pm

I don't know - I only have the model B.

gulliverrr
Posts: 38
Joined: Wed Jan 02, 2013 1:38 pm

Re: Wifi Internet Boiler

Sun Nov 02, 2014 6:39 pm

What does it do exactly? What do you see on the LCD? What do you see from the terminal?

doroninbgu
Posts: 1
Joined: Tue Apr 14, 2015 9:32 am

Re: Wifi Internet Boiler

Tue Apr 14, 2015 9:36 am

hi there

is this fits to when my boiler is inside the water tank at my roof (outside my house) and inside i only have 220v connectors to on\off switch ?

thanks

gulliverrr
Posts: 38
Joined: Wed Jan 02, 2013 1:38 pm

Re: Wifi Internet Boiler

Tue Apr 14, 2015 11:33 am

There is a small PCB that fits on the Raspberry Pi and controls the relays and the buttons. You will need to do the wiring yourself or get a professional electrician if you are not sure. I will PM you with the info

Return to “Automation, sensing and robotics”