Creating my own OTGW firmware for the NodoShop version

This Forum is about the Opentherm gateway (OTGW) from Schelte

Moderator: hvxl

rvdbreemen
Starting Member
Starting Member
Posts: 45
Joined: Sun Jan 19, 2020 2:04 pm

Re: Creating my own OTGW firmware for the NodoShop version

Post by rvdbreemen »

Just updated the OTGW firmware repo to version 0.4.0:

- bugfix: Turns off AP after configuration (no more open AP)
- bugfix: removed serial debug output, no more errors from the OTGW on serial
- added: Implemented simple REST API to enable integration thru REST with webpage or home automation

So all the basics are working fine, MQTT messages and integration is working fine. OTmonitor can connect to port 1023 to monitor.

Known things on the list to implement:
- bi-directional serial communication
- MQTT command sending to OTGW
- Influxdb client to do datalogging
- UI dashboard for stand-alone use and configuration (considering ESP-DASH)
- use the TC command set to control the OTGW

It's getting there, so please keep telling me what to do next.
rvdbreemen
Starting Member
Starting Member
Posts: 45
Joined: Sun Jan 19, 2020 2:04 pm

Re: Creating my own OTGW firmware for the NodoShop version

Post by rvdbreemen »

Since the last update I continued working, the list of features has grown:
  • MQTT messages with auto discovery
  • MQTT command sending to control your OTGW
  • REST API for easy integration
  • Serial2Network Port for use with OTMonitor
  • Easy setup thru WebUI
Version 0.5.0 is a stable release that has been running for over over a month now. I still have features to add, but the list is getting shorter and shorter. Some compile instructions have been added, so you can build it yourself now. And binary release is on my list of things todo.

Any ideas, suggestions or pull requests are welcome.

Find the current release: https://github.com/rvdbreemen/OTGW-firmware
aferrato
Starting Member
Starting Member
Posts: 4
Joined: Mon Jan 04, 2021 5:47 pm

Re: Creating my own OTGW firmware for the NodoShop version

Post by aferrato »

