Guys......OK, this is what I know and/or think I know.
Using the protocol document referenced earlier in this thread I have been able to find and decode the battery and inverter data which is displayed on the Magnum web site. That is the site which is receiving the data stream from the Mag Web unit.
The Mag Web unit sends data every 30 seconds. That transmission consists of at least two binary data streams wrapped in HTML/TCPIP wrappers. Using the TCPFLOW function I am able to capture these records and convert the binaries to strings of hexadecimal numbers. In that form they are records of 40 and 87 hex characters respectively.
Using the protocol document I have been able to extract the following relationships between the hex characters in those records and the data which is displayed on the Magnum website. Note indexing starts at 0.
The 40 character record contains the State of Charge and the battery data. This data record starts with this hex string: 003c3c in positions 0-2.
1. State of Charge = 8 bit, hex character 24
2. Battery DC volts = 16 bit, hex characters 25 and 26. Divide by 100
3. Battery DC amps = 16 bit, signed hex characters 27 and 28. Divide by 10.
Note working with signed hex numbers is tricky
4. Minimum Battery Volts = 16 bit, hex characters 29 and 30. Divide by 100
5. Maximum Battery Volts = 16 bit, hex characters 31 and 32. Divide by 100
6. Battery Amp Hours = 16 bit, signed hex characters 33 and 34
The 87 character record caused me some grief as, somewhat randomly, this record was broken into two parts, whose lengths add to 87. Just a program trap issue!!
Anyway, the Inverter record will have "d4" and "7f" for hex characters 10 and 11, respectively. If not, ignore the record.
The data extraction follows, again note indexing starts at 0:
7. Inverter Status = 8 bit, hex character 27
8. Inverter Fail Code = 8 bit, hex character 28
9. DC Volts = 16 bit, hex characters 29 and 30. Divide by 10
10. DC Amps = 16 bit, hex characters 31 and 32
11. AC Volts Out = 8 bit, hex character 33
12. AC Volts In = 8 bit, hex character 34
13. Inverter LED = 8 bit, hex character 35
14. Charger LED = 8 bit, hex character 36
15. Inverter Revision = 8 bit, hex character 37. Divide by 10
16. Battery Temperature = 8 bit, hex character 38
17. Transformer Temperature = 8 bit, hex character 39
18. FET Temperature = 8 bit, hex character 40
19. Stack Mode = 8 bit, hex character 41
20. Inverter Mode = 8 bit, hex character 42
21. AC Input Amps = 8 bit, hex character 43
22. AC Output Amps = 8 bit, hex character 44
23. AC Frequency = 16 bit, hex characters 45 and 46. Divide by 10
I know of two outstanding issues and they seem to involve the Amps when the system is being charged (generator and maybe solar?). I will investigate these the next time I'm at the cabin.
My Raspberry Pi setup is as follows:
1. It can be most any favor of Raspberry Pi. I have used both a B+ and V2.
2. The OS needs to be Jessie, or one that is compatible with TCPFLOW. Wheezy does not support TCPFLOW.
3. The Pi is set up as a "bridge" using the on-board Ethernet as eth0 and an Ethernet dongle at eth1. As far as I know you can not set up a "bridge" using a WiFi instead of eth0.
4. eth0 is connected to my router network and eth1 to the Mag Web unit.
In this way, the records pass through the Pi and proceed on the the Magnum server. But, the contents is recorded locally for inspection and processing.
Here is a tester Python program to collect and display the records coming from the Mag Web unit.
Note, you will need to specify the IP address for your unit in the "tcpflow = subprocess" line. Normally the Mag Web unit uses DHCP to get that address. I have not looked into setting it up for a static address.
Also note that the very first record is always messed up. I suspect it is a partial transmission??
# binascii is a set of routines for processing binary data to HEX and Decimal
nul_f = open('/dev/null', 'w')
print "Setting up PIPE and waiting for Magnum records\n"
# try loop for clean breakout with cntl-C
# following code is for running the listener script inside of this pgm
tcpflow = subprocess.Popen(['/usr/bin/sudo /usr/local/bin/tcpflow -B -C -0 -i eth1 -o /mnt/usbdrive/TCPFLOW/ host 192.168.xx.yy'],
# read data being piped from TCPFLOW script
gline = tcpflow.stdout.readline()
strLenGline = str(len(gline))
print "\r\nRecord Length is " + strLenGline
# this line converts the binary record from the pipe into a Hex string
strHexGline = str(binascii.hexlify(gline))
print "\r\nMagnum Record is " + strHexGline
print('\r\nDone. ' + str(i) + " Records Read")
# clean up pipe stuff
Have fun and let me know if you find errors or make additional discoveries.......RDK