CMS2000 inverter RS232 Serial Port Hack. (CMS 2000 RS232)..

The latest and greatest cells. New technologies, anything on the forefront of solar tech.

Re: CMS2000 inverter RS232 Serial Port Hack. (CMS 2000 RS232)..

Postby glenhendry » Sun Aug 22, 2010 5:39 pm

For those using the python scripts to interrogate the CMS2000 inverter on a 64 bit windows7 machine, I could only get the python serial port module (v2.5) installed over the top on the 32bit python (v2.7). If I tried to use the 64 bit version of python, the python serial comms module could not find the windows python installation.
glenhendry
 
Posts: 9
Joined: Thu Aug 05, 2010 5:22 pm

Re: CMS2000 inverter RS232 Serial Port Hack. (CMS 2000 RS232)..

Postby glenhendry » Thu Oct 21, 2010 9:08 am

For those with the time or inclination:
The stats from my CMS2000 are posted at http://www.pachube.com/feeds/9153
The pics of the install are at www.glenhendry.blogspot.com
glenhendry
 
Posts: 9
Joined: Thu Aug 05, 2010 5:22 pm

Re: CMS2000 inverter RS232 Serial Port Hack. (CMS 2000 RS232)..

Postby pocketscience » Fri Dec 24, 2010 1:00 pm

Hi all,

I've got an Orion inverter from Solar Energy Australia, but am having troubles getting it to respond over the RS232 port. I can't even get the Pro Control SW to talk to it. Is there something you need to do to enable RS232 comms, or is it always on and should be responding when it gets the appropriate queries?

I'm building a wireless (Xbee) transponder to send the stats to a remote that displays graphs etc, and possibly upload to Pachube. However I need to get it to talk to Pro Control for starters.

Any thoughts appreciated. I'm using a MacBook Pro with VMware Fusion and a known good USB/serial converter (used it before with my car EFI system).


Cheers,
pocketscience
 
Posts: 3
Joined: Fri Dec 24, 2010 12:50 pm
Location: Sydney

Re: CMS2000 inverter RS232 Serial Port Hack. (CMS 2000 RS232)..

Postby JinbaIttai » Fri Dec 24, 2010 1:19 pm

As far as I know the RS232 is "always on" - at least I did not have to do anything on the CMS2000, nor have I seen any mention of anyone having any problems - other than the ovious one which is that unless you have the right software (ie pro control) or know the magic commands required to write your own, the inverter appears to be mute. Hence this thread :)

The only thing I can think of is that you have the same problem I had with my bluetooth->rs232 converter, which is that hardware handshaking is always enabled despite what the software says.

This means your system will not send any data until the rts signal is received. I worked around this by shorting pins 7 and 8 (rts and cts) together (at the serial converter)

Either that or perhaps you have a different model Orion not built by Phoenixtec. Does your inverter look like the ones in the pictures on the first page of this thread? (other than the colour)

- Matt
User avatar
JinbaIttai
 
Posts: 29
Joined: Tue Feb 09, 2010 11:13 pm

Re: CMS2000 inverter RS232 Serial Port Hack. (CMS 2000 RS232)..

Postby pocketscience » Fri Dec 24, 2010 2:22 pm

Hey Matt,

Thanks for the reply. I'll try shorting the pins. The only other problem might be that mine is blue... not red! :-)


Cheers,
pocketscience
 
Posts: 3
Joined: Fri Dec 24, 2010 12:50 pm
Location: Sydney

Re: CMS2000 inverter RS232 Serial Port Hack. (CMS 2000 RS232)..

Postby Inspector » Fri Dec 24, 2010 3:25 pm

I may have mentioned earlier in this thread that I found every time I restarted WinXP, I had to open HyperTerminal (I'm sure there's a similar program for the Mac) and set the baud rate to 9600. Once I'd closed Hyperterminal, and opened ProControl, it would then recognise the inverter - but only for that day. I had to restart ProControl every morning after the inverter had turned on before they would be recognised by ProControl again. The other problem I had was ProControl would only talk to one inverter at a time. Thankfully the RS232-USB adaptor (with "Prolific" driver) solved all issues.
Just because it works doesn't mean it's safe!
Inspector
 
Posts: 32
Joined: Sun May 09, 2010 9:44 pm
Location: under the sun

