Skip to content
DDHF22 edited this page Sep 6, 2020 · 4 revisions

Welcome to the OmniPowerRadiusDLMS wiki!

How to get authentication and encryption key

Radius will on request hand out keys to allow encrypted commmunications with the meter. Contact Radius and ask for a set of encryption/authetication keys providing them your meter/installation number. (Be aware that they also hand out a single Kamstrup-Meter-Protocol key to be used with other applications like the HAN module) What you should get is (EEE and AAA should of course be substituted for the real hex values)

KeyType  KeyName    Key
64       gpk60      0xEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEE (encryption key) 
65       gpk61      0xAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA (authentication key)

This link may be helpful https://radiuselnet.dk/elkunder/elmaaleren/betjening/

How to physically interface the Kamstrup OmniPower meter.

The way Radius and Kamstrup have set it up is that you can ONLY use the CCC port in the top of the meter. Behind the unsealed lid you find an optoisolated 6 pin port. Seen from out side the pinout is

+-------------+    (1) VCC                         (4) NC
| (6) (5) (4) |    (2) DATA IN  - data to meter    (5) NC
| (1) (2) (3) |    (5) DATA OUT - data from meter
+-------------+    (6) GND 

If you have a TTL-level com port (like in Raspberry PI/Arduino etc) you can just connect GND and DATA IN to TX and DATA OUT to RX on the PI. Alternatively you can use a TTL2USB or TTL2RS232 converter to get a comport to communicate with on the computer. The code provided is .NET core code that talks to a com port to work.

How to use the code to extract data.

Assuming you have the meter hooked up on COM3 and the encryption keys above you just run

OmniPowerRadiusDLMS -cCOM3 -a AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA -e EEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEE 

and you will receive output like

2020-09-02T23:07:25.3743305Z ENCRYPTED PACKET RECEIVED 2020-09-03 (04) 01:07:20.00 ???? 128 00000000
'1.1.0.2.129.255', 'OBISVersion', 'Obis' = 'Kamstrup_V0001' ''
'1.1.1.8.0.255', 'Active energy A14', 'A14' = '17755480' 'Wh'
'1.1.2.8.0.255', 'Active energy A23', 'A23' = '1760780' 'Wh'
'1.1.3.8.0.255', 'Reactive energy R12', 'R12' = '720730' 'varh'
'1.1.4.8.0.255', 'Reactive energy R34', 'R34' = '1555020' 'varh'
'1.1.0.0.1.255', 'Meter number 1', 'MeterNo' = '12345678' ''
'1.1.1.7.0.255', 'Actual Power P14', 'P14' = '1506' 'W'
'1.1.2.7.0.255', 'Actual Power P23', 'P23' = '0' 'W'
'1.1.3.7.0.255', 'Actual Power Q12', 'Q12' = '0' 'var'
'1.1.4.7.0.255', 'Actual Power Q34', 'Q34' = '189' 'var'
'0.1.1.0.0.255', 'Realtime clock', 'RTC' = '2020-09-03 (04) 01:07:20.00 ???? 128' ''
'1.1.32.7.0.255', 'RMS voltage L1', 'Urms L1' = '232' 'V'
'1.1.52.7.0.255', 'RMS voltage L2', 'Urms L2' = '232' 'V'
'1.1.72.7.0.255', 'RMS voltage L3', 'Urms L3' = '232' 'V'
'1.1.31.7.0.255', 'RMS current L1', 'Irms L1' = '4440' 'mA'
'1.1.51.7.0.255', 'RMS current L2', 'Irms L2' = '1220' 'mA'
'1.1.71.7.0.255', 'RMS current L3', 'Irms L3' = '1640' 'mA'
'1.1.21.7.0.255', 'Actual power P14 L1', 'P14 L1' = '929' 'W'
'1.1.41.7.0.255', 'Actual power P14 L2', 'P14 L2' = '218' 'W'
'1.1.61.7.0.255', 'Actual power P14 L3', 'P14 L3' = '359' 'W'
'1.1.33.7.0.255', 'Power factor L1', 'CosPhi L1' = '94' '%'
'1.1.53.7.0.255', 'Power factor L2', 'CosPhi L2' = '77' '%'
'1.1.73.7.0.255', 'Power factor L3', 'CosPhi L3' = '98' '%'
'1.1.13.7.0.255', 'Power factor Total', 'CosPhi Total' = '99' '%'
'1.1.22.7.0.255', 'Actual power P23 L1', 'P23 L1' = '0' 'W'
'1.1.42.7.0.255', 'Actual power P23 L2', 'P23 L2' = '0' 'W'
'1.1.62.7.0.255', 'Actual power P23 L3', 'P23 L3' = '0' 'W'
'1.1.22.8.0.255', 'Actual energy A23 L1', 'A23 L1' = '2720430' 'Wh'
'1.1.42.8.0.255', 'Actual energy A23 L2', 'A23 L2' = '0' 'Wh'
'1.1.62.8.0.255', 'Actual energy A23 L3', 'A23 L3' = '0' 'Wh'
'1.1.21.8.0.255', 'Actual energy A14 L1', 'A14 L1' = '11202040' 'Wh'
'1.1.41.8.0.255', 'Actual energy A14 L2', 'A14 L2' = '3743320' 'Wh'
'1.1.61.8.0.255', 'Actual energy A14 L3', 'A14 L3' = '3769750' 'Wh'
PACKET END

if you add the parameter -r you will get the raw DLMS output like (note that values are scaled funny so e.g. the value received from 1.1.31.7.0.255 (I L1) should be understood as val*10mA. also there are no units in the raw format. This has been taken care of in the formatted output above).

2020-09-02T23:05:55.3468514Z ENCRYPTED PACKET RECEIVED 2020-09-03 (04) 01:05:50.00 ???? 128 00000000
'1.1.0.2.129.255' = 'Kamstrup_V0001'
'1.1.1.8.0.255' = '1775544'
'1.1.2.8.0.255' = '176078'
'1.1.3.8.0.255' = '72073'
'1.1.4.8.0.255' = '155502'
'1.1.0.0.1.255' = '12345678'
'1.1.1.7.0.255' = '1494'
'1.1.2.7.0.255' = '0'
'1.1.3.7.0.255' = '0'
'1.1.4.7.0.255' = '185'
'0.1.1.0.0.255' = '2020-09-03 (04) 01:05:50.00 ???? 128'
'1.1.32.7.0.255' = '232'
'1.1.52.7.0.255' = '232'
'1.1.72.7.0.255' = '232'
'1.1.31.7.0.255' = '440'
'1.1.51.7.0.255' = '122'
'1.1.71.7.0.255' = '165'
'1.1.21.7.0.255' = '917'
'1.1.41.7.0.255' = '217'
'1.1.61.7.0.255' = '360'
'1.1.33.7.0.255' = '94'
'1.1.53.7.0.255' = '77'
'1.1.73.7.0.255' = '99'
'1.1.13.7.0.255' = '99'
'1.1.22.7.0.255' = '0'
'1.1.42.7.0.255' = '0'
'1.1.62.7.0.255' = '0'
'1.1.22.8.0.255' = '272043'
'1.1.42.8.0.255' = '0'
'1.1.62.8.0.255' = '0'
'1.1.21.8.0.255' = '1120202'
'1.1.41.8.0.255' = '374332'
'1.1.61.8.0.255' = '376974'
PACKET END

When running the code you may get an error that .NET Core is not available in which case you need to install it first.