Hi All,
Script Language - Python
Meter IP -24xx:yyy:xxxx:A::10 (Using SIM Card)
port -4059
I am using Gurux_dlms_client Example code in py.I run the script and able to communicate with device in local computer system . The same code i host AWS linux server, i unable to communicate device (TCP connection issue) ,and also i got error "[Errno 99] Cannot assign requested address ".
And cross verify the meter ip and port with TCP Client Sample code.I can able to send and receive the data . Ping and telnet the meter IP in AWS Linux server , the result is positive.
TCP Client Sample Code
import socket
def tcp_client():
# Server address and port
server_address = ('2401:xxxx:9yy7:zzz6::2', 4xyz)
# server_address = ('10.3.5.86', 8610)
# Create a TCP/IP socket
client_socket = socket.socket(socket.AF_INET6, socket.SOCK_STREAM)
try:
# Connect to the server
client_socket.connect(server_address)
print(f"Connected to {server_address}")
# Send a message to the server
message = " 00 01 00 10 00 01 00 1F 60 1D A1 09 06 07 60 85 74 05 08 01 01 BE 10 04 0E 01 00 00 00 06 5F 1F 04 00 62 1E 5D FF FF"
client_socket.sendall(message.encode())
print(f"Sent: {message}")
# Receive the response from the server
data = client_socket.recv(1024)
print(f"Received: {data}")
print(f"Received: {data.decode()}")
except Exception as e:
print(f"Error: {e}")
finally:
# Close the socket
client_socket.close()
print("Socket closed")
if __name__ == "__main__":
tcp_client()
Kindly help me. I think GXnet library issue....
Hi, If you are not using…
Hi,
If you are not using GXNet, it can't be GXNet issue. Check your TCP/IP address and port number that they are correct.
BR,
Mikko
Thank you for reply . …
Thank you for reply .
Multiple time i cross check the TCP/IP address and port .I didn't able to find the issue .But i confirm TCP connection issue . Can u give alternate solution for GXNet (TCP). I need your help .
Thank you for reply . …
Thank you for reply .
Multiple time i cross check the TCP/IP address and port .I didn't able to find the issue .But i confirm TCP connection issue . Can u give alternate solution for GXNet (TCP). I need your help .
Hi, Check the IP address…
Hi,
Check the IP address. You are giving it as plain text at the moment.
BR,
Mikko