Re: CMS2000 inverter RS232 Serial Port Hack. (CMS 2000 RS232)..

Postby pocketscience » Fri Dec 24, 2010 3:57 pm

Hmm, using Free Serial Port Monitor I can see that RTS is high - and that Pro Control is sending data down the line, but nothing is coming back from Pro Control.

Launching HyperTerminal had zero affect.

Time for a new adaptor methinks...


Cheers,
pocketscience
 
Posts: 3
Joined: Fri Dec 24, 2010 12:50 pm
Location: Sydney

Re: CMS2000 inverter RS232 Serial Port Hack. (CMS 2000 RS232

Postby shell_l_d » Fri Jan 28, 2011 9:14 am

Hi JinbaIttai ... per your post on pg1 (20May2010), may I ask if inverter_v2.pl.txt is the latest version, as I'd love to have a look/play with it. I have a CMS2000 & a work colleague has a CMS10000. :)
Regards
Shell :)
shell_l_d
 
Posts: 77
Joined: Fri Jan 28, 2011 9:02 am

Re: CMS2000 inverter RS232 Serial Port Hack. (CMS 2000 RS232

Postby JinbaIttai » Sat Jan 29, 2011 5:40 pm

Hi shell_l_d

My apologies, despite having "Notify me when a reply is posted" I did not see your reply in this thread until your private message.

Yes, the inverter_v2 I posted last May is the script I've been running successfully since then, in fact I just compared the one I uploaded with the one currently running and the only thing I changed was line 205 - I changed if ($pollcount > 20) { to if ($pollcount > 5) { so that it starts up 15 seconds earlier in the mornings :mrgreen:

I have also uploaded the script I used to poll the CMS-10000, for your work colleague. That one was also working great, unfortunately the RS232 interface on that inverter stopped working suddenly and I haven't had access to it to figure out why. Let me know if it works for your Colleague, and if there is anything I can do to assist.

- Matt
Attachments
10kinverter.pl.txt
script for polling CMS-10000 inverter via RS232
(9.31 KiB) Downloaded 94 times
User avatar
JinbaIttai
 
Posts: 29
Joined: Tue Feb 09, 2010 11:13 pm

Re: CMS2000 inverter RS232 Serial Port Hack. (CMS 2000 RS232

Postby shell_l_d » Sat Feb 05, 2011 3:55 pm

Further to Ingmar & JinbaIttai's posts on page 2...

Wonder if there's a confirmed list of inverter codes somewhere & if the same codes for CMS2000 & SE2800 & SE4600 are used on other inverters?

inverter hex data format reply codes (bytes 10 & on)...
Code: Select all
use constant {
    TEMP   => "00",
    VPV1   => "01",
    VPV2   => "02",
    VPV3   => "03",
    LPV1   => "04",
    LPV2   => "05",
    LPV3   => "06",
    ETODAY => "0D",
    VPV    => "40",
    LAC    => "41",
    VAC    => "42",
    FAC    => "43",
    PAC    => "44",
    ZAC    => "45",
    UNK1   => "47",
    ETOTAL => "48",
    UNK2   => "49",
    HTOTAL => "4A",
    MODE   => "4C",
    UNK3   => "78",
    UNK4   => "79",
    UNK5   => "7A",
    UNK6   => "7B",
    UNK7   => "7C",
    UNK8   => "7D",
    UNK9   => "7E",
    UNK10  => "7F"
};


For CMS2000 v1&2, SE2800, SE4600 (hex without spaces of course :) )...

* Request inverter data format:
SEND: AA AA 01 00 00 01 01 00 00 01 57

RECV: AA AA 00 01 01 00 01 80 14 00 40 41 42 43 44 45 47 48 49 4A 4C 78 79 7A 7B 7C 7D 7E 7F 08 C4 = CMS2000 v2
RECV: AA AA 00 01 01 00 01 80 15 00 0D 40 41 42 43 44 45 47 48 49 4A 4C 78 79 7A 7B 7C 7D 7E 7F 08 D2 = CMS2000 v1, SE2800
RECV: AA AA 00 01 01 00 01 80 1B 00 01 02 03 04 05 06 0D 40 41 42 43 44 45 47 48 49 4A 4C 78 79 7A 7B 7C 7D 7E 7F 08 ED = SE4600

* Request inverter data:
SEND: AA AA 01 00 00 00 00 00 00 01 55
SEND: AA AA 01 00 00 01 01 02 00 01 59

RECV: AA AA 00 01 01 00 01 82 28 01 6B 0B BA 00 17 09 = CMS2000 v2
E7 13 8C 02 24 FF FF 00 00 45 49 00 00 0A D4 00
01 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
00 08 69
RECV: AA AA 00 01 01 00 01 82 2A 01 F0 02 14 0A 94 00 = CMS2000 v1
2B 09 DD 13 8F 04 39 FF FF 00 00 08 E5 00 00 01
8F 00 01 00 00 00 00 00 00 00 00 00 00 00 00 00
00 00 00 09 14
RECV: AA AA 00 01 01 00 01 82 2A 01 6B 00 39 0C 3D 00 = SE2800
20 09 5D 13 90 02 FB FF FF 00 00 01 21 00 00 00
1B 00 01 00 00 00 00 00 00 00 00 00 00 00 00 00
00 00 00 07 53
RECV: AA AA 00 01 01 00 01 82 36 01 7B 0A 5E 0A 32 00 = SE4600
00 00 2C 00 2E 00 00 00 A3 0A 5E 00 5C 09 00 13
8F 08 82 00 00 00 00 3D 51 00 00 06 25 00 01 00
00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 06
DF
Regards
Shell :)
shell_l_d
 
