Opentherm on Z-Uno

Discussion about Z-Uno product. Visit http://z-uno.z-wave.me for more details.
Post Reply
rrozema
Posts: 13
Joined: 07 Jun 2018 12:45

Opentherm on Z-Uno

Post by rrozema » 10 Dec 2018 00:57

Hi all, I've set myself an ambitious goal: I want to build myself an opentherm controller that communicates via Z-wave with the thermostats in each of my house's rooms, then controls my boiler via opentherm according the heat requested by those thermostats/ The components I've selected for my project: OpenTherm library wasn't written for Z-Uno, nor was the controller designed for Z-Uno's 3.3V. But these should not be to difficult to adjust. Or so I thought: I've been trying to get OpenTherm library to compile all day already. There are multiple issues, but the most annoying one is one that should be really simple: the latest arduino IDE (1.8.8) doesn't find the OpenTherm.h file and crashes, even if I only include the required opentherm.h in a further empty sketch.
The sketch:

Code: Select all

#include "OpenTherm.h"

void setup() {
  // put your setup code here, to run once:
}

void loop() {
  // put your main code here, to run repeatedly:
}
And the ouput I get:

Code: Select all

C:\Program Files (x86)\Arduino\arduino-builder -dump-prefs -logger=machine -hardware C:\Program Files (x86)\Arduino\hardware -hardware C:\Users\user\AppData\Local\Arduino15\packages -tools C:\Program Files (x86)\Arduino\tools-builder -tools C:\Program Files (x86)\Arduino\hardware\tools\avr -tools C:\Users\user\AppData\Local\Arduino15\packages -built-in-libraries C:\Program Files (x86)\Arduino\libraries -libraries U:\Mijn Documenten\Arduino\libraries -fqbn=Z-Uno:zw8051:zuno:Frequency=Eu,Security=Off,MuliCommand=On,LogOutput=UART0,NVMClean=Off -ide-version=10808 -build-path C:\Users\user\AppData\Local\Temp\arduino_build_190951 -warnings=default -build-cache C:\Users\user\AppData\Local\Temp\arduino_cache_709302 -prefs=build.warn_data_percentage=75 -prefs=runtime.tools.zuno_toolchain.path=C:\Users\user\AppData\Local\Arduino15\packages\Z-Uno\tools\zuno_toolchain\00.08.70 -prefs=runtime.tools.zuno_toolchain-00.08.70.path=C:\Users\user\AppData\Local\Arduino15\packages\Z-Uno\tools\zuno_toolchain\00.08.70 -verbose C:\Users\user\AppData\Local\Temp\arduino_modified_sketch_172866\sketch_dec09a.ino
C:\Program Files (x86)\Arduino\arduino-builder -compile -logger=machine -hardware C:\Program Files (x86)\Arduino\hardware -hardware C:\Users\user\AppData\Local\Arduino15\packages -tools C:\Program Files (x86)\Arduino\tools-builder -tools C:\Program Files (x86)\Arduino\hardware\tools\avr -tools C:\Users\user\AppData\Local\Arduino15\packages -built-in-libraries C:\Program Files (x86)\Arduino\libraries -libraries U:\Mijn Documenten\Arduino\libraries -fqbn=Z-Uno:zw8051:zuno:Frequency=Eu,Security=Off,MuliCommand=On,LogOutput=UART0,NVMClean=Off -ide-version=10808 -build-path C:\Users\user\AppData\Local\Temp\arduino_build_190951 -warnings=default -build-cache C:\Users\user\AppData\Local\Temp\arduino_cache_709302 -prefs=build.warn_data_percentage=75 -prefs=runtime.tools.zuno_toolchain.path=C:\Users\user\AppData\Local\Arduino15\packages\Z-Uno\tools\zuno_toolchain\00.08.70 -prefs=runtime.tools.zuno_toolchain-00.08.70.path=C:\Users\user\AppData\Local\Arduino15\packages\Z-Uno\tools\zuno_toolchain\00.08.70 -verbose C:\Users\user\AppData\Local\Temp\arduino_modified_sketch_172866\sketch_dec09a.ino
Using board 'zuno' from platform in folder: C:\Users\user\AppData\Local\Arduino15\packages\Z-Uno\hardware\zw8051\2.1.4
Using core 'zuno' from platform in folder: C:\Users\user\AppData\Local\Arduino15\packages\Z-Uno\hardware\zw8051\2.1.4
Detecting libraries used...
"C:\\Users\\user\\AppData\\Local\\Arduino15\\packages\\Z-Uno\\tools\\zuno_toolchain\\00.08.70/zuno_toolchain/compiler" arduino_preproc "C:\\Users\\user\\AppData\\Local\\Temp\\arduino_build_190951\\sketch\\sketch_dec09a.ino.cpp" -r "C:\\Users\\user\\AppData\\Local\\Arduino15\\packages\\Z-Uno\\hardware\\zw8051\\2.1.4"
C:\Users\user\AppData\Local\Temp\arduino_build_190951

Found 1.8.x project structure (File:sketch_dec09a.ino.cpp). Converting it...

           

