GXTerminal csharp Sample

4 posts / 0 new
Last post
hivesoft
GXTerminal csharp Sample

Hi,
I'm tring to read my Landis+Gyr ZMD meter via GSM modem. It work fine! Very good job! But I have found a problem in GXTerminal library.

When it close the connection the modem don't hangup.
It's true thet we are not expecting reply at +++ but "OK" reply may be if the modem is in data mode, and in this state you must wait some second before you send ATH0 command.

To debug them I'm used your "GXTerminal csharp Sample" but obviously the same problem is present in GXDLMSDirector

To workarround them I have inserted a 3 second Thread.Sleep before the SendCommand ATH0, and all work fine!

On GXTerminal.cs at line 1281 in Close function:

Receive(p);
Thread.Sleep(3000);
SendCommand("ATH0\r", connectionWaitTime, null, false);

at this point I would also expect the answer of "OK".
Bye
Christian Assante

Kurumi
Kurumi's picture

Hi Christian,

We have spoken from this quite a lot. Adding 3 seconds delay is a simple solution but is costing a lot of money because the line is up 3 seconds more for each connection.

We'll add HangsUpDelay property. The default value is zero and it works like now. If you set HangsUpDelay to 3000 it waits 3 seconds before ATH0 is called.

BR,

Mikko

________________________________________
Mikko Kurunsaari
Gurux Ltd
http://www.gurux.fi

hivesoft

Now disconnect without problems! Great.
Personally I don't think that waiting 3 more seconds is a big problem. It's much worse to stay connected than to lose a few more seconds for a safer hangup!

I take this opportunity also to ask you another question: to read one day of load profiles via GSM takes about 100 seconds !! I have the same timing also in the GXDLMSDirector. In your experience, is it a normal duration?
I make some tests also via NET and the duration for single reading goes from 2000 to 48ms. Ok, I'm in lan but two seconds to send 9 bytes and receive 223 bytes seems too much. Blame the meter?

BR
Christian

Kurumi
Kurumi's picture

Hi Christian,

The reason is the GSM channel or the meter. I don't know how much data you need to read, but reading data over GSM usually is slow. Do you read all the data from load profile or just what is not read yet?

BR,
Mikko

________________________________________
Mikko Kurunsaari
Gurux Ltd
http://www.gurux.fi