diyless / opentherm-gateway-simple

A simple example of using OpenTherm gateway to monitor and/or override heating status commands
MIT License
8 stars 3 forks source link

libraries and dependies on esp8266 using OpenTherm Gateway Basic Example #2

Closed DolendeDoDo closed 1 year ago

DolendeDoDo commented 1 year ago

Hi, I am trying to use the DIYLESS gateway together with the example ino. Sadly I encounter numerous errors in and on missing libraries. As I am searching the missing libraries and loading these "missing" libraries I think I have selected some that are not the correct ones. And so entering in multiple reference issues. My questions: A Can you provide me with a list of libraries that I should use? B In the otgw-simple.ino a reference is made to esp_task_wdt_reset(); as it creates an error I assume that it should be excluded in the esp8266 version of the sketch. Thank you in advance.

diyless commented 1 year ago

Hi @DolendeDoDo We've fixed compilation for ESP8266 chip. You'll need latest OpenTherm library and ESP8266 board core installed.

DolendeDoDo commented 1 year ago

L.S. I have made a clean new arduino.cc environment, downloaded the latest versions of the libraries and software needed. Ran into another issue with the "extern const char" definition. 'undefined var in line.....' Solved it by adding the ' = " " ' at the end of the extern const char definition. So far no compilation errors anymore. Only upon connecting al three boards to the broad backplane and in between the boiler and thermostat. The thermostat states communication error and the esp8266 does not connect to the wifi anymore as it did so when the esp8266 is not connected to the master, slave and backplane. Any ideas? Gr. Jan

tshcherban commented 1 year ago

Does it show anything in the Serial Monitor?

DolendeDoDo commented 1 year ago

Hi, The ESP8266 NOT connected to the slave, master & backplane does give messages on the monitor. Ip adress & channel update succesful. The ESP8266 connected to the master, slave via the backplane, nothing. The monitor keeps blank. gr. Jan

tshcherban commented 1 year ago

Can you show the photo of the whole setup? ESP+backplane+shields

DolendeDoDo commented 1 year ago

IMG_20220928_185708 IMG_20220928_182030

If you need more or different versions please let me know.

DolendeDoDo commented 1 year ago

const char ssid = "ABCDEFG"; const char password = "ABCDEFGHIJ"; unsigned long myChannelNumber = 12345678; const char myReadAPIKey = "ABCDEFGHIJKLMN"; const char myWriteAPIKey = "ABCDEFGHIJKLMN";

// HW settings

const int mInPin = 4; //2 for Arduino, 4 for ESP8266 (D2), 21 for ESP32 const int mOutPin = 5; //4 for Arduino, 5 for ESP8266 (D1), 22 for ESP32

const int sInPin = 12; //3 for Arduino, 12 for ESP8266 (D6), 19 for ESP32 const int sOutPin = 13; //5 for Arduino, 13 for ESP8266 (D7), 23 for ESP32

// code

extern const char index_html[] = ""; extern const char css[] = ""; extern const char js[] = ""; extern const int favico_ico_length = 0; extern const byte favico_ico[] = "";

These are my alterations to the otgw_simple.ino

tshcherban commented 1 year ago

Also one more question, does your thermostat have a separate power supply or originally it was powered from a boiler?

DolendeDoDo commented 1 year ago

More questions leading to a solution? Never an issue ;-)

No my thermostat does not have local powersupply [just checked it].

diyless commented 1 year ago

In general, it is specified on the product page that ESP8266 OpenTherm Gateway can't be used as a power source for a thermostat. It can work if your thermostat uses low power mode only (40mW).

Does the esp controller work if all 3 boards are connected but the thermostat and the boiler are not connected? Also, you can check separately master shield with a simple master demo sketch and boiler connected to ensure it works properly and check slave shield with slave demo sketch and thermostat connected. Check the serial output. https://github.com/ihormelnyk/opentherm_library/tree/master/examples

DolendeDoDo commented 1 year ago

OK I will check the power consumption of my thermostat.

No the master, slave, esp8266 on the backplane does NOT work if not connected to thermostat and boiler. Needles to say they do not work if connected.

