Comments (38)
If you want to build from scratch you should use the Dockerfile-build file with a command like
docker build -f Dockerfile-build .
You probably also want to supply a tag with the -t param
The default dockerfile is used after the jar is built externally and is passed as an argument
from enphasecollector.
That build worked, thanks for the quick response, there are quite a few Dockerfiles and I didn't know which one to use, I have it running now.
It is dark here currently so that may be a problem but all my readings are coming in as 0 even Production today and Highest output so far today, only the time is showing non zero values. My Envoy is on version D5.0.55.
from enphasecollector.
The default docker file is there for my build server. Perhaps I should make the build from source one the default.
Consumption should be non zero I would think if everything is working. Be aware that building from source puts you on the bleeding edge. I am currently working on the new V7 authentication so may have broken stuff.
Check logs obviously and post any error messages.
from enphasecollector.
It is daylight now and I'm still getting 0 readings, I have Envoy S, so no consumption readings and I'm also using Ethernet so no WiFi configuration. I'm getting an "Enphase data collection failed" message so EnvoyService is not OK.
Looking at the code any readings that fail will set the EnvoyService to not OK, is that correct.
I can check the log files, where do I find them.
from enphasecollector.
Yes, any failure when requesting data will set that flag.
If you are running docker then docker logs should show them (use docker help logs to see all the options)
Another option is when you run the container to add the -it flags so all logs will be written to your console.
from enphasecollector.
With envoy-s I think the most likely issue is the lack of power and device endpoints or they are returning no data.
but if there is an error in the log we have a chance to figure it out.
Please also add the command line used to run the container. Might be as simple as unable to find the envoy.
from enphasecollector.
I used this command to run the collector, I added the -it additional flag:
docker run -it -e TZ=Europe/London -p 8080:8080 enphasecollector
After the initialisation, I'm not seeing anything come out on the console until I refresh the /solar web page, then I get:
2022-09-20 10:42:31.740 INFO 1 --- [ scheduling-1] o.apache.http.impl.execchain.RetryExec : I/O exception (java.net.UnknownHostException) caught when processing request to {}->http://envoy.local:80: envoy.local: Try again
2022-09-20 10:42:31.742 INFO 1 --- [ scheduling-1] o.apache.http.impl.execchain.RetryExec : Retrying request to {}->http://envoy.local:80
2022-09-20 10:42:51.750 INFO 1 --- [ scheduling-1] o.apache.http.impl.execchain.RetryExec : I/O exception (java.net.UnknownHostException) caught when processing request to {}->http://envoy.local:80: envoy.local: Try again
2022-09-20 10:42:51.750 INFO 1 --- [ scheduling-1] o.apache.http.impl.execchain.RetryExec : Retrying request to {}->http://envoy.local:80
2022-09-20 10:43:11.757 INFO 1 --- [ scheduling-1] o.apache.http.impl.execchain.RetryExec : I/O exception (java.net.UnknownHostException) caught when processing request to {}->http://envoy.local:80: envoy.local: Try again
2022-09-20 10:43:11.758 INFO 1 --- [ scheduling-1] o.apache.http.impl.execchain.RetryExec : Retrying request to {}->http://envoy.local:80
2022-09-20 10:44:04.243 INFO 1 --- [ scheduling-1] o.apache.http.impl.execchain.RetryExec : I/O exception (java.net.UnknownHostException) caught when processing request to {}->http://envoy.local:80: envoy.local: Try again
2022-09-20 10:44:04.243 INFO 1 --- [ scheduling-1] o.apache.http.impl.execchain.RetryExec : Retrying request to {}->http://envoy.local:80
I can use http://envoy.local on my browser and that does connect to the Envoy home page.
from enphasecollector.
Ah welcome to the wonderful world of containers. Docker containers by default don't connect to DNS or similar network naming services. So you will need to supply the ip address of your envoy
eg docker run -it -e TZ=Europe/London -e ENVOY_CONTROLLER_HOST=envoy-ip -p 8080:8080 enphasecollector
Also note this will create a database inside the container. Not a problem unless you want to keep the data long term.
from enphasecollector.
I used this command to run a new instance:
docker run -it -e TZ=Europe/London -e ENVOY_CONTROLLER_HOST=192.168.1.233 -p 8080:8080 enphasecollector
When I refresh the browser I'm not getting the host exceptions that I saw before, so that is a good sign, but I'm still getting all 0 readings and no log output on the console to say why.
from enphasecollector.
Hmm, you should be getting something in your logs even if it is just the startup logging.
Ok lets try the following. Send me the results of
docker info
docker images
docker pull dlmcpaul/enphasecollector:0.25
docker run -it -e TZ=Europe/London -e ENVOY_CONTROLLER_HOST=192.168.1.233 -p 8080:8080 dlmcpaul/enphasecollector:0.25
And what OS you using.
from enphasecollector.
OS is Windows 10 Pro build 21H2.
Running the 0.25 collector gave the same result, 0 readings on the web page and no log output.
I have attached text files for the other outputs you wanted to see:
docker_info.txt
docker_images.txt
docker_pull.txt
I will try putting prints in the code to see where it is going, that is probably an easier way to debug it.
from enphasecollector.
It is weird that no logs are being produced. Does this only happen to the enphasecollector container?
You could also try looking under \wsl$\docker-desktop-data\version-pack-data\community\docker\containers for the logs
from enphasecollector.
When I look in \wsl$\docker-desktop-data I don't see a version-pack-data directory, just the regular Unix directories bin, data, dev, etc.
I noticed this line in the start up console output:
Reading from installer Envoy controller endpoint http://192.168.1.233/stream/meter
On my Envoy (D5.0.55) /stream/meter does not produce any output, I tried it on a browser (logged in as installer), on my own Python scripts and on the Python package envoy-utils that has a function to read this stream, in each case the command is sent but the response has no data in it.
from enphasecollector.
Ok so you are getting logs. Can you please post them.
I configure a reader for that endpoint but it should never be called. It is a long term goal to allow for real time reads.
from enphasecollector.
I'm getting log output for start up, but after it says Completed initialization, nothing else comes out.
0.25_startup_log.txt
latest_startup_log.txt
from enphasecollector.
Ok that's good it gives us something to work with.
Looks like we are reading ok from home.json but not getting to the inverters part /api/v1/production/inverters
I have pushed a test version of EnvoyService with more logging. Build a new image and try it out.
from enphasecollector.
It did produce extra output, lots of lines saying "System Read time Optional.empty"
On my Envoy I have to log in as installer to get /api/v1/production/inverters to work.
from enphasecollector.
Ok that makes some sort of sense if you don't have a production eim. Have pushed 2 changes so please rebuild and try again.
Might need more work though I may have more places I expect a production eim to exist.
from enphasecollector.
More fixes. Sorry
from enphasecollector.
I downloaded about the same time as your last change, so I did another download just now, it is getting further and now says Envoy Data Collection Successful, but then there is a null list exception.
from enphasecollector.
Ok, lets go back to basics. Could you attach the output of these urls (using curl or wget)
http://192.168.1.233/production.json?details=1
http://192.168.1.233/inventory.json?deleted=1
Then I can do some local testing to see what data you have available there.
from enphasecollector.
I have generated the outputs from a test system with two panels, so not too much data to go through:
The crash was when processing consumption data, you will not get any readings for that, since this Envoy has production metering only.
from enphasecollector.
Thanks, I have used the data to create a test case and fix other issue I could find.
Please test the new code.
from enphasecollector.
All looks good now, the production numbers and panel data are showing up, the chart is being updated every minute.
Voltage is 0, but I guess that is the battery. Because consumption is 0, it thinks all my solar power is being exported to the grid, maybe that could be disabled.
from enphasecollector.
I look for Voltage in the PowerMeter list (from /ivp/meters/readings) which is not available on your device.
I then check for a "production" eim entry from the productions endpoint (/production.json) but you only seem to have "inverters" and "storage"
If you know another place it might be set I can look for it.
I will try some code to zero out export etc if consumption is 0. Look out for a checkin.
from enphasecollector.
The export values are gone now, thanks for that. The collection time is being updated ok, but the Last communication to Enphase is only set once when the program starts, but then doesn't change.
I don't like the way the status list keeps moving around, it would be easier to read if the numeric values stayed in the same place, I can see you have a lot of items to show and you would have to make them smaller or use two columns to get them all on the screen.
Alternatively if the user could configure which ones they want to see, for example I would only show the production numbers and collection time.
from enphasecollector.
Last comm to enphase should be fixed soon. I am experimenting with caching calls to the device to not overload it but need to rethink it a bit.
The status list refreshes every 60s but since adding the individual panel values the complete list is rather large. I am hoping to reduce the size by grouping the panels and for your use case removing entries that don't make sense.
If I can think of an easy way to configure the available stats I will try to add it.
from enphasecollector.
I noticed that the chart has 1 minute data points, but the production value only changes every 5 mins, I guess this is taken from the Envoy home page. It might be good to have a high resolution mode where it uses the installer overview this gives a total production power update every minute.
from enphasecollector.
Each envoy device updates at different rates. You can set the poll rate I read things from the default of 60s.
The installer endpoint is supposed to be realtime but I find I never needed it.
I have pushed some more fixes for you to try out.
- Fixed bug of caching system object that held last communication value
- Reduced the stats shown to the bare minimum for a device with no consumption values and turned off shuffle.
from enphasecollector.
I'm seeing the connection to Enphase being updated now, so I must have the latest version, but I don't see any difference in the the status list, it still contains all the consumption entries like Grid import today and Cost today for grid usage and it is still being shuffled.
from enphasecollector.
Oops, left my test reversed while testing. Try again
from enphasecollector.
The consumption data is gone, which is good, but there are still changes to the status list, when started it showed a list of panel power values at the top, then after 5 mins these were gone and it added "solar panels producing max" at the bottom, this moved everything else up. With a 2 panel system this is not too bad, but with 8 panels it would be more distracting, maybe you only need to show the max and the min panel power all the time.
from enphasecollector.
I think I know what you are saying but perhaps some screenshots will help me understand?
from enphasecollector.
It alternates between 3 different layouts of the status list, so the values in the middle move around a bit, but not too much with my small system, probably not worth changing.
from enphasecollector.
Ah ok. So the stats panel alternates between the original system summary stats and an individual panel production stats which tries to group similar producing panels together. Currently 5W buckets. Still trying to decide if such data is useful to know or not.
Having only 2 panels does not make it very useful :-(
Well if you are happy with what is working now. I will close this issue off. There will likely be a release in the near future but you know how to build your own images so no rush I expect.
from enphasecollector.
If I download a zip from github onto my PC drive, do you have a dockerfile that would build from this local copy, rather than pulling from github directly. I tried replacing the git pull with a "COPY pom.xml ." and that builds most of the way, but then fails when trying to push into a docker copy of git.
from enphasecollector.
Maybe try something like this and pass the zip file as an argument to the docker build command
FROM azul/zulu-openjdk-alpine:17 as builder
LABEL maintainer="[email protected]"
RUN apk update && apk add git maven unzip
ARG ZIP_FILE
COPY ${ZIP_FILE} /source.zip
RUN unzip -d ./EnphaseCollector /source.zip
WORKDIR EnphaseCollector
RUN mvn package -Dmaven.test.skip
RUN cp target/enphasecollector-development-SNAPSHOT.jar /app.jar
WORKDIR /
# Generate a JDK class data share
RUN "$JAVA_HOME/bin/java" -Xshare:dump
# Explode Uber jar into lib jars and classes
RUN "$JAVA_HOME/bin/jar" -xf app.jar
FROM azul/zulu-openjdk-alpine:17-jre-headless
LABEL maintainer="[email protected]"
COPY --from=builder "./BOOT-INF/lib" /app/lib
COPY --from=builder "./META-INF" /app/META-INF
COPY --from=builder "./BOOT-INF/classes" /app
COPY --from=builder "${JAVA_HOME}/lib/server/classes.jsa" "${JAVA_HOME}/lib/server"
ENV SPRING_DATASOURCE_URL=jdbc:h2:/internal_db/solar_stats_db
RUN mkdir "/properties"
RUN touch "/properties/application.properties"
ENTRYPOINT ["java", "-cp", "app:app/lib/*", "-Xshare:auto", "-Djava.security.egd=file:/dev/./urandom", "-Dspring.jmx.enabled=false", "com.hz.EnphaseCollectorApplication", "--spring.config.additional-location=file:/properties/application.properties"]
EXPOSE 8080
VOLUME /internal_db /properties
from enphasecollector.
Added more documentation on the docker images. If more is needed please let me know
from enphasecollector.
Related Issues (20)
- Duplicate key error on new deployment when writing to influxdb HOT 5
- Receiving error after updating to current version HOT 12
- H2 database upgrade to V2 HOT 3
- Support InfluxDB > 1.8 HOT 2
- Remove Hibernate and just rely on basic Spring Data
- Consumption values wrong when another hybrid inverter is present in the system HOT 19
- Publish real-time stats to MQTT server HOT 3
- Automatically select https (port 443) for V7 enphase devices HOT 5
- Not an Issue -- Thank you HOT 1
- Enphase Gateway (Envoy) API changes HOT 33
- Update "How to build" docu HOT 7
- Battery data not in database HOT 28
- New release needed HOT 2
- Is "excess" equal to what is being exported to the grid? HOT 1
- Dockerfile bug: unknown instruction: IF HOT 3
- How to connect to MQTT publisher HOT 3
- Error retrieving solar stats - IO error HOT 8
- Unrecognized field "system_id" HOT 4
- problems connecting MQTT server HOT 6
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from enphasecollector.