Opentherm on Z-Uno

Discussion about Z-Uno product. Visit http://z-uno.z-wave.me for more details.
Post Reply
rrozema
Posts: 9
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: 4404
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: 9
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?

Post Reply