So been working on this for a LONG time. i work for a sort of electrical company (sort of meaning they branch into R&D and thats the team im part of).
We were asked to look into the development of Smart Electrical meters (as the ones available now will only last 5-6 yeas before they break... their words not ours) so we started by using the Raspberry Pi and USB optical port they provided. We had it working all nice and well but we never liked how pricey/overkill it was. We switched to Arduino in September last year(2015) so you can see how long this has taken.
The company offered no help with their supposedly "open" standard as is common practice these days.
Anyway enough of my complaining.
I have 2 codes to share with you.
The first is my re-wright of the Development code we were using. We found it works for the P2000-T but not the DLMS/COSEM version. This code is untested but for those who cant wait it may be worth a shot. (it does compile so should work).
See attached Version3-8.tex (standard text document)
The second is a version that worked using DLMS/COSEM, I dont have i right now but will release it tomorrow when i get back from work.
If you plan to use any of these codes i would prefer if you learn the sections any make your own versions rather than just running these versions. There are a few bugs with them (Like the data offset) that im still trying to correct.
I offer no guarantee that any of these will work.
For a simple guide, read the following.
To Handshake with a meter send the following "/?!\r\n" hex: 2F 3F 21 0D DA
To set mode send the following "ACK 0 5 1 \r\n" hex: 06 30 35 31 0D DA
To send the OBIS send "SOH R 1 STX --OBIS-- ( ) ETX" hex : 01 52 31 02 --OBIS-- 28 29 03
Thanks for sharing.. do you have a link and/or photo of the meters you are working with? Sometimes the same unit is called different things in different markets.
I dont suppose you have the Raspberry Pi code?
I would like to be able to interrogate my smart meter but the "standards" document costs 320 swiss francs..
Ok been to work today and tested the code and it seemed to work ok. (there were some glitches but pretty sure that was part of the meter and not the code).
So firstly, in my OP i mentioned i had a working DLMS/COSEM code. I was mistaken on this point due to the C2000 meter supporting some IEC standard to get Date, Time and meter number but this standard will not produce any more information.
This however does work with the P2000-T which fully supports the correct IEC standard.
I have attached bother meters so you can see them and i am using port 30 as A and 31 as B (for MODBUS; both are dual wire modbus complaint connection ports.)
so to be clear: "I DONT KNOW ANYTHING ABOUT DLMS/COSEM"
^to stop people wasting their time with this if thats what they are looking for. I am working to figure it out but it seems to be a tricky standard and incorporates ASN1 as well.
(ASN.1 - Wikipedia)
seems to be a good resource on DLMS/COSEM: DLMS/COSEM components
I have also provided a screenshot of the schematic i used to connect using the Arduino Nano as well as a PCB layout schematic.
So for the next few codes.
I created a "brute force" style OBIS checker which just cycles through each OBIS code in sequence. If your device supports the IEC standard it should find every piece of data there is stored and alert you to which ones you can use, (its not fully tested and requires you to watch the screen).
This is Attachment - Brute1-0
(ok cant find this when i cloned my entire Arduino folder ... must be saved on the NAS at work so was spared the copy, sorry. ill get it as soon as i can)
The other is the fully fledged version we created as a team including some simple Bluetooth Communication to an app we also made. Please do not copy this! Use it as an learning example as its very buggy and has a really annoying data offset that i cant seem to find/fix.
This is Attachment MumV3-1-BT
To answer your last question, Yes we have a version that runs on the Raspberry Pi using the USB Optical port on the meter however my filing structure is a mess and i forgot to copy that too. I will get a copy and share that also as soon as i get chance. (i need to work on a better filing structure rather than just a folder called Work filled with everything and even non work stuff )
Round 3 ....
So the meter we have comes with a software package and that happens to log "frames" that it sends and recieves from the meter.
These are DLSM/COSEM - ASN 1 frames but i had a look through and noticed a few patterns...
Im attaching the frames and the analysis text files so everyone else can have a look and maybe pitch in.
Note: please use notepad++ for the analysis file as it contains non-standard ascii characters (SOH STX ETX etc...)
Non of those solutions would work for myself or anyone using a government rented property (council house).
The main point is you cannot touch any of the electrical systems, not even to put a CT round them. Anything you do will be classed as tampering and you will be fined.
The point is to replace the meters in a way that lets you see the data it stores in a friendly way and to help you understand volts, amps, kWh etc...