RS485 DLMS Communication - Page 1
Forum section: electronics / projects

author: eujean
author_rank: Contributor
timestamp: December 07, 2016, 08:07:27 am
content: Hi there,I am attempting to interface with a Wasion DDSD101 single phase smart energy meter. Being Chinese, there is absolutely no documentation to be found, and unless my understanding of RS485 is fundamentally flawed I dunno what to do. Also DLMS is an extremely overcomplicated protocol IMHO, but required by regulatory institutions.The interface is a simple two-wire half duplex RS485 setup with an A and B line. The problem, which is why I'm unsure, is there is a constant voltage across these two terminals. Doesn't matter if I send anything to it which is expected since the RS485 is basically a differential pair. There is no ground, but shouldn't be a problem since communication is not over a long distance.So am I missing something or any ideas how to start sending data to the meter?Thanks

author: coppice
author_rank: Super Contributor
timestamp: December 07, 2016, 08:26:18 am
content: If the meter starts in IEC62056-21 mode it should be easy to get some communication started. If it starts in full DLMS mode it can be a pain. Probably the IR port starts in IEC62-56-21 mode, but the RS485 starts in full DLMS mode. For that reason, it might be worth trying to communicate through the IR port initially. There are so many variable you need to get right with the full DLMS protocol - bit rate, source address, destination address, whether they express the addresses as 1, 2 or 4 byte values, etc. - before you will get any response from the meter at all. Once you get an HDLC response, you should be able to make a connection, associate with lowest level security, and read some basic information. From there, life might get hard, depending on how they applied the protocol - e.g. whether everything is AES GCM 128 encrypted and authenticated.The Gurux and OpenMUC software are probably the best available free tools for talking to a meter using DLMS, but they still have plenty of bugs.

author: eujean
author_rank: Contributor
timestamp: December 07, 2016, 09:17:58 am
content: Unfortunately I don't have IR capabilities at the moment.My main concern is that when I measure the voltage across the RS-485 terminals with absolutely nothing connected except for the power, I read a constant 5 V. Not sure if I'm missing something basic though, as simple as termination or something however my RS-485 has built in termination so dunno.DLMS has been nothing but a pain so far.

author: coppice
author_rank: Super Contributor
timestamp: December 07, 2016, 09:22:39 am
content: Quote from: eujean on December 07, 2016, 09:17:58 amYou've hardly started. It gets a lot worse.The 5V on your RS485 pins is probably just due to pullups.

author: eujean
author_rank: Contributor
timestamp: December 07, 2016, 10:06:15 am
content: I figured as much.The problem with the meter is that I don't know what the address is, so I use the public client address of 16 with a 1 byte server address of 1 which should correspond to the management logical device, however I get absolutely nothing from the meter which leads me to believe the communications are at fault.You mentioned previously bitrate is important? How is this since the RS-485 does automatic control of the bitrate, or did I misunderstand?

author: coppice
author_rank: Super Contributor
timestamp: December 07, 2016, 10:20:50 am
content: Quote from: eujean on December 07, 2016, 10:06:15 amRS485 doesn't automatically control bit rate. You need to match the bit rate which the meter is configured to expect.Client address 16 with 1 byte addressing will be OK with most meters, but not all. Some refuse to accept 1 byte addresses. You also need to get the server address right, in terms of both the address and the number of bytes, to see a response from the meter.You don't need to try that many bit rates. Its likely to be 1200, 2400, 4800, or 9600, and it is always balanced (i.e. rx rate == tx rate). They rarely go higher than that. Addresses are likely to be 1 byte or 2 bytes. 4 bytes is not so common. Hit the meter with a correctly addressed SNRM at the right bit rate, and you should see a response.

author: ajb
author_rank: Super Contributor
timestamp: December 07, 2016, 01:44:25 pm
content: Quote from: eujean on December 07, 2016, 10:06:15 amRS-485 is strictly an electrical standard, it simply says 'this condition represents a logical "1", and that condition represents a logical "0"'. It says nothing about the protocol built on top of those conditions--UART is probably most common, but even then baud rate, character size, parity, and stop bits are all protocol- or implementation-dependent.

author: eujean
author_rank: Contributor
timestamp: December 12, 2016, 01:19:26 pm
content: Turns out the problem was with the serial converter. Swapped it out and started seeing the comms light on the meter flash when I transmit.Now, the real problem is how on earth do I determine the server address, or even address scheme being used by the meter?And can I be sure that it will accept anything from a public client?

author: coppice
author_rank: Super Contributor
timestamp: December 12, 2016, 02:50:48 pm
content: I haven't seen a meter with simple RS485 or IR comms that won't response to a public address with a lowest security connexion. Can you write a little code to cycle through all the possible SNRM messages with different address formats, and listen for a response after each? I think I actually wrote something like that a few years ago, but I have no idea where it might have gone.

author: eujean
author_rank: Contributor
timestamp: December 15, 2016, 11:10:15 am
content: Some more progress..Turns out the specific meter being tested was not actually even DLMS-compliant. Event though the model number is listed on the dlms-compliant list of devices, the model I have has an extension to the model-number which implies that dlms is not supported.It's also quite hard to get people to sell you a single meter to actually develop a DLMS implementation(or at least here in SA).Anyway, thanks for the help

author: coppice
author_rank: Super Contributor
timestamp: December 15, 2016, 03:46:53 pm
content: I don't find meters very helpful for developing DLMS code. There are so many possibilities and each meter only implements a few of them.