To make sure I am sure whether the slave and master boards are o.k. I will configure and test them again.

DolendeDoDo commented 1 year ago

I use arduino 2.0.0 via app-image on linux mint 20 [I tested also on windows 11 and older linux mint versions, same result]

============================================== Test with the ESP 32 WiFi OpenTherm Thermostat

connect esp8266 via usb to computer uploaded EWOTT-sketch monitor shows activity disconnected usb cable from computer connected backplane with esp8266 & slave board [B connectors and thermometer] connect usb to powersupply website is active disconnect usb from powersupply connected backplane with esp8266 & slave board [B connectors and thermometer] connected backplane to boiler connected usb to powersupply esp8266 led lights up blue [steady] slaveboard led blinks green webste active and responsive to info from boiler can update temperature settings on/of switch temperature toggles but I can not experience any impact on/of switch hot water toggles but I can not experience any impact

In short, it works !!

============================================= Test with opentherm gateway simple connect esp8266 via usb to computer Uploaded the otgw-sketch monitor shows activity thingspeak shows multiple activity entries [with the value 0, makes sense] ip adress is shown in network disconnected usb cable from computer connect usb to powersupply connected backplane with esp8266, slave board [B connectors and thermometer] & masterboard blue led on master board burns constant. disconnect power connect backplane in between thermostat and boiler blue led on mastershield blinks ip adress is NOT visible in network honeywell thermostat states communication error

=============================================

As soon as the mastershield is connected to the bacplane and powered up via usb power, the mastershield led lights up blue [steady]

How can I further test the mastershield?

diyless commented 1 year ago

Hi @DolendeDoDo, Please make simple tests using basic sample sketches as proposed above.

Master OpenTherm Shield test: Flash master demo sketch, use 4,5 pins configuration for ESP8266 https://github.com/ihormelnyk/opentherm_library/tree/master/examples/OpenThermMaster_Demo Put on the extension shield (backplane) only the master shield and esp8266. Connect esp8266 to USB port Connect the screw terminal block (B1,B2) to the boiler. Check the serial output.

Slave OpenTherm Shield test: Flash slave demo sketch, use 12,13 pins configuration for ESP8266 https://github.com/ihormelnyk/opentherm_library/tree/master/examples/OpenThermSlave_Demo Put on the extension shield (backplane) only the slave shield and esp8266. Connect esp8266 to USB port Connect the screw terminal block (T1,T2) to the thermostat. Check the serial output.

DolendeDoDo commented 1 year ago

Ah here I find a issue. On my shields on the top right corner the type of the shield is writen [SLAVE/MASTER] and the SLAVE shield has B1 B2 connectors & MASTER shield has T1 and T2 connectors.

This does not match your instruction above.

diyless commented 1 year ago

You can find the names of the shields on the back side of the shield. Names near LEDs mean opposite device response indication. A boiler is a slave OT device. A thermostat is a master OT device.

DolendeDoDo commented 1 year ago