Generating function prototypes...
"C:\\Users\\user\\AppData\\Local\\Arduino15\\packages\\Z-Uno\\tools\\zuno_toolchain\\00.08.70/zuno_toolchain/compiler" arduino_preproc "C:\\Users\\user\\AppData\\Local\\Temp\\arduino_build_190951\\sketch\\sketch_dec09a.ino.cpp" -r "C:\\Users\\user\\AppData\\Local\\Arduino15\\packages\\Z-Uno\\hardware\\zw8051\\2.1.4"
C:\Users\user\AppData\Local\Temp\arduino_build_190951

Found 1.8.x project structure (File:sketch_dec09a.ino.cpp). Converting it...

           

"C:\\Program Files (x86)\\Arduino\\tools-builder\\ctags\\5.8-arduino11/ctags" -u --language-force=c++ -f - --c++-kinds=svpf --fields=KSTtzns --line-directives "C:\\Users\\user\\AppData\\Local\\Temp\\arduino_build_190951\\preproc\\ctags_target_for_gcc_minus_e.cpp"
Sketch aan het compileren...
"C:\\Users\\user\\AppData\\Local\\Arduino15\\packages\\Z-Uno\\tools\\zuno_toolchain\\00.08.70/zuno_toolchain/compiler" build "C:\\Users\\user\\AppData\\Local\\Temp\\arduino_build_190951/sketch_dec09a.ino" -r "C:\\Users\\user\\AppData\\Local\\Arduino15\\packages\\Z-Uno\\hardware\\zw8051\\2.1.4" -i1_8 -idv 10808


	************* Building Arduino Sketch *************

	C:\Users\user\AppData\Local\Temp\arduino_build_190951/sketch_dec09a.ino

	***************************************************



	 --- USING a list of libraries from:

		C:\Users\user\AppData\Local\Arduino15\packages\Z-Uno\hardware\zw8051\2.1.4\libraries

		U:\Mijn Documenten\Arduino\libraries

	*** Collecting prototypes...

Preprocessing file: C:\Users\user\AppData\Local\Temp\arduino_build_190951\Custom.c with SDCPP... 



Preprocessing file: C:\Users\user\AppData\Local\Temp\arduino_build_190951\Print.cpp with SDCPP... 

Compiling C:\Users\user\AppData\Local\Temp\arduino_build_190951\Print_sdcpp_.cpp ...

Preprocessing file: C:\Users\user\AppData\Local\Temp\arduino_build_190951\Stream.cpp with SDCPP... 

Compiling C:\Users\user\AppData\Local\Temp\arduino_build_190951\Stream_sdcpp_.cpp ...

Preprocessing file: C:\Users\user\AppData\Local\Temp\arduino_build_190951\HardwareSerial.cpp with SDCPP... 

Compiling C:\Users\user\AppData\Local\Temp\arduino_build_190951\HardwareSerial_sdcpp_.cpp ...

Preprocessing file: C:\Users\user\AppData\Local\Temp\arduino_build_190951\HLCore.cpp with SDCPP... 

Compiling C:\Users\user\AppData\Local\Temp\arduino_build_190951\HLCore_sdcpp_.cpp ...

Preprocessing file: C:\Users\user\AppData\Local\Temp\arduino_build_190951\sketch_dec09a.cpp with SDCPP... 

compilation terminated.



Preprocessor failed!uCxx returned error code:1



exit status 1
processing.app.debug.RunnerException
	at cc.arduino.Compiler.lambda$callArduinoBuilder$3(Compiler.java:309)
	at processing.app.debug.MessageSiphon.run(MessageSiphon.java:96)
	at java.lang.Thread.run(Thread.java:748)
Caused by: java.lang.NullPointerException
	at cc.arduino.Compiler.message(Compiler.java:525)
	at cc.arduino.i18n.I18NAwareMessageConsumer.message(I18NAwareMessageConsumer.java:80)
	at cc.arduino.MessageConsumerOutputStream.flush(MessageConsumerOutputStream.java:71)
	at cc.arduino.MessageConsumerOutputStream.write(MessageConsumerOutputStream.java:54)
	at java.io.OutputStream.write(OutputStream.java:75)
	at cc.arduino.Compiler.lambda$callArduinoBuilder$3(Compiler.java:307)
	... 2 more
(I only replaced the user name by "user" in this ouput)

I'm new to arduino programming, but I do think I've installed both the Z-uno and the OpenTherm library correctly: I can compile, upload and run sample projects on my z-uno, plus I can compile the OpenTherm library successfully if I select one of my Arduino Uno's as the target hardware. However If I select the Z-Uno as the target hardware, even #including only the opentherm.h crashes the compilation. If I copy the opentherm.h file into the %AppData%\..\Local\Temp\arduino_build_190951\ folder, the preprocessing does succeed and I get a number of other errors that will need to be addressed next (among others missing micros()), but this crash of the tools is keeping me from making any progress. If anyone can help me out in
1 - getting the Aeduino IDE to properly process the opentherm.h file and eventually
2 - porting the opentherm library to Z-Uno,

