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 HXE310-kp Smart Meter Using Optical Head With Python

Reading HXE310-kp 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 , 14 October, 2019
Forums
Gurux.DLMS

Reading HXE smart meter using optical head with python
Hello, I am trying to read from HXE energy meter using optical probe. From the documentation, the meter works with Protocol mode E. I download Gurux dlms python library and ran the main.py script and i keep getting this

$python3 main.py -S /dev/ttyUSB0 -t Verbose
Authentication: Authentication.NONE
ClientAddress: 0x10
ServerAddress: 0x1
TX: 00:34:45 7E A0 07 03 21 93 0F 01 7E
Data send failed. Try to resend 1/3
Data send failed. Try to resend 2/3
RX: 00:35:00
DisconnectRequest
Traceback (most recent call last):
File "main.py", line 81, in main
reader.readAll()
File "/home/pi/Gurux.DLMS.python/Gurux.DLMS.Client.Example.python/GXDLMSReader.py", line 423, in readAll
self.initializeConnection()
File "/home/pi/Gurux.DLMS.python/Gurux.DLMS.Client.Example.python/GXDLMSReader.py", line 235, in initializeConnection
self.readDLMSPacket(data, reply)
File "/home/pi/Gurux.DLMS.python/Gurux.DLMS.Client.Example.python/GXDLMSReader.py", line 91, in readDLMSPacket
self.readDLMSPacket2(data, reply)
File "/home/pi/Gurux.DLMS.python/Gurux.DLMS.Client.Example.python/GXDLMSReader.py", line 142, in readDLMSPacket2
raise e
File "/home/pi/Gurux.DLMS.python/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.

Currently when I send '/?!\r\n' with python script, I get '/HXE5\2HXE12' as reply from the meter. what do i need to do next? or how can i get this library to work?

Thanks

Profile picture for user Kurumi

Kurumi

6 years 8 months ago

Hi,

Hi,

Can you try to read your meter with GXDLMSDirector first? You receive a reply to IEC 62056-21 command.

BR,
Mikko

klem_ai

6 years 8 months ago

ok i have just tried it, and

ok i have just tried it, and it connected. I looked up GXDLMSDirectorExample link to know what to fill for hex meters and it connected. after connecting, the data objects below the device i created, when i try to read em i get "no response" pop up. how to i read, or do i need to add data objects myself?

Image

klem_ai

6 years 8 months ago

device properties

device properties: with 300 baud, 7 bits, even parity, one stop bit.

Image
Profile picture for user Kurumi

Kurumi

6 years 8 months ago

Hi,

Hi,

First, you need to add -i parameter. Like this:
python3 main.py -S /dev/ttyUSB0 -i -t Verbose

It uses IEC 62056-21 as a start protocol.

Add that and try to read the meter. You can also try to change the authentication and client address if the connection fails.

BR,

Mikko

klem_ai

6 years 8 months ago

ok i will try that. how do i

ok i will try that. how do i pass in the password, cause the password is 00 00 00 00 00 00 and it's not ascii. care to tell how to pass in the -P [password format]

Profile picture for user Kurumi

Kurumi

6 years 8 months ago

Hi,

Hi,

You need to hardcore the password for now. We'll think how the user can give non-ascii password.
There are only few manufacturers that are not using the ASCII password.

BR,
Mikko

klem_ai

6 years 7 months ago

Hello Kurumi,

Hello Kurumi,

I have been able to successfully read the Hex meter using GXDLMSDirectorExample, and i tried the obis codes from the hex meter documentation to read out certain parameters and it did. Now i'm trying to use a raspberry pi to read certain information from the meter via optics and I need a python sample for this meter.

Thanks

klem_ai

6 years 7 months ago

In reply to Hi, by Kurumi

Hello Kurumi,

Hello Kurumi,

thanks for your reply, I have been able to successfully read the Hex meter using GXDLMSDirectorExample, and i tried the obis codes from the hex meter documentation to read out certain parameters and it did. Now i'm trying to read certain information from the meter using the gurux python library via optics. below is the reading i got with the app and i would like to get it using python. what arguments do i need to pass to the main.py file based on the parameters inputed in the GXDLMSDirector app as shown in my previous reply.

Thanks

Image
Profile picture for user Kurumi

Kurumi

6 years 7 months ago

Hi,

Hi,

I believe that you need to change the authentication level if the OBIS code that you want to read is not shown on the association view.

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