animals brewing
food and drink gardening
general health
history language
music multimedia
opinion photography
politics Stones Road house
Greg's diary
recent entries
Translate this page
Select day in April 2019:
Su Mo Tu We Th Fr Sa
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
Select month:
2018 May Jun Jul Aug
2018 Sep Oct Nov Dec
2019 Jan Feb Mar Apr
Today's diary entry
Diary index
About this diary
Greg's home page
Greg's photos
Network link stats
Greg's other links
Copyright information

Saturday, 20 April 2019 Dereel Images for 20 April 2019
Top of page
next day
last day

More photovoltaic software investigations
Topic: Stones Road house, technology, opinion Link here

Yesterday's investigations brought me to two partial conclusions: the web application on the inverter has serious bugs, and I don't have access to the configuration menus. I could continue trying to break in, but it's probably a good idea not to do anything until the people come to inspect it. That should happen this coming week, but considering that Monday and Thursday are public holidays, I'm not betting on it.

So what can I do? Clearly there's a lot of information going out of the inverter. How about firing up a wireshark and seeing what's going on? First stop all the web browser sessions and then start one and watch what happens.

First problem: after stopping them all, there was still traffic. Where was it coming from? I couldn't find out, and in the end I had to run the capture to ignore its port number. And then, sure enough, there was plenty of stuff to see. The most interesting URLs were and OK, I can get that too. The information looks like:

{ "StartDate": "2019-03-11", "PacPV": 77.020650000000131, "PacDischarge": 28.540500000000108, "PacCharge": 31.101333333333432, "PacPVBat": 72.157383333330202, "W": 24.59144999999997 }

JSON, clearly. Daniel O'Connor pointed me at a pretty printer:

=== grog@eureka (/dev/pts/25) ~/solar 35 -> python -m json.tool < summary.last
    "PacCharge": 31.101333333333432,
    "PacDischarge": 28.540500000000108,
    "PacPV": 77.02065000000013,
    "PacPVBat": 72.1573833333302,
    "StartDate": "2019-03-11",
    "W": 24.59144999999997

That's interesting, but it doesn't make much sense. Why is the StartDate the way it is? On 11 March 2019 I didn't even know about the Ingeteam offerings. And why is there no time? I've already established that the inverter has NTP and had it set correctly.

And the other values? The identifiers don't make much sense. And it doesn't seem to be updated very often. At first I thought it might be a web cache thing, but that shouldn't happen for local sites, and adding the -n option to fetch didn't change anything.

And last7Days? There's more information there, multiple records, probably the background for this broken display:

This should be Inverter-1-detail-1.png.  Is it missing?
Image title: Inverter 1 detail 1
Complete exposure details
Dimensions: 445 x 257, 11 kB
Dimensions of original: 445 x 257, 11 kB
Display this image:
thumbnail    hidden   alone on page
Display all images on this page as:
thumbnails    this size
Show for Friday, 19 April 2019:
thumbnails    small images    diary entry

Formatted, today's record looks like:

