Page 2 of 3
Re: Strange problem with OTGW
Posted: Wednesday 16 May 2018 12:53
by Hobbybob
Ah, I see you are having problems as well. I will try to flash the older firmware in a couple of days, and post back the results. If that still doesn't work, I think I will have to try and test if the OTGW is actually good. I don't have much experience in soldering, so it could be something is not quite right, but since it works good when only otmonitor is connected, I was assuming the hardware-side was okay.
Are there any links on testing the hardware? Because I'm afraid that the older firmware will not be the solution, since (as you already said) many people are running this version in combination with Domoticz.
Re: Strange problem with OTGW
Posted: Wednesday 16 May 2018 15:16
by sincze
I have had problems since last October
For debugging hardware
http://otgw.tclcode.com/debugging.html
I have been running with otmonitor and relay enabled for quite some time. Even with that I had my wdt resets.
Currently installed a new pic. Instead of 7-20 resets a day now once every 3 weeks. But the heating does not do a lot these days so don't sure if that was the 100% fix.
Re: Strange problem with OTGW
Posted: Friday 18 May 2018 19:37
by svkeulen
I just bought an OTGW with firmware 4.2.5. I noticed that it reports only messages of length 9 (like BC0090000) to domoticz (it says 2018-05-18 19:26:48.619 OTGW: BC0090000) while the source-code of domoticz seems to want to parse other output. I guess it is more like the messagelog of otmanager. Maybe older firmware outputs this type. I dont know because it failed to downgrade. Anyhow... I am rewriting the code (OTGWBase.cpp) of domoticz as we speak. I just finished two messageIDs and it works like a charm. ID 0 Status and 1 Control setpoint.
Now it says: 2018-05-18 19:26:46.808 (OTGW) Temp (Control Setpoint) etc...
When I finish I will share it with you.
Re: Strange problem with OTGW
Posted: Saturday 19 May 2018 10:52
by Hobbybob
svkeulen wrote: ↑Friday 18 May 2018 19:37
I just bought an OTGW with firmware 4.2.5. I noticed that it reports only messages of length 9 (like BC0090000) to domoticz (it says 2018-05-18 19:26:48.619 OTGW: BC0090000) while the source-code of domoticz seems to want to parse other output. I guess it is more like the messagelog of otmanager. Maybe older firmware outputs this type. I dont know because it failed to downgrade. Anyhow... I am rewriting the code (OTGWBase.cpp) of domoticz as we speak. I just finished two messageIDs and it works like a charm. ID 0 Status and 1 Control setpoint.
Now it says: 2018-05-18 19:26:46.808 (OTGW) Temp (Control Setpoint) etc...
When I finish I will share it with you.
Oh, that would be awesome!
I don't know if it will solve my problems, but if the other solutions don't work, I'll sure give it a try!
Re: Strange problem with OTGW
Posted: Saturday 19 May 2018 11:54
by svkeulen
I don't know if it will solve my problems, but if the other solutions don't work, I'll sure give it a try!
If you only see messages of length 9, mostly starting with a B(oiler) or a T(ermostat) in your domoticz log then it would.
Re: Strange problem with OTGW
Posted: Saturday 19 May 2018 12:06
by Hobbybob
Okay, so I decided to test the harware first. I disconnected the gateway from everything, and removed the PIC and octocoupler. Then I started to follow everything described on
http://otgw.tclcode.com/debugging.html
All the voltages check out, but I don't register any amps on X1... Now I figured my multimeter might be broken, so I got a 100 ohm resistor, and screwed one end in X1, and then measured the voltage between the other end of the resistor and the other side of X1. I am still measuring the exact same voltage as when I don't have the resistor connected.
This is really weird. Am I doing something wrong here?
Re: Strange problem with OTGW
Posted: Sunday 20 May 2018 11:37
by Hobbybob
I also posted the question on the domoticaforum.eu-forum, and got a response there. I have been able to get through the whole testing procedure, and it looks like my hardware is okay. I did not immediatly suspect that it would not be, because with otmonitor it worked perfectly, but I just wanted to be sure.
It looks like I have to flash the older firmware. @sincze Do you have 3.4 anywhere? I can't find it on the otgw-website.
Re: Strange problem with OTGW
Posted: Sunday 20 May 2018 12:47
by sincze
Oldest I have is 4.0.
Re: Strange problem with OTGW
Posted: Tuesday 22 May 2018 12:20
by Domotibart
Joining in the discussion.
I have excactly the same problem. everything starts ok but after some hours i only get an endless stream of data from the gateway.
I do not think it has something to with the opentherm firmware. I have an older gateway with the serial/usb connection. It worked for 2 tears in a row using the USB port on teh gateway.
Only when i used a usb/serial to lan converter (ESP8266) the problem occured. When using the otmonitor and the lan setup everything works fine!
I think it has got something to do with the serial to lan communication between domoticz and the otmonitor.
Re: Strange problem with OTGW
Posted: Tuesday 22 May 2018 13:06
by sincze
Thanks for this update. It is now pointing in a direction finally.
Re: Strange problem with OTGW
Posted: Wednesday 23 May 2018 7:47
by Hobbybob
Domotibart wrote: ↑Tuesday 22 May 2018 12:20
Joining in the discussion.
I have excactly the same problem. everything starts ok but after some hours i only get an endless stream of data from the gateway.
I do not think it has something to with the opentherm firmware. I have an older gateway with the serial/usb connection. It worked for 2 tears in a row using the USB port on teh gateway.
Only when i used a usb/serial to lan converter (ESP8266) the problem occured. When using the otmonitor and the lan setup everything works fine!
I think it has got something to do with the serial to lan communication between domoticz and the otmonitor.
Thanks for the information! It seems this problem is more common than I thought...
Any idea as to where the solution should be found in your opinion? Should the gateway firmware be changed, or Domoticz?
Re: Strange problem with OTGW
Posted: Friday 25 May 2018 8:46
by svkeulen
Domotibart wrote: ↑Tuesday 22 May 2018 12:20
I think it has got something to do with the serial to lan communication between domoticz and the otmonitor.
I think you are right. I just finished rewriting the code (everything works flawless now) and discovered I made a terrible mistake. The good side is that I now know the cause of most problems.
I forgot to connect the Tx from my FTDI USB serial device to the OTGW from the beginning. So I only received B and T traffic as described above. It did not even respond to my command like PR=A (duh!). So I rewrote the domoticz code to parse this messages.
It seems that the old code relied on sending PS=1 to get a status report. If there is something wrong with the serial connection (bad signals due to long cables or in my case no Tx signal) domoticz receives nothing at all. It also send more than just one command (PR=G, PR=O and PR=I). This is not a good idea because this generates a lot of responses and everything have to work together. So just listening and not relying on sending a status report command is more error prone.
I attached my code so you can try (on your own risk
). I will review and test it a bit more before submitting it to domoticz github. I also documented the code. I will add more status reports and error handling. (I just finished reading the OpenTherm protocol specification) Hope you will give me some feedback on it so we can improve it more.
Re: Strange problem with OTGW
Posted: Friday 25 May 2018 8:53
by Hobbybob
svkeulen wrote: ↑Friday 25 May 2018 8:46
Domotibart wrote: ↑Tuesday 22 May 2018 12:20
I think it has got something to do with the serial to lan communication between domoticz and the otmonitor.
I think you are right. I just finished rewriting the code (everything works flawless now) and discovered I made a terrible mistake. The good side is that I now know the cause of most problems.
I forgot to connect the Tx from my FTDI USB serial device to the OTGW from the beginning. So I only received B and T traffic as described above. It did not even respond to my command like PR=A (duh!). So I rewrote the domoticz code to parse this messages.
It seems that the old code relied on sending PS=1 to get a status report. If there is something wrong with the serial connection (bad signals due to long cables or in my case no Tx signal) domoticz receives nothing at all. It also send more than just one command (PR=G, PR=O and PR=I). This is not a good idea because this generates a lot of responses and everything have to work together. So just listening and not relying on sending a status report command is more error prone.
I attached my code so you can try (on your own risk
). I will review and test it a bit more before submitting it to domoticz github. I also documented the code. I will add more status reports and error handling. (I just finished reading the OpenTherm protocol specification) Hope you will give me some feedback on it so we can improve it more.
I would like to try this out! Is it just a matter of replacing files twith these, or do I have to do something more than that?
Also: if there is anything I can do to help you with this (send log-files, or whatever), I'd be more than happy to do so. Just let me know.
Re: Strange problem with OTGW
Posted: Friday 25 May 2018 9:08
by svkeulen
I attached a screenshot. I connected domoticz via otmanager so there is more to see. Oh forgot to say I changed the devices IDs of the switches and sensors in domoticz to the corresponding OpenTherm message IDs. So you need to delete the OTGW devices from domoticz. It will make new devices with the correct IDs.
https://imgur.com/a/eMJovpa
Re: Strange problem with OTGW
Posted: Friday 25 May 2018 20:17
by Hobbybob
svkeulen wrote: ↑Friday 25 May 2018 8:46
I attached my code so you can try (on your own risk
). I will review and test it a bit more before submitting it to domoticz github. I also documented the code. I will add more status reports and error handling. (I just finished reading the OpenTherm protocol specification) Hope you will give me some feedback on it so we can improve it more.
I downloaded the files, but I have been looking around on my RPi, and I can't seem to find these files...
How do I install these?
Re: Strange problem with OTGW
Posted: Saturday 26 May 2018 11:54
by svkeulen
I downloaded the files, but I have been looking around on my RPi, and I can't seem to find these files...
How do I install these?
The are sourcefiles and you need to compile it. Did you install your RPi the easy way or did you compile it from source? If you never done it, maybe I can send you my compiled domoticz file for my RPi if you have the same. I have a RPi 3 B+ and you? The good thing is you can stop your version and start my version for testing. If you put it in a different location you keep your good working version.
Re: Strange problem with OTGW
Posted: Saturday 26 May 2018 12:10
by Hobbybob
svkeulen wrote: ↑Saturday 26 May 2018 11:54
I downloaded the files, but I have been looking around on my RPi, and I can't seem to find these files...
How do I install these?
The are sourcefiles and you need to compile it. Did you install your RPi the easy way or did you compile it from source? If you never done it, maybe I can send you my compiled domoticz file for my RPi if you have the same. I have a RPi 3 B+ and you? The good thing is you can stop your version and start my version for testing. If you put it in a different location you keep your good working version.
I installed it the easy way. I'm running a RPi 3, not sure from the top of my head if it is a 3B or not, but definitly bot a 3B+. I'm running raspbian Jessie.
You can send it to me, I'll give it a try, but I will need some pointers on installing it I think.
Re: Strange problem with OTGW
Posted: Wednesday 05 February 2020 23:29
by sexyboy
Hi guys,
I've been suffering with the same issues and the posted 2 files it seems like solving the issues.
It seems like this code change has never been merged into to development branch.
I'm just curious why? Do you guys know perhaps?
Regards,
Oszkar
Re: Strange problem with OTGW
Posted: Saturday 22 February 2020 17:45
by svkeulen
The code never ended up in the development branch. Maybe it is a good idea that I contact the developers about it. I think it is wise to add an extra device (to the source) instead of replacing the current one. Maybe there are people using the code of the "old" device.
Re: Strange problem with OTGW
Posted: Saturday 22 February 2020 17:59
by svkeulen
I just created an issue on GitHub:
https://github.com/domoticz/domoticz/issues/3943. See what happens...