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. Reading HXE Smart Meter Using Optical Head With Python

Reading HXE smart meter using optical head with 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 klem_ai , 11 October, 2019
Forums
General discussion

Hello, I am trying to read from HXE energy meter using optical probe. From the documentation, the meter works with Protocol mode E. Is there a python Library i can use to get this done, and also do i need any information before i can read from it?
Currently when I send '/?!\r\n', I get '/HXE5\2HXE12' as reply from the meter. what do i need to do next?

Thanks

raihb

6 years 7 months ago

It's Hexing meter?

It's Hexing meter?

klem_ai

6 years 7 months ago

In reply to It's Hexing meter? by raihb

Yes..... hxe310-kp .... Help!

Yes..... hxe310-kp .... Help!

Profile picture for user Kurumi

Kurumi

6 years 7 months ago

Hi,

Hi,

Can you try to read your meter with GXDLMSDirector first? I'll help you to read it with python after that.
When you can read your meter with GXDLMSDirector I know that communication between the PC and the meter is working.

BR,
Mikko

klem_ai

6 years 7 months ago

In reply to Hi, by Kurumi

done!.. tried using NO/LOW

done!.. tried using NO/LOW authentication but i couldn't read the values. I was only able to read only using High authentication with password '00 00 00 00 00 00' . at least i want to read voltage and current and was able to do that. I now need to implement this high authentication setting and read out using either python or C/C++. I need help

Thank you,

Image
Profile picture for user Kurumi

Kurumi

6 years 7 months ago

Hi,

Hi,
Python is not support High authentication at the moment. We'll relese version at the end of this month that can read it. You can use ANSI C or ANSI C++ version.

Check the client example. It does what you want to do.

BR,
Mikko

klem_ai

6 years 7 months ago

In reply to Hi, by Kurumi

Hello,

Hello,

I have downloaded the ANSI C++ library, i ran make on the makefile in the development folder and it was successful, I also ran make in the GuruxDLMSClientExample folder after creating obj and bin directories.
Now, how can i run the GuruxDLMSClientExample.cpp file on a linux machine(Raspbian) ?

Profile picture for user Kurumi

Kurumi

6 years 7 months ago

Hi,

Hi,

Executable is found from bin-folder. The command-line parameters are the same.

BR,

Mikko

raihb

6 years 7 months ago

In reply to done!.. tried using NO/LOW by klem_ai

Hello, could you confirm me

Hello, could you confirm me what logical and physical address you used to Hexing meter

klem_ai

6 years 7 months ago

Thanks a lot. now i am

Thanks a lot. now i am getting passed the iec handshake, but afterwards i get "SNRMRequest failed 252". I am using a raspberry pi board

Profile picture for user Kurumi

Kurumi

6 years 7 months ago

Hi,

Hi,

Did you change the client address and password?

BR,
Mikko

klem_ai

6 years 7 months ago

In reply to Hi, by Kurumi

I passed it in as command

I passed it in as command from terminal bin directory as >>

$./gurux.dlms.client.bin -i -S /dev/ttyUSB0 -a High -P "00 00 00 00 00 00" -t Verbose

it only got passed the iec handshake

Profile picture for user Kurumi

Kurumi

6 years 7 months ago

Hi,

Hi,

You need to hard-code the password. It's handled as a string and your meter expects that it's hex string.
The client example can handle only strings at the moment.

BR,

Mikko

klem_ai

6 years 7 months ago

In reply to Hi, by Kurumi

Hello,

Hello,

The python update for high authentication, will it be available for use this month end? as you said

Thanks

Profile picture for user Kurumi

Kurumi

6 years 7 months ago

Hi,

Hi,

We are testing it at the moment.

BR,

Mikko

Profile picture for user Kurumi

Kurumi

6 years 7 months ago

Hi,

Hi,

There is a new version available from client example also in GitHub.
You can use High authentication like this:

-h localhost -p 4061 -a High -P Gurux

BR,

Mikko

klem_ai

6 years 7 months ago

In reply to Hi, by Kurumi

Hi,

Hi,

I am using optical probe to read from the meter. will this still work?

Thanks

Profile picture for user Kurumi

Kurumi

6 years 7 months ago

In reply to Hi, by klem_ai

Hi,

Hi,

Try to add -i parameter. It depends on the meter is IEC 62056-21 needed when connection is started.
Most European meters are using it, but several India or China meters are not used it.

BR,

Mikko

klem_ai

6 years 7 months ago

hello kurumi,

hello kurumi,
i have tried the new python library update and even hard coded the password. and when i check the log file, it's not receiving anything yet. please help

above contain screen shots of the hard coded password part and also results from running
$ python3 main.py -i -S /dev/ttyUSB0 -a HIGH -P "00 00 00 00 00 00" and still yet nothing is received when i check the log file

klem_ai

6 years 7 months ago

In reply to Hi, by Kurumi

code output

code output
pi@raspberrypi:~/Gurux.DLMS.Python-master/Gurux.DLMS.Client.Example.python $ python3 main.py -i -S /dev/ttyUSB0 -a HIGH -P '00 00 00 00 00 00'
password: 3030203030203030203030203030203030
Authentication: Authentication.HIGH
ClientAddress: 0x10
ServerAddress: 0x1
Data send failed. Try to resend 1/3
Data send failed. Try to resend 2/3
RX: 19:38:21
DisconnectRequest
Traceback (most recent call last):
File "main.py", line 80, in main
reader.readAll()
File "/home/pi/Gurux.DLMS.Python-master/Gurux.DLMS.Client.Example.python/GXDLMSReader.py", line 423, in readAll
self.initializeConnection()
File "/home/pi/Gurux.DLMS.Python-master/Gurux.DLMS.Client.Example.python/GXDLMSReader.py", line 235, in initializeConnection
self.readDLMSPacket(data, reply)
File "/home/pi/Gurux.DLMS.Python-master/Gurux.DLMS.Client.Example.python/GXDLMSReader.py", line 91, in readDLMSPacket
self.readDLMSPacket2(data, reply)
File "/home/pi/Gurux.DLMS.Python-master/Gurux.DLMS.Client.Example.python/GXDLMSReader.py", line 142, in readDLMSPacket2
raise e
File "/home/pi/Gurux.DLMS.Python-master/Gurux.DLMS.Client.Example.python/GXDLMSReader.py", line 134, in readDLMSPacket2
raise TimeoutException("Failed to receive reply from the device in given time.")
gurux_common.TimeoutException.TimeoutException: Failed to receive reply from the device in given time.
Ended. Press any key to continue.

klem_ai

6 years 7 months ago

In reply to Hi, by Kurumi

This is the password hard

This is the password hard coded part

Image
Profile picture for user Kurumi

Kurumi

6 years 7 months ago

Hi,

Hi,

Your hard coded pasword is 3030203030203030203030203030203030.
It should be 00 00 00 00 00 00.

BR,
Mikko

klem_ai

6 years 7 months ago

In reply to Hi, by Kurumi

hello,

hello,

tried that two, noticed the -i doesn't flag the iec true, i had to hard code it and the initialization function is now being called. I don't receive any response when it sends "/?!\r\n", i get failed to receive media or something. I have tried so many combinations but i still havn't read from the meter. I can read it through GXDLMSDirector but i want to read it with python. I am using optical head via serial.

  • 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