I wrote a java program to read the socket and able to read the meter data which pushed in regular intervals in plain text.
However, the other meter data are designed to be fetched from meter after hand shaking with modem as below: And i am able to get the reply from modem as "PMOK". After that I have to send command to meter (modem is made transparent) . Here I struck. I initiated a client java passing the modem ip and port and not getting result.
C:\Apache-Tomcat-8.5.32\webapps>java NewClass
It is now : Sun 2021.10.17 at 10:36:53 PM IST
Accepted Client Address - 10.254.0.207Meter IP:10.254.0.207port52968
Client Says :*STATUS,ONLINE,INST,#
Server Says : *PULLMODE#@01@
Waiting
false
false
Says : +++*STATUS,ONLINE,NOIN,#
Says :*PM@01@OK#*STATUS,OFFLINE,NOIN,#
Says : *PULLMODE#@01@ // From HES to Modem
Waiting
true
Server Says >>>: *PM@01@OK#*STATUS,OFFLINE,NOIN,# // From Modem to HES
true
////////////////////////////////////////////////
In other Command prompt run the following:
C:\Apache-Tomcat-8.5.32\webapps>java -jar gurux.dlms.client.example.java.jar -h 10.254.0.207 -a Low -P PRIDE -r sn -t Verbose -p 52968 -c 16 -s 1
Connect using network connection gurux.net.GXNet@19469ea2
Authentication: Low
ClientAddress: 0x10
ServerAddress: 0x1
Connection refused: connect
///////////////////////////////////////////////////
I thought if the modem sends ":*PM@01@OK#" , I can initiate the client program from the java application to get reading of meters . Is it in right direction?
The error message is clear:
Connection refused: connect
The client can't establish the connection to the given port number.
What kind of modem you are using? Is it connected to the serial port or are you accessing it by TCP/IP address?
Hi,
Hi,
Connection refused: connect means that your TCP/IP port is wrong. You need to check it.
BR,
Mikko
Hi
Hi
Accepted Client Address - 10.254.0.207 IP:10.254.0.207 port: 52968
The ip >>> Modem ip received that was connected.
port >> Modem IP received that was connected.
Is it correct or something else
Hi,
Hi,
The error message is clear:
Connection refused: connect
The client can't establish the connection to the given port number.
What kind of modem you are using? Is it connected to the serial port or are you accessing it by TCP/IP address?
BR,
Mikko
How to set timeout (in java
How to set timeout (in java package) to kill process in case to last long time?
Thanks
Peter.
Hi Peter,
Hi Peter,
Please, create a new topic if you have a new question. I'll answer your question then.
https://www.gurux.fi/ForumRules
BR,
Mikko