Electric Meter RS485 read code.

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 :smiley: )

MumV3-1-BT.ino (6.28 KB)