FransO wrote:As stated in my previous post, I report via MQTT directly from the NodeMCU on the Nodo-shop Opentherm Gateway to my Home Assistant installation. I use Tasmota (https://tasmota.github.io/docs/#/Home) on the NodeMCU which has all required functionality already built-in. All that was necessary was to configure the serial port and the reset line and to specify two rules. One rule to initialize the system on boot and one to report the status of the OpenTherm Gateway every minute. As stated before I use the response to the PS=1 command to report the status. Much easier than processing each individual message from the gateway. Issuing commands to the gateway can be done from Home Assistant by publishing a serialsend command via MQTT.
The configuration template is:
template {"NAME":"OTGW","GPIO":[255,148,255,149,255,255,255,255,255,255,21,255,56],"FLAG":15,"BASE":18}
The rules are:
rule1 ON system#boot DO backlog power1 0; baudrate 9600; delay 10; power1 1; delay 10; serialsend3 \r; delay 10; serialsend3 GW=R\r; delay 10; serialsend3 PS=1\r ENDON
rule2 ON Time#Minute|1 DO SerialSend3 PS=1\r ENDON
Hi, could you explain a little more the configuration you used with Tasmota? i can't receive any messages via serial, how should i set it?
you say something about cutting some pins, are you referring to SD0 and CMD?

thanks!
gs500
Starting Member
Starting Member
Posts: 1
Joined: Sun Jan 03, 2021 9:45 pm

Re: Creating my own OTGW firmware for the NodoShop version

Post by gs500 »

Hi all,

First: what a great forum this is! Thanks for sharing all this knowledge!
The last weeks I have been playing with the OTGW. Because I am a big TASMOTA fan I flashed the attached NodeMCU with this software. Thanks to the configuration placed in this thread the NodeMCU sends serial information by MQTT.. For now I have got 2 questions:
Somehow I cannot manage to find what is going wrong; the only serial info I receive is:

Message 33 received on tele/klimaat/opentherm/RESULT at 9:03 PM:
{
"SerialReceived": "Error 03\r\n"
}

1. Can anyone tell me what this error means and what I am doing wrong?
2. In my Home Assistant config.yaml I added the code for the sensors as posted earlier. There is no entity created which matches this script. What should I do to correct this?

Cheers!
hvxl
Senior Member
Senior Member
Posts: 1965
Joined: Sat Jun 05, 2010 11:59 am
Contact:

Re: Creating my own OTGW firmware for the NodoShop version

Post by hvxl »

Error messages are documented on the web site.

I suggest to first get things working with the standard setup, before you start packing things in MQTT messages.
Schelte
mlommers
Starting Member
Starting Member
Posts: 16
Joined: Mon Jul 12, 2010 12:52 pm

Re: Creating my own OTGW firmware for the NodoShop version

Post by mlommers »

rvdbreemen wrote:Since the last update I continued working, the list of features has grown:
  • MQTT messages with auto discovery
  • MQTT command sending to control your OTGW
  • REST API for easy integration
  • Serial2Network Port for use with OTMonitor
  • Easy setup thru WebUI
Version 0.5.0 is a stable release that has been running for over over a month now. I still have features to add, but the list is getting shorter and shorter. Some compile instructions have been added, so you can build it yourself now. And binary release is on my list of things todo.

Any ideas, suggestions or pull requests are welcome.

Find the current release: https://github.com/rvdbreemen/OTGW-firmware
great initiative, I was also looking into creating a homebrew solution, mainly because i also want to use the nodeMCU to pass DS18B20 sensor values as well. ESP easy does support this however only up to 12 devices (so only 11 next to the OTGW. Would is be easy to add this functionality within your solution?

Will it be possibe to upgrade the PIC software via your solution? or does this also in your case only work when using the USB to RS232 TTL cable directly to the otgw?
hvxl
Senior Member
Senior Member
Posts: 1965
Joined: Sat Jun 05, 2010 11:59 am
Contact:

Re: Creating my own OTGW firmware for the NodoShop version

Post by hvxl »

mlommers wrote:Will it be possibe to upgrade the PIC software via your solution? or does this also in your case only work when using the USB to RS232 TTL cable directly to the otgw?
I suspect you refer to a remark in the previous version of the Nodo shop document. But that was misleading and has been removed from the latest version. A firmware upgrade via WiFi works just fine. The only issue used to be if you tried to upgrade the firmware on the bench, i.e. without a boiler connected. In that case you could manually issue a PR=A command as a work-around. That work-around has now been added to OTmonitor version 4.4.1, so you can always do a firmware upgrade.
Note: This only applies to upgrading the gateway firmware. When running the diagnostic- or interface firmware, manual intervention is still required. But in that case you can briefly short the RST pins next to the PIC when otmonitor asks to manually reset the OTGW.
Schelte
mlommers
Starting Member
Starting Member
Posts: 16
Joined: Mon Jul 12, 2010 12:52 pm

Re: Creating my own OTGW firmware for the NodoShop version

Post by mlommers »

@hvxl thanks, didn't new that, good to hear.
mlommers
Starting Member
Starting Member
Posts: 16
Joined: Mon Jul 12, 2010 12:52 pm

Re: Creating my own OTGW firmware for the NodoShop version

Post by mlommers »

to come back on my previous remark:
>>ESP easy does support this however only up to 12 devices (so only 11 next to the OTGW).
This weekend i found out that this is not correct. When the OTGW is connected no other devices are supported to connect next to the OTGW.

So it would be great if this would be supported in the solution of rvdbreemen.

@rvdbreemen Could you shine your light on this?
rvdbreemen
Starting Member
Starting Member
Posts: 45
Joined: Sun Jan 19, 2020 2:04 pm

Re: Creating my own OTGW firmware for the NodoShop version

Post by rvdbreemen »

mlommers wrote:to come back on my previous remark:
>>ESP easy does support this however only up to 12 devices (so only 11 next to the OTGW).
This weekend i found out that this is not correct. When the OTGW is connected no other devices are supported to connect next to the OTGW.

So it would be great if this would be supported in the solution of rvdbreemen.

@rvdbreemen Could you shine your light on this?
It's possible to support other sensors, however the problem is that the hardware setup does not allow you to breakout sensors. However the OTGW Pic itself can do that I think. Need to look into that on how that actually works with the commands and all.

Have not played around with anything more advanced on the OTGW hardware and PIC possibility's. I have been focused on implementing the 8266 firmware so that it can become a standalone OTGW with a bunch of features.
rvdbreemen
Starting Member
Starting Member
Posts: 45
Joined: Sun Jan 19, 2020 2:04 pm

Re: Creating my own OTGW firmware for the NodoShop version

Post by rvdbreemen »

mlommers wrote:
rvdbreemen wrote:Since the last update I continued working, the list of features has grown:
Will it be possibe to upgrade the PIC software via your solution? or does this also in your case only work when using the USB to RS232 TTL cable directly to the otgw?
So this has been tested, using the v0.5.0 and up you can use OTmonitor and upgrade over the NodeMCU 8266 connections. Just connect OTmonitor to port 1023 and you can then upgrade the PIC software.

This works over Wifi/the Air. You do not need to connect using USB to upgrade the PIC on the board.

Maybe the name for my project is a bit misleading, as I write a firmware for the 8266, not the PIC itself. Never realized it might be confusing :roll:

Starting v0.6.0 you can even upgrade the 8266 OTA without the watchdog resetting the 8266 during a flash cycle. :|
rvdbreemen
Starting Member
Starting Member
Posts: 45
Joined: Sun Jan 19, 2020 2:04 pm

Re: Creating my own OTGW firmware for the NodoShop version

Post by rvdbreemen »

Good News... I just release version 0.6.0, go here to find out more:
https://github.com/rvdbreemen/OTGW-firmware/

Main features for this release to version 0.6.0 release are:
  • verified upgrade PIC firmware over port 1023 (serial2net) using OTmonitor 4.x
  • standalone WebUI, so you can monitor your OTGW in real-time without any other solutions.
  • ton of UI/CSS fixes, thus it should work on most smartphones (as responsive as I could get)
  • bonus: device information UI
  • new v1 REST API to read out the OTmonitor information in one single REST call
  • Sending commands thru the REST API (alpha, needs testing)
  • working OTA upgrades (now without watchdog resets)
Also I released it as binary's for the first time, find the 2nd release including the binary's:
https://github.com/rvdbreemen/OTGW-firm ... tag/v0.6.0

Any feedback, ideas, input is welcome...

@hvxl your request on setting a TC on schedule is on my backlog :)
hvxl
Senior Member
Senior Member
Posts: 1965
Joined: Sat Jun 05, 2010 11:59 am
Contact:

Re: Creating my own OTGW firmware for the NodoShop version

Post by hvxl »

mlommers wrote:When the OTGW is connected no other devices are supported to connect next to the OTGW.
Did you try, or is your conclusion based on the Nodo shop documentation again? I don't see a reason why it wouldn't be possible to connect temperature sensors in addition to an OTGW.
rvdbreemen wrote:However the OTGW Pic itself can do that I think.
The OTGW PIC only supports 1 temperature sensor. There is no space for storing sensor addresses.
Schelte
hvxl
Senior Member
Senior Member
Posts: 1965
Joined: Sat Jun 05, 2010 11:59 am
Contact:

Re: Creating my own OTGW firmware for the NodoShop version

Post by hvxl »

I loaded the binary images (using `esptool.py --baud 921600 write_flash 0 OTGW-firmware.ino.bin 0x200000 OTGW-firmware.spiffs.bin`, none of that cumbersome messing with a GUI). After loading the firmware and resetting the NodeMCU, the blue LED did not turn on. Nevertheless, the OTGW-XX-XX-XX-XX-XX WiFi network was available and connecting and configuring the device was a breeze. I need to check how that is done for one of my own projects, where connecting to WiFi always seems to be a struggle.

The main web page initially stays almost empty while it does a whole flurry of HTTP requests, which was a bit disconcerting. Now the blue LED goes on and off with no apparent pattern or meaning. But using OTmonitor via port 1023 works perfectly. And with more functionality to come, this looks quite promising.

One other remark: It seems you are using SPIFFS. I understand that SPIFFS is deprecated and LittleFS is the current preferred file system. Is there any special reason you still chose to use SPIFFS? There is no method available to switch from SPIFFS to LittleFS via OTA. So it may be worth considering to start using LittleFS before you release version 1.0.
Schelte
rvdbreemen
Starting Member
Starting Member
Posts: 45
Joined: Sun Jan 19, 2020 2:04 pm

Re: Creating my own OTGW firmware for the NodoShop version

Post by rvdbreemen »

Hi Hvxl

Thanks for the feedback. I just finished this instruction for the people that love GUI. But you give me an even simpler solution with esptool.py (honest, just did not look into that).

Then on the setup, I admit my documentation is not perfect yet, code first then document :roll: But you found the local access point for easy configuration. That's done with the WifiManage library.

The blue led turns on and off for one reason, and one reason only, it's a heartbeat of 1 second. As you already have communication leds on the OTGW hardware (green led for incoming msg). If you want meaning, then led me know. I am open to suggestions. For me it's just a easy of mind that it works. I created a simple task scheduler that blinks once per second, but seeing that I know the WDT reset happens too.

The deperication of SPIFF is recent, you are so right that I need to implement LittleFS. It is on my bucketlist, but for now SPIFF does the job without a problem.

Glad you like it... the flurry of HTTP request you see going by, if you are in the WebUI is the browser asking the ESP 8266 information to fill the screen, its the simple REST API I implemented. That's all, again its only happening if you go and to the WebUI.

In the WebUI you will also find the Settings, so you can configure MQTT for your own purposes.

I will keep updating this as long as there are idea's or improvements or bugs to squash.
Post Reply

Return to “Opentherm Gateway Forum”