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.net.GXNet Cannot Be Cast To Gurux.serial.GXSerial

gurux.net.GXNet cannot be cast to gurux.serial.GXSerial

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 meco , 24 June, 2021
Forums
Gurux DLMS for Java

Hi,

I am able to connect the meter from GXDLMSDirector and read all the data. But I am having some problems when I am trying to connect it from the client application. I am using -h ip -p port -c 16 -r ln -i HdlcWithModeE as program argument and it gives me error "gurux.net.GXNet cannot be cast to gurux.serial.GXSerial"

GXDLMSDirector parameters are:

Image
Profile picture for user Kurumi

Kurumi

5 years 1 month ago

Hi,

Hi,

Mode E is used with optical probe and it's not used with TCP/IP. Change HdlcWithModeE to HDLC if you are using TCP/IP or UDP connection.

BR,
Mikko

meco

5 years 1 month ago

Hi,

Hi,

Thanks for the reply.

I have just changed the interface to HDLC in both GXDLMSDirector and the argument in the program. I am able to read the from GXDLMSDirector again. However, I am not able to read it from the client application. It gives the following output. I double checked ip/port.

Connect using network connection gurux.net.GXNet@27d6c5e0
Authentication: None
ClientAddress: 0x10
ServerAddress: 0x1
Standard: DLMS
Data send failed. Try to resend 1/3
Data send failed. Try to resend 2/3
Data send failed. Try to resend 3/3
DisconnectRequest
Failed to receive reply from the device in given time.

Process finished with exit code 1

And this is the trace.txt

TX: 12:46:47.032 7E A0 07 03 21 93 0F 01 7E
TX: 12:47:47.040 7E A0 07 03 21 93 0F 01 7E
TX: 12:48:47.043 7E A0 07 03 21 93 0F 01 7E
TX: 12:49:47.047 7E A0 07 03 21 93 0F 01 7E

Thanks,

Profile picture for user Kurumi

Kurumi

5 years 1 month ago

Hi,

Hi,

When you select the meter in GXDLMSDirector you can see command-line parameters it the right side. Try with them. I believe that you haven't give the server address.

BR,
Mikko

meco

5 years 1 month ago

In reply to Hi, by Kurumi

Hi,

Hi,

I couldn't find any command-line parameters in GXDLMSDirector when I select the meter from the left side.

Image

meco

5 years 1 month ago

I assumed the server address

I assumed the server address that you have mentioned corresponds to physical address in the GXDLMSDirector. I added - s 100 to the argument but it still cannot connect to the meter.

Connect using network connection gurux.net.GXNet@27d6c5e0
Authentication: None
ClientAddress: 0x10
ServerAddress: 0x64
Standard: DLMS
Data send failed. Try to resend 1/3
Invalid connection.

Profile picture for user Kurumi

Kurumi

5 years 1 month ago

Hi,

Hi,

Update GXDLMSDirector to the latest version.
http://gurux.fi/Downloads/gxdlmsdirector46/GXDLMSDirector.application

BR,
Mikko

meco

5 years 1 month ago

In reply to Hi, by Kurumi

Hi,

Hi,

I just figured it out that I need to calculate the correct value of server address. It's working now.

Thanks for your help.

  • Create new account
  • Reset your password

Hire Us!

Latest Releases

  • Thu, 07/23/2026 - 16:19
    gurux.dlms.java 4.0.96
  • Thu, 07/09/2026 - 14:34
    Gurux.DLMS.Python 1.0.201
  • Fri, 06/26/2026 - 16:32
    Gurux.Service 3.0.2606.2601
  • Wed, 06/24/2026 - 08:36
    Gurux.DLMS.Python 1.0.200
  • Mon, 06/15/2026 - 08:52
    gurux.dlms.c 9.0.2606.1501

New forum topics

  • Service not known error on gprs communication
  • Service not known error on gprs communication
  • Help Needed: Interfacing Saral 100 Energy Meter with Microcontroller via RS232
  • Connecting Meter to Agent via serial
  • Reading block profile with Compact array
More

Who's new

  • @Hmd- several '.
  • Dawsontot
  • Jerrylam
  • qvlLdJweKzGUYaSOVS
  • LindanEt
RSS feed
Privacy FAQ GXDN Issues Contact
Follow Gurux on Twitter Follow Gurux on Linkedin