=== grog@eureka (/dev/pts/25) ~/solar 41 -> python -m json.tool < last7Days.last
    "data": [
            "Date": "20190420",
            "PacCharge": 8582,
            "PacDischarge": 2973,
            "PacPV": 18167,
            "PacPVBat": 12173,
            "PacRev": 0,
            "Phase": 123,
            "SOC": 100,
            "VBAT": 271,
            "W": 5704

At least the date is correct (though in a different format from the summary record), so there's really no excuse for the broken bar chart. But it's still not clear what the numbers mean. More head-scratching needed.

Sunday, 21 April 2019 Dereel
Top of page
previous day

Still more PV software investigation
Topic: technology, opinion Link here

Yesterday's network sniffing gave some insight into how the photovoltaic inverter communicates, but not enough. Spent some more time sniffing with ngrep and found:

T -> [AP]
  127..event: /ems/sse/ { "Devices": [ { "Id": "", "Pac": 1563, "SetPoint": 0, "
  Alarms": "", "Status": "On-grid", "SOC": 31, "VBat": 265, "PacGrid": 0, "PacBat": 47, "PacPV": 1516, "Fro
  mPV": false, "Codes": "" }, { "Id": "", "W1": -60, "W2": 0, "W3": 0 } ] }....EE..event: /e
  ms/sse/ { "Date": "2019-04-21 11:43:01", "Phase": 1, "W": 5, "Pac": 1541, "PacDischarge": 107
  , "PacCharge": 468, "PacPVBatt": 1117, "EMS_VBAT": 265, "EMS_SOC": 31, "WatDigitalInput": 0, "PacRev": 0,
   "HWOutputs": 0 }....E4..event: /ems/sse/ { "Date": "2019-04-21 11:43:01", "Phase": 2, "W": 0
  , "Pac": 0, "PacDischarge": 0, "PacCharge": 0, "PacPVBatt": 0, "EMS_VBAT": 265, "EMS_SOC": 31, "WatDigita
  lInput": 0, "PacRev": 0, "HWOutputs": 0 }....E4..event: /ems/sse/ { "Date": "2019-04-21 11:43
  :01", "Phase": 3, "W": 0, "Pac": 0, "PacDischarge": 0, "PacCharge": 0, "PacPVBatt": 0, "EMS_VBAT": 265, "
  EMS_SOC": 31, "WatDigitalInput": 0, "PacRev": 0, "HWOutputs": 0 }....

Ah! That's the real data, not the locations I found yesterday. And this one does have time stamps that make sense. OK, take a look at

=== grog@eureka (/dev/pts/29) ~ 1 -> fetch
fetch: Not Found

Hmm. What's this stream stuff? Must be something that I don't understand. But there's an alternative, the dirty one that Daniel O'Connor suggested: sniff the data stream and collect what I'm looking for. Here I have clearly identified source and destination IP addresses, source port, and the beginning of the packet data.

So how do I do that? BPF, of course, and more specifically pcap. Is there a program that will do this for me? You'd think that ngrep would do it for me, but it wasn't obvious from the man page.

Further searching brought me to this page, a tutorial with source code. Played around with that for a bit. The first program, ldev (source in the text), compiled out of the box and ran:

=== root@eureka (/dev/pts/4) /home/grog/src/pcap 107 -> ./ldev
DEV: em0

Next came testpcap1.c. Again no issues compiling it, but then...

=== root@eureka (/dev/pts/4) /home/grog/src/pcap 108 -> ./testpcap1
DEV: em0
pcap_open_live(): em0: BIOCSRTIMEOUT: Invalid argument

OK, what's that? The code is:

    /* open the device for sniffing.

       pcap_t *pcap_open_live(char *device,int snaplen, int prmisc,int to_ms,
       char *ebuf)

       snaplen - maximum size of packets to capture in bytes
       promisc - set card in promiscuous mode?
       to_ms   - time to wait for packets in miliseconds before read
       times out
       errbuf  - if something happens, place error string here

    descr = pcap_open_live(dev,BUFSIZ,0,-1,errbuf);

    if(descr == NULL)
        printf("pcap_open_live(): %s

Where do I go from there? The best guess from the code is that it doesn't like -1 as a timeout value. But do I really want to get involved in debugging? I just want a filter. Maybe I should learn about streaming after all.

Irrigation woes again
Topic: gardening Link here

Yvonne told me what I should have known today: time to clean the bore water filter. I had decided that it needed cleaning every week rather than every few months, probably as a result of the low water level due to the dry summer. But I had neglected it for a couple of weeks, and it was very much in need of it.

That wasn't the only issue. It's been weeks (months?) since I decided I need to look at circuit 4, which has only too clearly been leaking:

This should be Irrigated-grass.jpeg.  Is it missing?
Image title: Irrigated grass          Dimensions:          5184 x 3888, 11922 kB
Make a single page with this image Hide this image
Make this image a thumbnail Make thumbnails of all images on this page
Make this image small again Display small version of all images on this page
All images taken on Monday, 22 April 2019, thumbnails          All images taken on Monday, 22 April 2019, small
Diary entry for Monday, 22 April 2019 Complete exposure details


Somehow I'm just too lazy.

Solar electricity progress
Topic: Stones Road house, technology, opinion Link here

We've been planning the solar electricity for well over 4 years, and much of the delay was due to procrastination on my part, coupled with a complete inability to establish contact with Simon Reid of BREAZE. Chris Bahlo didn't have that luxury: she has no grid connection, so she had to have it installed for her new house (also four years ago).

Today she came along and we compared notes. She paid about the same amount of money as we did. For that she got 7 (count them, seven) solar panels and a lead-acid battery of unspecified dimensions. But since she's only generating 1.75 kW, and the average hours of sunshine here are round 3.5 hours, it's unlikely that the batteries would store more than 7.5 kWh. And of course her inverter is completely dumb.

That's quite a difference, though even at the time I thought that the price was excessive. Maybe it wasn't such a bad thing after all that I didn't go with BREAZE.

This page contains (roughly) yesterday's and today's entries. I have a horror of reverse chronological documents, so all my diary entries are chronological. This page normally contains the last two days, but if I fall behind it may contain more. You can find older entries in the archive. Note that I often update a diary entry a day or two after I write it.     Do you have a comment about something I have written? This is a diary, not a “blog”, and there is deliberately no provision for directly adding comments. But I welcome feedback and try to reply to all messages I receive. See the diary overview for more details. If you do send me a message relating to something I have written, please indicate whether you'd prefer me not to mention your name. Otherwise I'll assume that it's OK to do so.

Greg's home page This month Greg's photos Greg's links

RSS 2.0 Valid XHTML 1.0!