Skip to main content
Home
for DLMS smart meters
Open source solutions for DLMS smart metering

Main navigation

  • Home
  • Products
  • About us
  • Open Source
  • Community
  • Forum
  • Downloads
User account menu
  • Log in

Breadcrumb

  1. Home
  2. Forums
  3. Gurux.DLMS.Push.Listener.Example.python

Gurux.DLMS.Push.Listener.Example.python

Forum Rules

Before commenting read Forum rules

Don't comment the topic if you have a new question.

You can create a new topic selecting correct category from Gurux Forum and then create a new topic selecting "New Topic" from the top left.

By ravichandra99 , 3 August, 2022
Forums
Gurux.DLMS

HI

gurux dlms client is working fine but when i tried push listener its giving
errors, please help

(nenv)
root@localhost:~/gurux_new/Gurux.DLMS.Python/Gurux.DLMS.Push.Listener.Example.python#
python3 main.py -h 2402:3A80:1702:116::1 -p 4059 -T 5452493030303030 -A
5472695F5F5F556E6963617374417363 -B 5472695F5F5F556E6963617374417363 -t
Verbose
gurux_dlms version: 1.0.128
gurux_net version: 1.0.17
gurux_serial version: 1.0.17
TCP Server 2402:3A80:1702:116::1:4059
Press any key to close the application.
trace:19:26:13 TraceTypes.INFO MediaState.OPENING
Media state changed. MediaState.OPENING
trace:19:26:13 TraceTypes.INFO MediaState.CLOSING
Media state changed. MediaState.CLOSING
trace:19:26:13 TraceTypes.INFO MediaState.CLOSED
Media state changed. MediaState.CLOSED
[Errno 99] Cannot assign requested address
(nenv)
root@localhost:~/gurux_new/Gurux.DLMS.Python/Gurux.DLMS.Push.Listener.Example.python#

Regards
Ravi Chandra

Profile picture for user Kurumi

Kurumi

3 years 10 months ago

Hi,

Hi,

Remove host address and try to run with these parameters:

-p 4059 -T 5452493030303030 -A
5472695F5F5F556E6963617374417363 -B 5472695F5F5F556E6963617374417363 -t Verbose

If it still fails, make sure that the port number is not used by some other app.
BR,
Mikko

ravichandra99

3 years 10 months ago

Hi Mikko thanks

Hi Mikko thanks

Now media state is open, How do I send msg to meter

Media state is open and cursor is blinking

root@localhost:~/dlms_mildtrix/Push# python3 main.py -p 4059 -T 5452493030303030 -A 5472695F5F5F556E6963617374417363 -B 5472695F5F5F556E6963617374417363 -t Verbose
pkg_resources not found
[('p', '4059'), ('T', '5452493030303030'), ('A', '5472695F5F5F556E6963617374417363'), ('B', '5472695F5F5F556E6963617374417363'), ('t', 'Verbose')]
TCP Server localhost:4059
Press any key to close the application.
trace:16:02:27 TraceTypes.INFO MediaState.OPENING
Media state changed. MediaState.OPENING
trace:16:02:27 TraceTypes.INFO MediaState.OPEN
Media state changed. MediaState.OPEN
..

Regards
Ravi Chandra

Profile picture for user Kurumi

Kurumi

3 years 10 months ago

Hi,

Hi,

Gurux.DLMS.Push.Listener.Example listens push messages from the meter. It doesn't send anything, just listens.

If you want to read the meter you need to use Gurux.DLMS.Client.Example
https://github.com/Gurux/Gurux.DLMS.Python/tree/master/Gurux.DLMS.Clien…

BR,
Mikko

ravichandra99

3 years 10 months ago

OK sir but DLMS.Client is

OK sir but DLMS.Client is running in background on port 4059,
But now DLMS.Push cant run on the same port.. What to do sir

Profile picture for user Kurumi

Kurumi

3 years 10 months ago

Hi,

Hi,

DLMS.Client is using meters port number 4059. Or are you simulating the meters on the same meter?
Check what is allocating the Port 4059.

