Monitor mode OK, but GW mode is not working

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

Moderator: hvxl

Post Reply
cakiroglu
Starting Member
Starting Member
Posts: 4
Joined: Wed Oct 16, 2013 12:09 am

Monitor mode OK, but GW mode is not working

Post by cakiroglu »

Hello,

I got opentherm gateway running version 3.4 and I have pulled out max232 IC. I have connected arduino to communicate with opentherm-gateway.

Everything works fine in monitor mode. I write up a basic sketch. It prints all serial data readings to arduinos serial interface and I can also use arduino's com port on otmonitor.exe without any problems.

But I cant send send data to opentherm gateway. It does not respond me from otmonitor.exe interface or arduino serial interface via send button.
(As I know it needs to respond from one of those codes to me http://otgw.tclcode.com/firmware.html#configuration)

I also bridged tx-rx connections as mentioned here : http://www.opentherm-gateway.com/media/ ... ctions.pdf


Could anyone help me to try something else to send commands to my opentherm-gateway and make it respond?


Here is the basic sketch I wrote;

Code: Select all

void setup()
{
  Serial.begin(9600);
}

void loop()
{  
	if (Serial.available() > 0) {
  incomingByte = Serial.read();
  Serial.print(incomingByte);

}
Any help will be appreciated,

Many thanks.
cakiroglu
Starting Member
Starting Member
Posts: 4
Joined: Wed Oct 16, 2013 12:09 am

Re: Monitor mode OK, but GW mode is not working

Post by cakiroglu »

Any suggestions?
hvxl
Senior Member
Senior Member
Posts: 1965
Joined: Sat Jun 05, 2010 11:59 am
Contact:

Re: Monitor mode OK, but GW mode is not working

Post by hvxl »

I am not familiar with arduino and couldn't understand the code you showed. To me it looks like you just echo back each character you receive on the serial interface. How you expect that to work with the gateway, I don't know.

The only configuration that I can imagine where your description makes some sense is if you connect the transmit line of the gateway to the receive line of the arduino, and then connect the transmit line of the arduino to the receive line of the PC running otmonitor. In that case it's not surprising that you can't send anything to the gateway.

But then again, if you can't send anything to the gateway, how do you switch it to monitor mode?

I suggest to first make sure that the gateway operates as expected when connected directly to a PC running otmonitor. When that works, you can try to add the arduino to the mix.

If you are still having problems, please describe more clearly what you are doing and what results you get.
Schelte
Digit
Global Moderator
Global Moderator
Posts: 3388
Joined: Sat Mar 25, 2006 10:23 am
Location: Netherlands
Contact:

Re: Monitor mode OK, but GW mode is not working

Post by Digit »

You should make a 2nd serial port with the NewSoftSerial library and do something like this:

Code: Select all

void loop() {
  
  if (Serial.available()) {
    int inByte = Serial.read();
    Serial1.print(inByte, BYTE); 

  }
  
  if (Serial1.available()) {
    int inByte = Serial1.read();
    Serial.print(inByte, BYTE); 
  }
}
Then the "echo function" will no longer be there. :wink:

No wait, here's an even better example, Arduino has its own SoftwareSerial library nowadays, from Arduino >= 1.0:

http://arduino.cc/en/Reference/SoftwareSerial
hvxl
Senior Member
Senior Member
Posts: 1965
Joined: Sat Jun 05, 2010 11:59 am
Contact:

Re: Monitor mode OK, but GW mode is not working

Post by hvxl »

I took a quick look at the arduino uno serial interface and see that you can use it at 5V TTL levels or with the on-board TTL-USB converter.

Did you connect both at the same time? That's not going to work. The transmit line from the gateway is much stronger than the one from the USB side. So all transmissions coming in over USB will be lost.

You will need to use a separate serial interface for the gateway side, in the way Robert indicated.
Schelte
cakiroglu
Starting Member
Starting Member
Posts: 4
Joined: Wed Oct 16, 2013 12:09 am

Re: Monitor mode OK, but GW mode is not working

Post by cakiroglu »

Hello again,

OK, it is working now. As you mentioned above, I used Arduino software serial and I can send and receive data without any loss. That's great.

Thank you all.

I have another problem now but I think it is about my thermostat. It is not setting room temperature value with the command send by otmonitor. Other commands and functions are working as expected.

I will try to find the reason on another topics.

Thank you again!
Post Reply

Return to “Opentherm Gateway Forum”