HDLC, Creating server

6 posts / 0 new
Last post
enemy235
HDLC, Creating server

Hi,
I have question about HDLC. You can choose framing as wrapper or HDLC. And there is HDLC as type of communication profile. Is it 2 different things or it's something similar?

I'm supposed to make an server app, which will be using HDLC instead of TCP/IP. So what I need to use? I guess not gurux.net, but gurux.serial?

Thanks

Kurumi
Kurumi's picture

Hi,

Some meters are sending HDLC packets over TCP/IP. Using wrapper is more efficient in TCP/IP networks.
You can use HDLC for TCP/IP if you want to.

BR,
Mikko

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

enemy235

Hi Mikko,
I'm trying to create server in java. I'm trying to understand and adapt your server examples.
And I have questions, if I can specify which authentication is used (low, high, high with sometnig). Also if server and client ID can be specified as well, and how can I do it. I tried something, but it didn't work.

Thanks

Kurumi
Kurumi's picture

Hi,

The client decides (proposes) what authentication level is used. Not the server.
BR,
Mikko

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

enemy235

Hi, I'm reusing this old thread, because my question is about HDLC.

I'm trying to make both server and client using gurux and I'm almost done, but I have this small problem.

My program will be used for testing different types of media, so I need to handle even a broken connection. For now I simulate that by removing Ethernet cable between devices for couple of seconds. When there is no reading, everything is fine, but when the disconnection is in the middle of reading that is whole different story.

I figured, that best place to handle this is inside GXDLMSReader in method readDLMSPacket(byte[] data, GXReplyData reply). When the command Media.send(...) is unsuccessful, program will enter a loop to establish the connection again with Media.open(). After that is needed to initializeConnection() again.

When using wrapper this solution works. But not when using HDLC. On the server side I get Invalid HDLC frame and I don't know how to solve this.

Here you can find text file with the method and pcap from the test. Cable was removed between 21st a 22nd packet and reconnected around 27th packet.

https://1drv.ms/u/s!Aum8SGjyGw1nlaljZYMSeqrZcNbvTw?e=Qpn1ss

Thanks for your help.

Kurumi
Kurumi's picture

Hi,

There is an inactivity timeout and you need to wait until that has elapsed if you close the connection in the middle of the read.

Some meters can handle this, but it's causing problems with several meters.

BR,
Mikko

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