You can change the port to something else. See "Send destination and method" attribute.

http://www.gurux.fi/Gurux.DLMS.Objects.GXDLMSPushSetup

ravichandra99

3 years 10 months ago

Not simulating sir,

Not simulating sir,

Can I run DLMS.Push on 4061??

and Im getting error while running Client

Error! Index: 3 Invalid Block number. It is 23 and it should be 1.
Invalid Block number. It is 23 and it should be 1.
Traceback (most recent call last):
File "/root/dlms_gurux/Client/GXDLMSReader.py", line 437, in getReadOut
val = self.read(it, pos)
File "/root/dlms_gurux/Client/GXDLMSReader.py", line 326, in read
self.readDataBlock(data, reply)
File "/root/dlms_gurux/Client/GXDLMSReader.py", line 182, in readDataBlock
self.readDLMSPacket(data, reply)
File "/root/dlms_gurux/Client/GXDLMSReader.py", line 118, in readDLMSPacket
self.readDLMSPacket2(data, reply)
File "/root/dlms_gurux/Client/GXDLMSReader.py", line 169, in readDLMSPacket2
raise e
File "/root/dlms_gurux/Client/GXDLMSReader.py", line 149, in readDLMSPacket2
while not self.client.getData(rd, reply, notify):
File "/root/dlms_gurux/Client/gurux_dlms/GXDLMSClient.py", line 1190, in getData
raise ex
File "/root/dlms_gurux/Client/gurux_dlms/GXDLMSClient.py", line 1187, in getData
ret = GXDLMS.getData(self.settings, reply, data, notify)
File "/root/dlms_gurux/Client/gurux_dlms/GXDLMS.py", line 2297, in getData
GXDLMS.getPdu(settings, target)
File "/root/dlms_gurux/Client/gurux_dlms/GXDLMS.py", line 2032, in getPdu
GXDLMS.handleGloDedResponse(settings, data, index)
File "/root/dlms_gurux/Client/gurux_dlms/GXDLMS.py", line 2175, in handleGloDedResponse
GXDLMS.getPdu(settings, data)
File "/root/dlms_gurux/Client/gurux_dlms/GXDLMS.py", line 2001, in getPdu
if not GXDLMS.handleGetResponse(settings, data, index):
File "/root/dlms_gurux/Client/gurux_dlms/GXDLMS.py", line 1907, in handleGetResponse
GXDLMS.handleGetResponseNextDataBlock(settings, reply, index)
File "/root/dlms_gurux/Client/gurux_dlms/GXDLMS.py", line 1851, in handleGetResponseNextDataBlock
raise ValueError("Invalid Block number. It is " + str(number) + " and it should be " + str(expectedIndex) + ".")

Pls help

Profile picture for user Kurumi

Kurumi

3 years 10 months ago

Hi,

Hi,

Can you run the app -t Verbose argument? I need the hex trace so I can check what is happening.

BR,
Mikko

  • Create new account
  • Reset your password

Hire Us!

Latest Releases

  • Tue, 06/09/2026 - 11:16
    gurux.dlms.java 4.0.95
  • Tue, 06/09/2026 - 10:03
    Gurux.DLMS.Python 1.0.199
  • Mon, 06/08/2026 - 13:39
    gurux.dlms.cpp 9.0.2606.0801
  • Mon, 06/01/2026 - 10:15
    gurux.dlms.cpp 9.0.2606.0101
  • Thu, 05/28/2026 - 16:06
    gurux.dlms.java 4.0.94

New forum topics

  • Error reading L&G Meter
  • Pass a TCP Client to GXNet
  • Australian EDMI Mk10D (Essential Energy area)
  • Strange mix of data notificiation vs get response
  • DLMS Connection
More

Who's new

  • Tuanhgg
  • Adel
  • charnon
  • Paddles
  • Miguel Ángel
RSS feed
Privacy FAQ GXDN Issues Contact
Follow Gurux on Twitter Follow Gurux on Linkedin