-
Notifications
You must be signed in to change notification settings - Fork 6
/
gindata.txt
258 lines (238 loc) · 7.75 KB
/
gindata.txt
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
Ginlong data format:
#################
#################
## ##
## WiFi Stick ##
## ##
#################
#################
This first section is for the WiFi version of the Gonlong Data Logging Stick.
TCP and UDP are 2 methods used for sending data around a network - TCP sets up a connection and sends further messages on that connection with each message numered: this allows for checking whether messages all arrive at their destination. UDP is more fire-and-forget - there is no continuing conection creted, and all messages are sent out with no check on their arrival. A benefit of UDP is that there is less traffic (no set-up or tear-down of the conneciton required), and there is no problem of "stale" connections, where the recipient loses track of the connection, but the sender is not immediately informed of this. I show the structure for both TCP-based and UDP-based messages.
With a TCP connection, there is just one message type (a "long" one) which sends information about the electricity being generated by the solar panels. With UDP, there is a similar "long" message, and a shorter message which just gives inverter information.
I use Byte 12 of the UDP messages to differentiate long and short ones (81=long, 80=short)
The rows below give the byte number (starting at zero), then the value in the TCP message, the UDP long message, and the UDP short message.
Note that for number stored in multiple bytes, the first byte is the most significant, so for example, 0x01 followed by 0x34 would be 1 times 256, plus 0x34.
The "Start of Data" byte is 0x68, while the "End Of Data" byte is 0x16. The "checksum" byte at the end is found by adding up each of the bytes in the message (exclusing the Start and End of data bytes and the checksum byte itself), and getting the result modulo 256.
T U1 U2
0: 68 68 68 Start of Data (not included in checksum)
1: 59 59 29 11 less than length of data excluding SOD, Checksum and EOD
2: 51 51 51
3: b0 b0 b1 b0 for long messages, b1 for short
4: 7b 7b 7b
5: ec ec ec
6: 3e 3e 3e
7: 24 24 24
8: 7b 7b 7b
9: ec ec ec
10: 3e 3e 3e
11: 24 24 24
12: 81 81 80 81 for long ones, 80 for short
13: 01 01 01 Country standard = UK
14: 05 05 48 Power curve version?
15: 30 30 34 T and U1 = 000608111111-001 (inverter number)
16: 30 30 2e U2 = 4.01.51Y4.0.02W1 (start of Firmware)
17: 30 30 30
18: 36 36 31
19: 30 30 2e
20: 38 38 35
21: 31 31 31
22: 31 31 59
23: 31 31 34
24: 31 31 2e
25: 31 31 30
26: 31 31 2e
27: 2d 2d 30
28: 30 30 32
29: 30 30 57
30: 31 31 31
below U2 continues firmware = .0.57(GL17-07-261-D)V (45=checksum, 16=EOD)
31: 01 01 2e T & U1: Either 00 or 01
32: 24 24 30 Temperature?
33: 09 09 2e 33-34 VDC1 (all V and I are *10) - for example, 0x0954 -> 238.8V
34: 7e 54 35
35: 09 09 37 35-36 VDC2
36: 40 54 28
37: 00 00 47 37-38 VDC3 (n/a here)
38: 00 00 4c
39: 00 00 31 39-40 IDC1
40: 15 15 37
41: 00 00 2d 41-42 IDC2
42: 12 12 30
43: 00 00 37 43-44 IDC3 (n/a here)
44: 00 00 2d
45: 00 00 32 45-46 IAC1
46: 28 28 36
47: 00 00 31 47-48 IAC2 (n/a here)
48: 00 00 2d
49: 00 00 44 49-50 IAC3 (n/a here)
50: 00 00 29
51: 09 09 56 51-52 VAC1
52: 86 86 00
53: 00 00 45 53-54 VAC2 (n/a here)
54: 00 00 16
55: 00 00 55-56 VAC3 (n/a here)
56: 00 00
57: 13 13 57-58 Frequency*100 (here 49.98)
58: 86 86
59: 03 03
60: cf cf
61: 00 00
62: 00 00
63: 00 00
64: 00 00
65: 00 00
66: 0a 0a
67: 04 04 67-68 Yesterday's energy*100 (but day ends midnight China time)
68: 88 88
69: 02 02 69-70 Today's energy*100 (ditto)
70: 9e 9e
71: 00 00 71-74 (4 bytes) Total energy*10
72: 02 02
73: 7e 7e
74: 98 98
75: 00 00 75-86 fixed data?
76: 00 00
77: 00 00
78: 00 00
79: 00 00
80: 00 00
81: 00 00
82: 00 00
83: be be
84: 36 36
85: 04 04
86: 01 01
87: 00 00 87-88 Power this month (no multiplier)
88: 8a 8a
89: 00 00
90: 00 00
91: 02 02 91-92 Power last month (no mult)
92: 1b 1b
93: 00 00
94: 00 00
95: 00 00
96: 00 00
97: 00 00
98: 00 00
99: 00 00
100: 00 00
101: b1 9b Checksum - add all bytes from 2nd to previous one (here, 1 to 100 inclusive), mod 256
102: 16 16 Always 16 (End of Data)
################
################
## ##
## LAN Stick ##
## ##
################
################
This second section is for the LAN (wired) version of the Ginlong Data Logging Stick.
I found that the Access Point in the WiFi stick would always use the same channel as the one used by the WiFi network it connects to, leading to interference (setting the AP to low power didn't seem to help, and there was no way to turn the AP off). To get round this, and since I had a network switch in the loft near to the inverter, I bought a LAN-based stick and wired that to my switch. Configuration was similar to that of the WiFi stick, though it only allowed 1 extra remote server in addition to the main GinLong one (the WiFi one allowed 2 more). The data below assumes that the settings for the remote server are; UDP, Short Connection, IP Address as Prior, Data packets do not require response, Errors loaded proactively, and 5 minutes (for the message rate).
Note that, unlike the WiFi stick, for numbers stored in multiple bytes, the first byte is the least significant, so for example, 0x34 followed by 0x01 would be 1 times 256, plus 0x34.
The "Start of Data" byte is 0x45, while the "End Of Data" byte is 0x15. The "checksum" byte at the end is found by adding up each of the bytes in the message (exclusing the Start and End of data bytes and the checksum byte itself), and getting the result modulo 256.
I haven't yet worked out what the short message is. It's sent every minute, and the bytes near the end seem to count up. maybe time that the Logger has been up?
Byte: U1 U2
0: a5 a5 Start of data
1: 5c 01 U1 - length -11?
2: 00 00
3: 10 10
4: 02 47
5: 6f 72
6: 2c 32
7: 8a 8a
8: 1e 1e
9: ca ca
10: 71 71
11: 01 00
12: 01 df Possibly Country Standard (1 = UK)
13: 05 15 Possibly Power Curve
14: 65
15: 2e
16: 04
17: 00
18: 1e
19: 05
20: 00
21: 00
22: 33
23: e5
24: 3f
25: 5f
26: 01
27: 00
28: 72
29: 06
30: 00
31: 00
32: 30
33: 30
34: 31 Logger Serial Number
35: 39 = '1909170474'
36: 30
37: 39
38: 31
39: 37
40: 30
41: 34
42: 37
43: 34
44: 2d
45: 30
46: 30
47: 31 End of Logger s/n
48: 2c 48-49 Temperature (deg C) * 10 - 0x012c -> 30.0deg
49: 01
50: 36 50-51 VDC1 * 10 - 0x0936 -> 235.8V
51: 09
52: f9 52-53 VDC2 * 10 - 0x08f9 -> 229.7V
53: 08
54: 0d 54-55 IDC1 * 10 - 0x000d -> 1.3A
55: 00
56: 0b 56-57 IDC2 * 10 - 0x000b -> 1.1A
57: 00
58: 17 58-59 IAC1 * 10 - 0x0017 -> 2.3A
59: 00
60: 00 60-61 IAC2 * 10
61: 00
62: 00 62-63 IAC3 * 10
63: 00
64: 4d 64-65 VAC1 * 10 0 - 0x094d -> 238.1V
65: 09
66: 00 66-67 VAC2 * 10
67: 00
68: 00 68-69 VAC3 * 10
69: 00
70: 7f 70-71 Frequency*100 - 0x137f -> 49.91Hz
71: 13
72: 25 72-72 Current Watts * 10 - 0x0225 -> 54.9
73: 02
74: 00 ?
75: 00 ?
76: da 76-77 Today's Energy * 100 - 0x02da -> 7.3kWH
77: 02
78: 00
79: 00
80: 44 80-83 Total energy*10 - 0x0002a544 -> 17338.0kWH
81: a5
82: 02
83: 00
84: 00
85: 00
86: 00
87: 00
88: 00
89: 00
90: 00
91: 00
92: 00
93: 00
94: be Numbers here may be power this month and last month - not yet analysed!
95: 01
96: 04
97: 0b
98: 01
99: b3
100: 01
101: 36
102: 0a
103: 39 Checksum (add byes 1 to 102, modulo 256)
104: 15 End of Data