michbeck100 / pv-monitoring

Contains configuration and Grafana dashboard for monitoring PV inverters
Apache License 2.0
43 stars 11 forks source link

Is there a idiot-proof installation guide available? #7

Closed Cartman84 closed 6 months ago

Cartman84 commented 1 year ago

THanks for this great work! However, I do not get it working using a NAS with unraid OS. Even with docker compose everything seems to run but Grafana is not able to get a connection to anything, thus it's telling "no data".

Would love to see an installation guide (step by step) for unraid.

Josuruma commented 1 year ago

Here are some articles about the setup. https://www.photovoltaikforum.com/thread/176200-eigenbau-pv-monitoring-inkl-prognose-mit-grafana-node-red-mqtt-etc-f%C3%BCr-sungrow-w/?postID=2901791#post2901791

michbeck100 commented 1 year ago

Please have a look at the logs of all containers. There must be some error in one of the containers. The data flow is as follows:

Inverter (Modbus) -> Sungather -> MQTT -> Telegraf -> InfluxDB -> Grafana

In one of these instances must be an error.

You can also check the sungather webserver on port 8080 of your nas. If it shows the data from the inverter then sungather is working. To check mqtt you can try http://mqtt-explorer.com to see if the messages from sungather are available.

michbeck100 commented 9 months ago

@Cartman84 Did you solve your problems?

Cartman84 commented 6 months ago

Unfortunately not. Issue still persists and must be an issue of the connection between mosquitto and sungather. Sungather is collecting data, however does not transfer data to mosquitto. Sungather log says that there is an server error for MQTT (MQTT: Server Error; Server not configured).

michbeck100 commented 6 months ago

The please post your mqtt config here. Please be aware that sungather has problems if the mqtt server gets disconnected for a while. That’s why sungather gets started AFTER mosquitto.

michbeck100 commented 6 months ago

I just saw that the depends_on setting for sungather is still missing. You can try to add it by yourself. Just add the entry below modbus_proxy in docker-compose.yml

Cartman84 commented 6 months ago

Config is as it was posted on GitHub.

allow_anonymous true listener 1883 persistence true persistence_location /mosquitto/data/

michbeck100 commented 6 months ago

Config is as it was posted on GitHub.

allow_anonymous true listener 1883 persistence true persistence_location /mosquitto/data/

And mosquitto is running?

Cartman84 commented 6 months ago

yes, mosquitto is running. I added the depends_on entry, issue persists.

1708347950: mosquitto version 2.0.18 starting 1708347950: Config loaded from /mosquitto/config/mosquitto.conf. 1708347950: Opening ipv4 listen socket on port 1883. 1708347950: Opening ipv6 listen socket on port 1883. 1708347950: mosquitto version 2.0.18 running 1708347952: New connection from 192.168.48.9:42018 on port 1883. 1708347952: New client connected from 192.168.48.9:42018 as Telegraf-Consumer-OpNFE (p2, c1, k60).

michbeck100 commented 6 months ago

You could try to remove all the network specific stuff

networks:
  - monitoring

like here: https://github.com/michbeck100/pv-monitoring/blob/433012b210fc160f213df45ec5f3fbd5115698a0/docker-compose.yml#L45 and the network itself from https://github.com/michbeck100/pv-monitoring/blob/433012b210fc160f213df45ec5f3fbd5115698a0/docker-compose.yml#L187.

Maybe that helps. But if it does this has to be a problem with unraid, as the setup works on "normal" docker installations. Did you ever try to install everything outside of unraid?

Cartman84 commented 6 months ago

Thanks for the hints, however it did not change anything. Yes, that's what I also thought of and thus I moved to an old notebook to install Debian freshly. Completely different device, different linux distro and same issue.

Also connecting via MQTT Explorer works fine. So I assume, mosquitto seems to be set up properly, so issue must lie with Sungather somehow. Log is also showing syntax warnings, what does that mean?

/usr/src/sungather/sungather.py:138: SyntaxWarning: invalid escape sequence '{' logging.info(f"Loading Export: exports{export.get('name')}") 2024-02-19 14:19:08 INFO Starting SunGather 0.5.1 2024-02-19 14:19:08 INFO Need Help? https://github.com/bohdan-s/SunGather 2024-02-19 14:19:08 INFO NEW HomeAssistant Add-on: https://github.com/bohdan-s/hassio-repository 2024-02-19 14:19:08 INFO Loaded config: /config/config.yaml 2024-02-19 14:19:08 INFO Loaded registers: registers-sungrow.yaml 2024-02-19 14:19:08 INFO Registers file version: 0.2.3 2024-02-19 14:19:11 ERROR Failed loading export: 'NoneType' object has no attribute 'replace' Please make sure mqtt.py exists in the exports folder Failed loading export: 'NoneType' object has no attribute 'replace' Please make sure mqtt.py exists in the exports folder 2024-02-19 14:19:11 WARNING MQTT: Server Error; Server not configured MQTT: Server Error; Server not configured

michbeck100 commented 6 months ago

Did you see https://github.com/bohdan-s/SunGather/issues/33?

Did you make any changes to the configs apart from the modbus-proxy.yml?

Cartman84 commented 6 months ago

Big thumbs up!!!! I had to enter my inverter model, as it is also discussed in your linked issue for SunGather. Does not have anything to do with connection between sungather and mosquitto.

Big, big thank you for your support!