Posts: 77
Joined: Fri Jan 28, 2011 9:02 am

Re: CMS2000 inverter RS232 Serial Port Hack. (CMS 2000 RS232

Postby shell_l_d » Sun Feb 06, 2011 3:41 pm

Does anyone have a protocol reading for a CMS10000 please & for other CMS / SUN EZY / ORION inverter models please?
& a copy of the values from procontrol or similar to show what the values were around that time. :)

Have edited JinbaIttai's perl script, thanks to JinbaIttai & Ingmar's posts on page 2... so it should work for multiple PHOENIXTEC manufactured inverters (CMS/SunEzy/Orion/...) & platforms (Win/Linux/Unix) now, but specifically for:
* CMS2000 type 1 & 2 (1 has etoday, 2 doesn't)
* CMS10000 (more testing needed & dont have protocol readings)
* SE2800
* SE4600
(as had access to protocol readings for these)

Serial Communication Protocol files can be created per this post page2... :)
Ingmar wrote:Hi Matt :P ,

I was looking for the communication log.
There is a free program from HHD software that runs in parallel with the ProControl (or SunEzy Control). You can download it from http://www.serial-port-monitor.com/.

You need to start the program first, then the Control software, log some stuff, then close the Control program and finally the monitor software. It leaves the port open. The window you need is the Request view. Self explaining when you run the program.

The output is like attached to this post.
Regards
Shell :)
shell_l_d
 
Posts: 77
Joined: Fri Jan 28, 2011 9:02 am

