goeh / weather-collector

This Java program read data from a weather station (Davis Vantage Pro2) and store it in a SQL database
5 stars 3 forks source link

getting stuck trying to download data #1

Closed arifainchtein closed 3 years ago

arifainchtein commented 5 years ago

Hello, i am trying to use your code to extract data from a DavisVantage Pro 2. The problem is that I keep getting an IOException: Unexpected EOF.

the exception is thrown here:

` for (int i = 0; i < numPages; i++) { byte[] page = readBytes(267);

        if (!CRC16.check(page, 0, page.length)) {
            throw new IOException("CRC error");
        }
        ArchivePage ap = parseArchivePage(page);
        pages.add(ap);
        out.write(Constants.ACK);
        log(OUT, "<ACK>");
    }`

Specificall in the line:

byte[] page = readBytes(267);

Do you have any sugggestions as to why this is happening?

thanks

goeh commented 5 years ago

I'm not sure. Seems like you computer cannot communicate with the Vantage console. Can you confirm that the communication link is working? If you are sure it works, then one possibility could be that your station has a newer firmware with different record structure. But I have not heard of such changes.

goeh commented 5 years ago

Looking closer at the code I can see that your communication must be working, otherwise you would have got an error message much earlier. But I have no idea what the problem could be. The software is trying to read a data page from the console but the console does not have more pages. I don't know why this is happening with your station.

goeh commented 3 years ago

I've tested on two Vantage Pro2 stations and several Raspberry Pi 3 and Raspberry Pi 4 without problem. Please try the latest snapshot and reopen this issue if the problem persists.