That would be greatly appreciated.

User avatar
PoltoS
Posts: 4954
Joined: 26 Jan 2011 19:36

Re: Opentherm on Z-Uno

Post by PoltoS » 16 Dec 2018 23:17

Hi!

After instaling the library from the Library Manager I did the following:
cp -R ~/Arduino/libraries/OpenTherm_Library/src/ ~/.arduino15/packages/Z-Uno/hardware/zw8051/2.1.5/libraries/OpenTherm

After this it started to give some reasonable compilation errors:
- missing detachInterrupt, attachInterrupt and digitalPinToInterrupt - should be relpaced by ZUNO_SETUP_ISR_INT0 or ZUNO_SETUP_ISR_INT1 (in global area, but it will work only from 2.1.5)
- missing micros - Z-Uno don't have it yet.
- missing yield - replace by a delay(10) or by an empty string [#define yield()]

So, currently only micros is a problem. OpenTherms lib is using 750 us delays. If it is tolerant to 1 ms, you can try milis() and compare with 1. Not nice, but can work.

rrozema
Posts: 13
Joined: 07 Jun 2018 12:45

Re: Opentherm on Z-Uno

Post by rrozema » 21 Dec 2018 22:50

Ok, when can we download the new 2.1.5 toolset?

fuecy
Posts: 1
Joined: 19 Jan 2019 17:27

Re: Opentherm on Z-Uno

Post by fuecy » 19 Jan 2019 17:29

Did you had any success? I was actually planning to do the exact same!

rrozema
Posts: 13
Joined: 07 Jun 2018 12:45

Re: Opentherm on Z-Uno

Post by rrozema » 07 Feb 2019 18:55

fuecy wrote:
19 Jan 2019 17:29
Did you had any success? I was actually planning to do the exact same!
Not yet. Still have a couple of things to fix/be fixed before I can make any real progress. Among others I'm waiting for version 2.1.5 of the zuno sdk to become available. Ihor's opentherm library uses some calls not available in 2.1.4. yet. In 2.1.5 micros() still won't be available I'm told by poltos, but I will try to implement without that anyway.

I don't understand how multiple companies introduce z-wave enabled thermostatic valves into the market but none of them combines it with a z-wave enabled boiler controller to enable for zone-heating. This is going to be my very first zuno project, so I am open to any suggestions and all the help anyone is willing to provide. Maybe we can even team up and combine our efforts by getting the same or similar hardware.

My idea is to have the zuno act as an opentherm controller, included into a zwave network. The opentherm controller should have one or more zwave enabled thermostatic valves associated to it. Via this association each valve reports its open/closed status to the controller, which -in it's simplest form- switches the boiler on if at least one valve is open, and off if none of the valves is open. The controller and the valves should thus operate autonomous, without intervention by the zwave controller as to avoid the heating going crazy if the zwave controller is busy or unavailable. The zwave controller can be used to set temperatures on the valves to open and close. The valves will however tell the opentherm controller (zuno) if heat production is required or not. The opentherm controller (zuno) itself sends its status, plus various data it receives from the boiler and valves to the zwave controller. It may however also allow to send commands into the boiler. My boiler for example supports an eco and comfort mode for tap water: I would like to have this set by my zwave controller according (for example) the time of day and whether or not people are present.

Future improvements can of course be to optimize boiler burner intensity to measured temperature deltas. For this purpose additional temperature sensors may need to be associated to the opentherm controller (zuno) if a valve doesn't report its environment temperature. Danfoss' valves for example don't report an environment temperature, only the setpoint. But Eurotronic's spirit do report both the setpoint and the environment temperature. For the 1st phase however only simple boiler on/off control will be my target. Another future goal: battery/alive checks on the valves: if a valve has drained its batteries, it may remain open. I don't want the boiler to keep heating that room until boiling point. So if a valve falls 'dead', after some time its 'on'-status should be ignored by the opentherm controller (zuno). The failed valve's room may still be heated due to other room's heat requests, but the boiler must not remain on all the time.

enbemokel
Posts: 286
Joined: 08 Aug 2016 17:36

Re: Opentherm on Z-Uno

Post by enbemokel » 08 Feb 2019 16:23

Hi, just some thoughts about your project. I like the idea to check the temperature in a room and the check of the valves in case
of low battery. But I see some problems with boiler interaction, as most of the devices have implement their own automatic control.
I assume that your (simple) boiler on/off will have some concurrency factor. (Boiler will heat cause of low heating water temperature, but it
will go in off mode because of zuno regulation.
From my knowlege a boiler needs very low energy (gas) if it is in idle mode.
Hope you get my point. Have fun with your project.

rrozema
Posts: 13
Joined: 07 Jun 2018 12:45

Re: Opentherm on Z-Uno

Post by rrozema » 18 Mar 2019 14:09

As I see it, with regards to the communication between the controller and the boiler, my controller does exactly the same what a "smart" thermostat would do: tell the boiler to set the burner to some specific intensity via the opentherm protocol. The boiler will not be able to tell the difference between my controller and such a "smart" thermostat. What problems do you think I am missing?

Post Reply