Re: CMS2000 inverter RS232 Serial Port Hack. (CMS 2000 RS232

Postby garfin » Thu Feb 10, 2011 11:28 pm

Hi Perl script guru's,

I've (JUST) got a pair of KLNE Sunteams2000 inverters (running firmware A4.14) installed, and was hoping to get the perl script altered to suit...

Here's what i can tell you of these devices so far...

SEND -> aaaa010000000004000159
SEND -> aaaa010000000000000155
RECV <- aaaafe00000000800a413246534131333035340526 OK
SEND -> aaaa0100000000010c41324653413133303534000103ad
RECV <- aaaafe0100000081010602db OK
SEND -> aaaa010000010100000157
RECV <- aaaafe0100000180011502ea OK
SEND -> aaaa010000010102000159
RECV <- aaaafe01000001822801140d5400020973138900270000000000160000000131010000000000000000000000000000000004fe OK


and


SEND -> aaaa010000000004000159
SEND -> aaaa010000000000000155
RECV <- aaaafe00000000800a413246534131393039370533 OK
SEND -> aaaa0100000000010c41324653413139303937000103ba
RECV <- aaaafe0100000081010602db OK
SEND -> aaaa010000010100000157
RECV <- aaaafe0100000180011502ea OK
SEND -> aaaa010000010102000159
RECV <- aaaafe010000018228010e0cd80002097d138a0022000000000016000000013101000000000000000000000000000000000581 OK


help please?
garfin
 
Posts: 24
Joined: Thu Feb 10, 2011 11:20 pm

Re: CMS2000 inverter RS232 Serial Port Hack. (CMS 2000 RS232

Postby JinbaIttai » Fri Feb 11, 2011 12:25 am

Hi Garfin

Very interesting.. your data packet looks almost identical to the output from my CMS2000 but the handshake is slightly different

SEND -> aaaa010000000004000159
reset network
SEND -> aaaa010000000000000155
query network
RECV <- aaaafe00000000800a413246534131333035340526
inverter responds with serial number - but the header of this packet is aaaafe00 not aaaa0001 - perhaps to signify a newer version of the protocol.
SEND -> aaaa0100000000010c41324653413133303534000103ad
this is different also - for some reason another byte is inserted (00) between the serial number and the 01. Perhaps this allows for more than 255 inverters on the same RS485 bus :shock:
RECV <- aaaafe0100000081010602db
and the inverter response with "OK" - again with aaaafe01 header.
SEND -> aaaa010000010100000157
query for capabilities (normal request)
RECV <- aaaafe0100000180011502ea
and this is completely different from every other inverter we've analysed on this thread.
SEND -> aaaa010000010102000159
normal data request
RECV <- aaaafe01000001822801140d5400020973138900270000000000160000000131010000000000000000000000000000000004fe
and a normal looking data response, with 40 bytes - same as my CMS2000.
In fact, your data packet looks almost (but not quite) identical to mine. I ran it through my parser and got this result:

temp: 27.6 deg C
Vdc: 341.2 V
Iac: 0.2 A
Vac: 241.9 V
Fac: 50.01 Hz
Pac: 39 W
kWh: 2.2 kWh
run: 1 hours
mod: 12545

All those values look plausible, except the very last one - assuming you did in fact only JUST plug them in, less than an hour before getting this data reading :)
User avatar
JinbaIttai
 
Posts: 29
Joined: Tue Feb 09, 2010 11:13 pm

Re: CMS2000 inverter RS232 Serial Port Hack. (CMS 2000 RS232

Postby garfin » Fri Feb 11, 2011 5:53 am

JinbaIttai wrote:Hi Garfin
SEND -> aaaa0100000000010c41324653413133303534000103ad this is different also - for some reason another byte is inserted (00) between the serial number and the 01. Perhaps this allows for more than 255 inverters on the same RS485 bus :shock:

RECV <- aaaafe01000001822801140d5400020973138900270000000000160000000131010000000000000000000000000000000004fe and a normal looking data response, with 40 bytes - same as my CMS2000.
In fact, your data packet looks almost (but not quite) identical to mine. I ran it through my parser and got this result:

temp: 27.6 deg C
Vdc: 341.2 V
Iac: 0.2 A
Vac: 241.9 V
Fac: 50.01 Hz
Pac: 39 W
kWh: 2.2 kWh
run: 1 hours
mod: 12545

All those values look plausible, except the very last one - assuming you did in fact only JUST plug them in, less than an hour before getting this data reading :)



Hi , unsure on why the extra byte in the handshake, but i guess that will be an easy change..

mod:12545 ?? what is this value representing? The installation of the inverters was barely 24 hours old when this read was taken, and inverters have only been switched on one or twice, for a few minutes at a time, just to test/take readings, as the electrical inspector has yet to visit and sign-off on install...
garfin
 
Posts: 24
Joined: Thu Feb 10, 2011 11:20 pm

Re: CMS2000 inverter RS232 Serial Port Hack. (CMS 2000 RS232

Postby shell_l_d » Fri Feb 11, 2011 8:28 pm

Here's the latest perl script... hope u dont mind Matt (JinbaIttai) :)

P.S. haven't confirmed final changes actually work as inverter had shut down for the night, can test tomorrow.

Hi Garfin, to make it work for your Sun Team 2000, you may only need to uncomment the 4 constants (lines) marked with "# ST2000" & comment out the duplicates. Let me know if it works. Not sure about the VERSION request though as it wasn't in your above data polls. :)

Code: Select all
    RECV_INIT             => "00000100",      # BCAST_ADDR + SRC_ADDR
    # RECV_INIT             => "fe000000",                        # ST2000
    RECV_QRY              => "00010100",      # DEST_ADDR  + SRC_ADDR
    # RECV_QRY              => "fe010000",                        # ST2000

    REQUEST_CONF_SERIAL_1 => PKT_START . SEND_INIT . "00010b",
    # REQUEST_CONF_SERIAL_1 => PKT_START . SEND_INIT . "00010c",               # ST2000
    REQUEST_CONF_SERIAL_2 => "01",
    # REQUEST_CONF_SERIAL_2 => "0001",                           # ST2000
Last edited by shell_l_d on Sat Feb 12, 2011 9:06 am, edited 2 times in total.
Regards
Shell :)
shell_l_d
 
Posts: 77
Joined: Fri Jan 28, 2011 9:02 am

Re: CMS2000 inverter RS232 Serial Port Hack. (CMS 2000 RS232

Postby garfin » Fri Feb 11, 2011 9:48 pm

shell_l_d wrote:Here's the latest perl script... hope u dont mind Matt (JinbaIttai) :)

P.S. haven't confirmed final changes actually work as inverter had shut down for the night, can test tomorrow.



Cheers for that , yeah i'll give it a shot tomorrow too..(once the sun comes out again..)
garfin
 
Posts: 24
Joined: Thu Feb 10, 2011 11:20 pm

Re: CMS2000 inverter RS232 Serial Port Hack. (CMS 2000 RS232

Postby JinbaIttai » Fri Feb 11, 2011 11:21 pm

Thanks Shell, I don't mind at all

You've been doing great work implementing the changes I've been meaning to make for the last year, but never got the time to make :)

Garfin: mod (mode) is supposed to represent the inverter status (1 for normal, 0 for offline) - not sure how that ended up as 12545.
User avatar
JinbaIttai
 
Posts: 29
Joined: Tue Feb 09, 2010 11:13 pm

Re: CMS2000 inverter RS232 Serial Port Hack. (CMS 2000 RS232

Postby garfin » Sat Feb 12, 2011 9:00 am

Thanks... a sample from my morning run...


root@ubuntu904server:/opt/solar/S0# ./inverter.pl
Name "main::respVersionRegex" used only once: possible typo at ./inverter.pl line 866.
Running on linux
logfile = /opt/solar/S0/log/inverter.txt
Starting up...
Send -> req init: aaaa010000000004000159
Send -> req serial: aaaa010000000000000155
Recv <- aaaafe00000000800a413246534131333035340526
Send -> confirm serial: RESPONSE_CONF_SERIAL_141324653413133303534RESPONSE_CONF_SERIAL_21333
Recv <-
Use of uninitialized value $respConfSerialRegex in regexp compilation at ./inverter.pl line 617.
Send -> req version: aaaa01000001010300015a
Recv <-
Send -> req data format: aaaa010000010100000157
Recv <-
Send -> req data: aaaa010000010102000159
POLL: 1...
Send -> req version: aaaa01000001010300015a
Recv <-
Send -> req data format: aaaa010000010100000157
Recv <-
Send -> req data: aaaa010000010102000159
POLL: 2...
Send -> req version: aaaa01000001010300015a
Recv <-
Send -> req data format: aaaa010000010100000157
Recv <-
Send -> req data: aaaa010000010102000159
POLL: 3...
Send -> req version: aaaa01000001010300015a
Recv <-
Send -> req data format: aaaa010000010100000157
Recv <-
Send -> req data: aaaa010000010102000159
POLL: 4...
Send -> req version: aaaa01000001010300015a
Recv <-
Send -> req data format: aaaa010000010100000157
Recv <-
Send -> req data: aaaa010000010102000159
POLL: 5...
Send -> req init: aaaa010000000004000159
Send -> req serial: aaaa010000000000000155
Recv <- aaaafe00000000800a413246534131333035340526
Send -> confirm serial: RESPONSE_CONF_SERIAL_141324653413133303534RESPONSE_CONF_SERIAL_21333
Recv <-
Use of uninitialized value $respConfSerialRegex in regexp compilation at ./inverter.pl line 617.
Send -> req version: aaaa01000001010300015a
Recv <-
Send -> req data format: aaaa010000010100000157
Recv <-
Send -> req data: aaaa010000010102000159
^C
root@ubuntu904server:/opt/solar/S0#




also, i am unable to get a copy of ProControl to work... probably because of the slightly different strings sent/expected by the SunTeams
garfin
 
Posts: 24
Joined: Thu Feb 10, 2011 11:20 pm

Re: CMS2000 inverter RS232 Serial Port Hack. (CMS 2000 RS232

Postby shell_l_d » Sat Feb 12, 2011 9:04 am

Just ran it & there were a couple of errors that needed fixing that I couldn't simulate last night with the inverter off... here's the ammended file :)
Last edited by shell_l_d on Sat Feb 12, 2011 11:09 am, edited 1 time in total.
Regards
Shell :)
shell_l_d
 
Posts: 77
Joined: Fri Jan 28, 2011 9:02 am

Re: CMS2000 inverter RS232 Serial Port Hack. (CMS 2000 RS232

Postby garfin » Sat Feb 12, 2011 9:14 am

shell_l_d wrote:Just ran it & there were a couple of errors that needed fixing that I couldn't simulate last night with the inverter off... here's the ammended file :)


THANKS , and here's the result.. :)


root@ubuntu904server:/opt/solar/S0# ./inverter.pl
Running on linux
logfile = /opt/solar/S0/log/inverter.txt
Starting up...
Send -> req init: aaaa010000000004000159
Send -> req serial: aaaa010000000000000155
Recv <- aaaafe00000000800a413246534131333035340526
Send -> confirm serial: aaaa0100000000010c41324653413133303534000103ad
Recv <- aaaafe0100000081010602db
Send -> req version: aaaa01000001010300015a
Recv <- aaaafe0100000183303130303230303041342e313420204d6f64656c3a20322e30204b57 202020496e766572746572203230303020333530300eb8
* Version info:
substr outside of string at ./inverter.pl line 680.
Use of uninitialized value $hexData in pack at ./inverter.pl line 680.
CAPACITY : 002000
FIRMWARE : A4.14 M
MANUF : Inverter 2000
MODEL : odel: 2.0 KW
OTHER :
SERIAL : 3500¸
Send -> req data format: aaaa010000010100000157
Recv <- aaaafe0100000180011502ea
* Data Format:
dataToFollow = hex(01) = 1
* Data Format1:
TEMP 0
VPV 1
LAC 2
VAC 3
FAC 4
PAC 5
ZAC 6
UNK1 7
ETOTAL 8
UNK2 9
HTOTAL 10
MODE 11
UNK3 12
UNK4 13
UNK5 14
UNK6 15
UNK7 16
UNK8 17
UNK9 18
UNK10 19
Send -> req data: aaaa010000010102000159
Recv <- aaaafe01000001822800ae0eea001009ae1389017b00020000001a000000043101000000 0000000000000000000000000006d5
* Data:
TEMP : 17.4 deg C
VPV : 381.8 V
LAC : 1.6 A
VAC : 247.8 V
FAC : 50.01 Hz
PAC : 379 W
ZAC : 2 mOhm
UNK1 : 0
ETOTAL : 2.6 kWh
UNK2 : 0
HTOTAL : 4 hrs
MODE : 12545
UNK3 : 0
UNK4 : 0
UNK5 : 0
UNK6 : 0
UNK7 : 0
UNK8 : 0
UNK9 : 0
UNK10 : 0
Send -> req data: aaaa010000010102000159
Recv <- aaaafe01000001822800ae0ef1000f09a41388017400020000001a0000000431010000000000000000000000000000000006c9
* Data:
TEMP : 17.4 deg C
VPV : 382.5 V
LAC : 1.5 A
VAC : 246.8 V
FAC : 50 Hz
PAC : 372 W
ZAC : 2 mOhm
UNK1 : 0
ETOTAL : 2.6 kWh
UNK2 : 0
HTOTAL : 4 hrs
MODE : 12545
UNK3 : 0
UNK4 : 0
UNK5 : 0
UNK6 : 0
UNK7 : 0
UNK8 : 0
UNK9 : 0
UNK10 : 0
garfin
 
Posts: 24
Joined: Thu Feb 10, 2011 11:20 pm

PreviousNext

Return to Tech Talk.

Who is online

Users browsing this forum: No registered users and 0 guests