Last time, we looked at how the PVS main board communicates with the LIB and found some tap-points for the various UARTs on the Line Input Board.
This time, let's look specifically at what the traffic between the main board and LIB looks like on those UARTs when the normal main board is present and running so we can understand how microinverter telemetry is acquired for eASIC-polled microinverters like the IQ7XS/IQ7AS/IQ7HS and SPWR-A5.
Right away we notice there are frequent bursts of bytes that start with 0x00 and end with 0x00. Here are a few from today:
11:56:50.122 00 03 aa 01 01 12 0d 26 6a 56 5f 35 43 53 0e b2 43 bb 86 2c 45 49 77 00
11:56:50.201 00 03 aa 01 01 12 0d 26 6a 6d 91 41 43 9c 30 b7 43 f6 97 2c 45 dc 54 00
11:56:50.359 00 03 aa 01 01 12 0d 26 6a 51 35 94 43 f1 b6 bb 43 7e a9 2c 45 75 2e 00
This sort of starting and ending with ASCII NUL - 0x00 - is one way to mark the start and end of data packets. But then you need to make sure 0x00 doesn't appear in the actual content, so you can use an encoding called COBS - Consistent Overhead Byte Stuffing.
Once we apply a COBS decoder to each frame, we can see the actual frame contents:
11:56:50.122 aa 01 00 00 0d 26 6a 56 5f 35 43 53 0e b2 43 bb 86 2c 45 49 77
11:56:50.201 aa 01 00 00 0d 26 6a 6d 91 41 43 9c 30 b7 43 f6 97 2c 45 dc 54
11:56:50.359 aa 01 00 00 0d 26 6a 51 35 94 43 f1 b6 bb 43 7e a9 2c 45 75 2e
In every frame, the first bytes are the same: aa 01 00 00 0d 26 6a. Whatever is there isn't changing within one second. A little more subtle: we can see that 0x43 and 0x45 are also the same in their respective positions across the frames.
11:56:50.359 aa 01 00 00 0d 26 6a 51 35 94 43 f1 b6 bb 43 7e a9 2c 45 75 2e
^^ ^^ ^^
And there's a nice symmetry there: they're all the same distance apart - 4 bytes. So probably we're looking at three 32-bit numbers of some kind that are fairly steady across intra-second readings. And since the last one doesn't have 4 bytes following it, it seems like the most significant bytes are last: Little Endian.
There are a few common ways we could interpret these bytes into 32-bit numbers: signed integers, unsigned integers, and floating-point numbers. Let's try that with just one number - the biggest one.
7e a9 2c 45 LE = 45 2c a9 7e BE = 1,160,554,878 as an integer - the same as signed or unsigned, because 0x45 = 01000101 in binary, so the first sign bit is 0.
45 2c a9 7e BE as a 32-bit IEEE 754 floating-point number is about 2762.59.
If we look at the other two numbers, we get an important hint: as integers, they're within a few percent of each other (about 1.14 billion), but as floats, they turn out to be a bit more different: 296.42 and 375.43.
At about this time, my panels were producing about 2.8 kW - 2,800 watts - of power and my home was consuming about 600 watts, so it seems likely that the large number is the production CT power value in floating-point format. We know that there's one production CT and there are two consumption CTs, so logically, the other two values are probably the consumption CT power values for L1 and L2. If we look at the values for L1 and L2 power at that time via the varserver API for /sys/devices/meter/1/p1Kw and p2Kw, that's about what we see, and the two consumption phases indeed sum close to the expected consumption total!
So what we are seeing, several times a second, is the power measurement for the production CT and consumption CTs.
The last 2 bytes look almost random over time, which is a sign that they're a checksum. 16-bit checksums are often CRC-16, like in Modbus. If we try CRC-16 over the prior bytes in the frame with some common polynomials/inits like Modbus, ARC, XMODEM, and so on, we get a bucket of disappointment - none of those match. But if we tell our close personal friend Claude "here are some frames, write a script to run some common 16-bit checksum algorithms over the bytes preceding the checksum and alert when one's result matches the actual checksum", we find out in short order that it's CRC-16/MCRF4XX - polynomial 0x1021, init 0xFFFF, reflected.
But isn't this a post about microinverter telemetry?
Yes, yes it is.
Sorry for the detour: if we don't have COBS framing and decoding to split up the data stream and fix the 0x00 bytes, we will be led astray on decoding the microinverter data - we will have other wildly varying numbers where we should have 0x00 which will be extremely confounding and frustrating. Ask me how I know!
And this is a nice toy example for showing how we figure out what's inside: look at what varies, look at what's fixed, use what we know about common data formats to get some candidate values, and see if that lines up with any parts of the system or data we have from other sources at the time of observation.
We know the microinverters communicate with the LIB over PLC - powerline communications. And we know they don't update every second of the day; we also know they update at least every 5 minutes based on the data update rate in the varserver API.
If we look at a longer capture, we see aa 01 prefixed frames of similar length several times a second, and some 62 prefixed frames of similar length about once a second. We can discard those from our capture to make it a bit easier to look at. Then there's this weird prefix - aa 06 - that does not have a consistent frame length. It only shows up every so often - for example, there was a gap from 11:54:39.803 to 11:56:50.722 where no aa 06-prefixed frames were seen. If we zoom out, we notice that there are bursts of aa 06 activity that reliably start about every 2.5 minutes - 150 seconds - which fits our criteria: less frequently than every few seconds, but more frequently than every 5 minutes, and 2.5 minutes is also an even divisor of the 5-minute interval that varserver updates on.
Looking at the frames themselves is a bit overwhelming because they're much longer than the aa 01 ones we looked at before. We see a few distinct lengths: 10 bytes, 45 bytes, 52 bytes, 92 bytes, and 136 bytes. Each of those is probably a different kind of request or response. We can cut down our focus to just one "burst", start to end, and make some inferences about it based on the shape of the system: my system has 12 panels, for example, so we expect to hear 12 microinverters tell us their state.
If we just look at the pattern of the lengths in the burst that starts at 11:56:50 AM, we see a pattern:
(W is main board to LIB; R is LIB to main board)
W 11:56:50.7 45 bytes
R 11:56:50.9 10 bytes
R 11:56:51.8 136 bytes
R 11:56:52.0 92 bytes
W 11:56:52.0 45 bytes
R 11:56:52.2 10 bytes
R 11:56:53.0 136 bytes
R 11:56:53.1 92 bytes
([45 + 10 + 136/92] pattern repeats 10 more times)
W 11:57:10.5 52 bytes
R 11:57:11.1 10 bytes
The short 10-byte frames are identical every time.
If we look at those 45-byte, 136-byte and 92-byte frames as hex dumps, something will jump out at folks who have spent way too long staring at their microinverter (MI) serial numbers: the MI serial numbers are visible in the raw hex of the 136-byte frames! It's always hanging out at bytes 35-41 of the 45-byte frame and bytes 29-35 of the 136-byte frame. That turns out to be packed binary coded decimal format.
So pretty clearly, the 45-byte frame is a request frame from the main board to the LIB saying "hey, please poll this MI now" and the 10-byte frame is an acknowledgement that the command is received; the 136/92-byte frames are telemetry from the 12 MIs in some format.
The 45-byte request frame from the main board to the LIB looks something like this:
aa 06 00 00 80 25 01 01 de af PP PP PP PP 00 02 SS SS 00 1b 07 22 01 01 6a fb 60 02 00 19 01 01 05 00 08 12 20 XX XX XX 17 00 00 RR RR
Several redactions here: 0xdeafPPPPPPPP is the PLC domain, where PPPPPPPP is a fixed hex value derived from the PVS's serial number, SSSS is a checksum over some bytes inside the frame, XX XX XX are the middle digits of my microinverter serial numbered in the PVS as E001220XXXXXX17, and RRRR is the CRC-16 checksum.
Here's a pair of redacted 136-byte and 92-byte frames from today:
aa 06 00 00 81 80 02 00 SS SS 00 b6 07 23 80 01 6a fb 60 02 00 19 00 01 01 03 00 00 55 12 20 XX XX XX 17 00 00 80 00 11 35 02 00 00 00 88 00 09 07 09 00 00 00 QQ QQ QQ QQ 5c 0d 42 48 YY YY YY YY YY YY YY YY YY YY YY YY 00 ZZ ZZ ZZ ZZ ZZ ZZ ZZ ZZ ZZ ZZ ZZ ZZ ZZ 00 53 53 75 6e 50 6f 77 65 72 de af PP PP PP PP 01 00 02 00 00 00 00 00 72 00 72 03 00 30 25 00 05 46 4e d9 00 00 0a d8 cb fd 47 53 00 03 d2 RR RR
aa 06 00 00 40 54 60 00 0c b7 cc 00 00 d4 83 00 00 11 04 00 00 00 00 00 00 00 00 05 6f 61 90 00 00 0e 01 3d 05 04 00 15 01 6a fb 1f 1e 00 e0 00 20 00 00 00 00 00 00 00 00 00 00 78 00 10 07 00 00 00 00 00 00 00 04 00 01 00 02 00 de af PP PP PP PP 02 00 00 00 6c 01 01 00 RR RR
Some more redactions: QQ QQ QQ QQ is some other fixed ID I haven't sorted out yet; the YY and ZZ bytes are seemingly the panel (Q44M...) and AC module serial numbers - they aren't always present.
From here, we get into the messy part. The fastest way to figure out all the fields in the frames is to store the frames and real-world data (e.g. power/current/voltage for each MI from varserver) to build a corpus, then use variances in the real-world data to line it up to variances in the frames. This can be done by hand; some fields are easier to discover than others. But this is the kind of problem LLMs excel at when given a quality corpus.
That means we need to capture a good variability of things we believe to be in the underlying telemetry - varying power, current, voltage, time of day, and so on. A few 15-minute captures on different days at different times of day are enough to sniff out most of the fields. We also don't have to understand the entire contents of the frame to use it to extract useful telemetry: some bytes won't correlate because we don't have access to their underlying data anywhere else.
If you use the statistical approach, it's important to be wary of spurious correlation. A quality long-term corpus largely avoids it. Nevertheless, it's worth doing "hold-out" tests where you keep frames out of the corpus and see if the predictions about the decoding hold up independently. You should also do some sanity-checking by hand.
The plus side of the LLM-statistical approach: it finds fields in units that would not be obvious at first glance even if we knew the correlation was high. For example, lifetime energy is displayed in the PVS as kilowatt-hours; in the telemetry, it's reported as millijoules, a scale factor of 1:3,600,000,000 - not one I use every day.
Goodies that fall out of the corpus with this approach:
- From byte 16,
6a fb 60 02, as an unsigned integer, 1794859010: UNIX fans will recognize this as epoch time for Monday, November 16, 2026 at 11:56:50 AM Pacific time. - From byte 29,
12 20 XX XX XX 17, the MI serial number in BCD - From byte 37,
80 00 11 35 02 00 00 00, the MI hardware part number (800-01135-r02) - From byte 61, the panel serial number (if present)
- From byte 74, some other kind of serial number or part number
- From byte 89,
53 75 6e 50 6f 77 65 72 - ASCII "SunPower" - From byte 97,
de af PP PP PP PP - the PLC domain - From byte 105,
02 - the MI's logical address on the PLC network. varserver numbers the MIs differently: this one is /sys/devices/inverter/6 - From byte 117,
25 - MI temperature; decimal 37 - 37°C - From byte 119,
05 46 4e d9 - operating time (it only counts while the MI is powered, so it stops overnight); decimal 88,493,785 seconds; about 1,024 days of operation. - From byte 125,
0a d8 cb fd 47 53 - lifetime energy; decimal 11,926,251,587,411 millijoules = 3,312.848 kWh
So oddly, there's an entire large frame that tells us almost nothing interesting - temperature and lifetime energy are about it.
Turning to the 92-byte frame:
- From byte 6, a strange one that makes correlation challenging: the low byte of AC voltage in millivolts; the high 3 bytes are from byte 131 of the larger packet! Here,
00 03 d2 in the larger packet and 60 in the smaller, 00 03 d2 60 = integer 250,464, so AC voltage of 250.464 volts - From byte 7,
00 0c b7 cc - another tricky one: inversely correlated with AC frequency, it's "ticks per AC full-wave at 50 MHz", so 833,484 ticks = 59.9892 hertz. One assumes there's a 50 MHz clock this draws on somewhere. - From byte 11,
00 00 d4 83 - DC volts in mV, decimal 54,403 = 54.403 volts - From byte 15,
00 00 11 04 - DC current in mA, decimal 4,356 = 4.356 amps - From byte 41,
6a fb 1f 1e - another epoch date that changes on occasion, here same-day 7:19:58 AM local time - From byte 74,
02 - our MI's logical address again - From byte 76,
de af PP PP PP PP - our PLC domain again
The 52-byte frame is a bit of a mystery - it has the PLC domain but no MI address. We'll just assume it's a bookend on each MI polling sweep for now.
So, in all, some solid and precise data, and a lot of other bytes that probably mean things that we can't correlate to information available via the API and other observations.
That's some of what we can learn from watching and listening. The next step will be standing in as the main board and sending our own fabricated polling frames to the LIB, so we will pick up there in the next post!
(postscript: I'm sure I've made a mistake or two here, so I'll probably have to do some editing to the post - will note edits at the end here. could revise forever - at some point, gotta just send it!)