Shame on me ;-(

DolendeDoDo commented 1 year ago

==================================== The first test resulted [connected to the boiler]

T0 Bf0000000 repetitive

=================================== The second test

Error: Response timeout CH temperature is 0 degeress DHW temperature is 0 degrees

    After while:

Central heating: on Hot Water: off Flame: On CH temperature is 39.97 degeress DHW temperature is 32.44 degrees

    After a while again

Error: Response timeout CH temperature is 0 degeress DHW temperature is 0 degrees

diyless commented 1 year ago

Looks like you have an unstable connection. Probably headers soldering is not solid enough, try to reheat connections.

DolendeDoDo commented 1 year ago

Checked all the soldering. I could not detected failures. Cleaned the boards with isopropil alcohol.

There is still an unanswered question regarding the definition of "extern const" variables. Using your example sketch otgw_simple that includes the follwing statements: _extern const char index_html[]; extern const char css[]; extern const char js[]; extern const int favico_ico_length; extern const byte favicoico[];

This reults in compiling errors like: /home/jan/.arduino15/packages/esp8266/tools/xtensa-lx106-elf-gcc/3.0.4-gcc10.3-1757bed/bin/../lib/gcc/xtensa-lx106-elf/10.3.0/../../../../xtensa-lx106-elf/bin/ld: /tmp/arduino-sketch-2DF8E50DECFBE617DF481A94C4B5B685/sketch/otgw_simple.ino.cpp.o: in function _Z16htmlVarProcessorRK6String': /home/jan/Arduino/opentherm-gateway-simple-main/otgw_simple/otgw_simple.ino:200: undefined reference tofavico_ico_length' /home/jan/.arduino15/packages/esp8266/tools/xtensa-lx106-elf-gcc/3.0.4-gcc10.3-1757bed/bin/../lib/gcc/xtensa-lx106-elf/10.3.0/../../../../xtensa-lx106-elf/bin/ld: /home/jan/Arduino/opentherm-gateway-simple-main/otgw_simple/otgw_simple.ino:201: undefined reference to favico_ico' /home/jan/.arduino15/packages/esp8266/tools/xtensa-lx106-elf-gcc/3.0.4-gcc10.3-1757bed/bin/../lib/gcc/xtensa-lx106-elf/10.3.0/../../../../xtensa-lx106-elf/bin/ld: /tmp/arduino-sketch-2DF8E50DECFBE617DF481A94C4B5B685/sketch/otgw_simple.ino.cpp.o: in functionoperator()': /home/jan/Arduino/opentherm-gateway-simple-main/otgw_simple/otgw_simple.ino:262: undefined reference to css' /home/jan/.arduino15/packages/esp8266/tools/xtensa-lx106-elf-gcc/3.0.4-gcc10.3-1757bed/bin/../lib/gcc/xtensa-lx106-elf/10.3.0/../../../../xtensa-lx106-elf/bin/ld: /home/jan/Arduino/opentherm-gateway-simple-main/otgw_simple/otgw_simple.ino:256: undefined reference tojs' /home/jan/.arduino15/packages/esp8266/tools/xtensa-lx106-elf-gcc/3.0.4-gcc10.3-1757bed/bin/../lib/gcc/xtensa-lx106-elf/10.3.0/../../../../xtensa-lx106-elf/bin/ld: /home/jan/Arduino/opentherm-gateway-simple-main/otgw_simple/otgw_simple.ino:250: undefined reference to `index_html' collect2: error: ld returned 1 exit status

exit status 1

Compilation error: exit status 1

As stated earlier I changed the definition of these variables. But what should be the correct way?

diyless commented 1 year ago

Hi @DolendeDoDo , There is no sense to flash complex otgw_simple.ino sketch unless you have an unstable work of master/slave demo sketches. You should always get a valid response, it is recommended to re-heat with a flux all the headers connections to make them solid.

By the way, here is otgw_simple.ino sketch compilation on the fresh Arduino IDE 2.0 installation where ESP8266 board platform installed and OpenTherm Library. There are no issues. image

diyless commented 1 year ago

Also verified on linux (Ubuntu), compiles ok. Can you please change compiler warning to Default? image And after that press verify, and find output path in logs, there should be a line like reating BIN file "/tmp/arduino-sketch-XXXXXXXXXXXXXXXXXXXXXXXXXX. Compress it and send us on email (you can review cpp and/or ino files to remove wifi name, passwords etc.) so we can troubleshoot you build issues.

DolendeDoDo commented 1 year ago

I quit.

Sorry, I have resoldered all the boards [although I assume that was needed]. I have discovered coding errors in the example sketch, as they are resolved by you. On a different total fresh windows machine I downloaded the latest versions from GitHub. Compiled without error, connected and we saw the board working. The thermostat worked, the boiler worked. However..... The website running on the esp8266 produced no data and above all after 2 minutes the board frooze. That was driving me over the edge. Am I willing to tinker on stuff, bu this takes to long. So in the end the boards are in the garbage bin and I will try something else.

In the mean-time I will thank you for your support. I think you have tried your best, but the combo otgw-simple and me is not the best.

See you. Jan

diyless commented 1 year ago

We're sorry to hear that, we will try to figure out possible issues and improve the sample sketches.