I have already open serverSocket using following lines of code:
IGXmedia Media;
synchronized (Media.getSynchronous()) {
s = ((GXNet) Media).receiver.getClient();
}
And we have two meters(TCP/IP) client sockets but at a time only one socket connection thread is getting open.
Having problem in connecting multiple GPRS(TCP/IP) meters
Hi,
Just to make sure. Are you creating side or client size communicating?
Also do not create issue from this. This is Forum topic what you can create here:
http://www.gurux.fi/forum/21
BR,
Mikko
Hi,
Hi,
I am creating client side communicating. And sorry for creating issue over here.
Thanks,
client side communicating.
Hi,
You must create own instance from GXNet for each connection.
So if you have two conection you have two instances from GXNet.
BR,
Mikko
Hi,
Hi,
Can you describe it little bit that how can we create our own instance because i have seen the code of whole GXNet class but i didn't found anything which let me to have new instance every time , after opening the serverSocket from receiveThread only one client socket is getting connected.
Thanks,
GXNet
Hi,
GXNet cl1 = new GXNet();
cl1.Open();
GXNet cl2 = new GXNet();
cl2.Open();
BR,
Mikko
Hi,
Hi,
Firtsly, my question is how can i open the serversocket connection with using cl1.open()
and cl2.open(). Because I will be using same static ip and port for serversocket.
Secondly, If I did like this then i am getting following error:
GXNet cl1 = new GXNet();
cl1.setPort(5589);
cl1.setHostName("52.xxx.44.xx");
cl1.setProtocol(NetworkType.TCP);
cl1.setServer(true);
cl1.open();
GXNet cl2 = new GXNet();
cl2.setPort(5589);
cl2.setHostName("52.xxx.44.xx");
cl2.setProtocol(NetworkType.TCP);
cl2.setServer(true);
cl2.open();
java.net.BindException: Address already in use: JVM_Bind
Thanks,
client side communicating.
Hi,
Previous post you said that you are making client side sunctionality. Do not set
cl2.setServer(true); This will make network conponent act as server.
BR,
Mikko
Hi,
Hi,
I think then i wrote it wrong. And my requirement is like i am making a server in which socket server is open for my clients which are meters. As meters will ping my server, I will capture their socket connection. Then I'll read data asynchronously. And Now I am able to capture my clients(meters) connection as a list of client sockets using ListenerThreads. Earlier I was not able to do that because i was using previous version of Gurux APIs in which ListenerThreads class was not available. Now next step is how can i integrate my client socket with GXCommunicate class to read the data. Please let me know about this.
Thanks,
Regards,
Nitin Sethi
client side communicating.
Hi,
What protocol you are using? If you are using GPRS you should read this:
Reading meters using GPRS connection
http://www.gurux.fi/DLMSCOSEMFAQ
BR,
Mikko
Hi,
Hi,
We are using TCP/IP protocol. And for single meter having dynamic ips with previous version of Gurux net api, I am able to read data asynchronously. But now for multiple meters i am able to capture multiple socket connections but not able to read data. So please tell me about that.
Thanks,
Regards,
Nitin Sethi
Having problem in connecting multiple GPRS(TCP/IP) meters
Hi,
We have added example for dynamic IPs. You should read this:
http://www.gurux.fi/Gurux.DLMS.DynamicIP
BR,
Mikko
Hi,
Hi,
Thanks for the response.
I have gone through the link which you have mentioned above. Actually in that link GXListener.java was used and in my current version i am not able to find this java class, even in new version from github i am not able to find. Can you please let me know about this.
Thanks,
GXListener.java
Hi,
I updated GXListener class to the example.
public class GXListener extends Thread implements IGXMediaListener, IGXNetListener {
}
BR,
Mikko
Hi,
Hi,
Can you provide me the link.
Thanks,
Dynamic IPs
Hi,
http://www.gurux.fi/Gurux.DLMS.DynamicIP
Check Java code.
BR,
Mikko
Hi,
Hi,
Yes, I have checked this java code already. But I was asking is it updated with gurux library which is on github?
https://github.com/Gurux/gurux.net.java/tree/master/development/src/maiā¦
GXDLMSReader is also not there.
Thanks,
Dynamic IPs
Hi,
I do not want to add this to the Github because then we are receiving emails that my meter is not answering. We can't do generic example that works with all the meters because I don't know what protocol is used.
BR,
Mikko
Hi,
Hi,
ok, no problem. Can you mail me this to my email id, if you have this.
Net
GXDLMSReader
Thanks,
Dynamic IPs
Hi Kurumi,
Thanks for your help for mailing those classes, finally we are now able to communicate with multiple meters on gprs mode using TCP protocol.
Thanks,
Regards,
Nitin Sethi
Dynamic IPs
Hi Nitin Sethi,
Thanks from let me know this. It's always nice to hear when everything is working. :-)
Happy coding. :-)
BR,
Mikko
Hi Kurumi.
Hi Kurumi.
I need to do the same (to communicate with multiple meters on gprs mode using TCP protocol). Can you explain me what i need and what to do?
Thanks in advance
Leo
Closed topic
Dear Leo,
This is a closed topic. You can create a new question in the Gurux Forum.
www.gurux.gfi/forum