SO I have put toghether a system whereby I can have several meters connect over TCP to a ServerSocket, I then do `Socket socket = servSock.accept()` to dequeue each Socket connection.
After this I will then create a `new GXSocket(Socket)` and pass in the `Socket` object. This is a new type I made which implements the `IGXMedia` interface, a lot of the code I needed I copied from GXNet. So this GXSocket has a built-in receiver thread which then manioulates the buffer the `GXSynchronousMediaBase` is attached to, allow the `receive()` method to work. Sending is more simple, just used the sending code from GXNet too.
My question is around the handshake process that occurs when a meter connects to US instead of the other way round (where we connect to it and then do a handshake). Do you have any information on this process to enlighten me as we really need this to work.
It may be wrong in some places but I'm trying to get an idea of how to implement our own IGXMedia.
The Socket passed into it comes from ServerSocket.accept() in another Java file (just for reference).
There may very well be authentication problems but in our code via GXDLMSReader we would expect those to appear then, it seems to get stuck initializing the connection.
Hi, You need to do a…
Hi,
You need to do a handshake when the meter establishes the connection in the same way as you do when you connect for the meter.
BR,
Mikko
Perfect, thank you very much…
Perfect, thank you very much. I will post a related follow-up question later.
This is my current process,…
This is my current process, I can post the code if need be:
handleTCP(): Enter
GXSocket: receive(gurux.common.ReceiveParameters@2315b761) (returning false)
[GXDLMSReader] succeded receive()?: false
Data send failed. Try to resend 1/3
TX: 11:21:52.877 7E A0 07 03 21 93 0F 01 7E
[ConnThread/onTrace] Just traced: 41.13.28.143:40566 [B@169bce7f
GXSocket: Just sent: [126, -96, 7, 3, 33, -109, 15, 1, 126]
GXSocket: receive(gurux.common.ReceiveParameters@2315b761) called
handleTCP(): Count byte: 0
handleReceivedData(): Enter
GXSocket: getEop() called (returning null)
GXSocket: getIsSynchronous() called (returning false)
GXSocket: getSyncBase() called (returning gurux.common.GXSynchronousMediaBase@58d9a169)
[ConnThread/onTrace] Just traced: 41.13.28.143:40566 [B@151b59a1
[ConnThread/onReceived] Just received [Data: 00 01 00 01 00 01 00 16 0A 02 10 43 4C 45 31 30 35 34 32 32 39 30 30 30 33 30 39 00 18 89, From: /41.13.28.143:40566]
handleTCP(): Enter
The bytes the meter sends upon connect seem to be:
Just received [Data: 00 01 00 01 00 01 00 16 0A 02 10 43 4C 45 31 30 35 34 32 32 39 30 30 30 33 30 39 00 18 89, From: /41.13.28.143:40566]
Anything meaningful?
Here is the code (this time…
Here is the code (this time I made sure the paste would not expire) for GXSocket:
https://paste.debian.net/1270708/
It may be wrong in some places but I'm trying to get an idea of how to implement our own IGXMedia.
The Socket passed into it comes from ServerSocket.accept() in another Java file (just for reference).
There may very well be authentication problems but in our code via GXDLMSReader we would expect those to appear then, it seems to get stuck initializing the connection.