Hi, I'm trying to make a DLMS server using your python libraries, since there is no example of a server in python, I used it in NET, but I ran into a problem that `media` (GXNet) sends data to listeners in the `_NetReceiveEventArgs` structure, but `GXDLMSServer` expects data in the other class, which has `isStreaming`, `setReply` and `connectionInfo` methods, is most similar to the `GXServerReply` class, but it does not have all the methods.
Please tell how to process incoming data from IGXMediaListener methods or give a short example of a server in Python.
Consider that device could established a socket to a server and server could accept the device and register. (based on https://realpython.com/python-sockets/)
Is there any way that we could pass the socket to the "Gurux.DLMS.Client.Example.python" and continue the communication?
for instance:
- in server side:
sock = key.fileobj
conn, addr = sock.accept()
conn.setblocking(False)
data = xxxxxxxxxxxxxxxxxxxxxxx
events = selectors.EVENT_READ | selectors.EVENT_WRITE
self.sel.register(conn, events, data=data)
.
.
.
sampleclient.main(arg, conn)
- in Gurux.DLMS.Client.Example.python main.py
class sampleclient():
@classmethod
def main(cls, args, conn):
.
.
.
settings.media = conn
The server-side functionality and messages are totally different from than client-side, so this will not work.
You need to wait until the server side is implemented if you want to use it or then you can use other programming languages.
I'll try to use current features of Gurux.DLMS.Python considering Gurux.DLMS.AMI project to implement the server.
I appreciate your efforts and wish the server could be implemented in near future so that we can upgrade ours.
Thanks,
Hi,
Hi,
Server-side code is not implemented for python at the moment. It's released in the autumn for the python.
BR,
Mikko
Thanks for the quick response
Thanks for the quick response!
Dear Mikko,
Dear Mikko,
Consider that device could established a socket to a server and server could accept the device and register. (based on https://realpython.com/python-sockets/)
Is there any way that we could pass the socket to the "Gurux.DLMS.Client.Example.python" and continue the communication?
for instance:
- in server side:
sock = key.fileobj
conn, addr = sock.accept()
conn.setblocking(False)
data = xxxxxxxxxxxxxxxxxxxxxxx
events = selectors.EVENT_READ | selectors.EVENT_WRITE
self.sel.register(conn, events, data=data)
.
.
.
sampleclient.main(arg, conn)
- in Gurux.DLMS.Client.Example.python main.py
class sampleclient():
@classmethod
def main(cls, args, conn):
.
.
.
settings.media = conn
Hi,
Hi,
The server-side functionality and messages are totally different from than client-side, so this will not work.
You need to wait until the server side is implemented if you want to use it or then you can use other programming languages.
BR,
Mikko
I'll try to use current
I'll try to use current features of Gurux.DLMS.Python considering Gurux.DLMS.AMI project to implement the server.
I appreciate your efforts and wish the server could be implemented in near future so that we can upgrade ours.
Thanks,
Hi Ryan,
Hi Ryan,
Server-side for python and Delphi are released in August.
BR,
Mikko
Hi Kurumi,
Hi Kurumi,
Am I right that server-side python example will be commited here?
https://github.com/Gurux/Gurux.DLMS.Python
I'm also waiting for the same. I will monitor the repo then :)
Thanks
Dear Mikko,
Dear Mikko,
Is there any chance that you would release server-side for python this month ?
Your guidance is so helpful.
Thank you.
Hi,
Hi,
Yes, that is the place where server-side example will come in any day now. :-)
BR,
Mikko