britkat1980 / giv_tcp

TCP connection (from inverter) and MQTT implementation
78 stars 37 forks source link

New install - docker container. Can't connect to inverter #157

Open mjburton opened 9 months ago

mjburton commented 9 months ago

Hi, hoping someone can help me. I've created a new docker stack and the container is up and running, however it won't connect to the inverter. I've connected to the docker container and confirmed it can ping the Giv IP address so this doesn't look to be a comms issue. I've tried different versions of the image in case a more recent one is broken, but to no avail. Am I missing something obvious? Thank you!

Config:

`version: "3.9" services: GivTCP: image: britkat/giv_tcp-ma:2.4.2 ports:

Error log (it doesn't seem to be picking up the inverter IP of 192.168.11.7:

2023-12-12 19:18:55,628 - startup - [CRITICAL] - SUPERVISOR TOKEN does not exist 2023-12-12 19:18:57,629 - startup - [CRITICAL] - Scanning network for GivEnergy Devices... 2023-12-12 19:19:02,862 - startup - [CRITICAL] - No inverters found... 2023-12-12 19:19:02,862 - startup - [CRITICAL] - Scanning network for GivEnergy Devices... 2023-12-12 19:19:08,092 - startup - [CRITICAL] - No inverters found... 2023-12-12 19:19:08,092 - startup - [CRITICAL] - Scanning network for GivEnergy Devices... 2023-12-12 19:19:13,320 - startup - [CRITICAL] - No inverters found... 2023-12-12 19:19:13,342 - startup - [CRITICAL] - Running Redis 2023-12-12 19:19:13,441 - startup - [CRITICAL] - Setting up invertor: 1 of 1 2023/12/12 19:19:13 [notice] 248#248: using the "epoll" event method 2023/12/12 19:19:13 [notice] 248#248: nginx/1.20.2 2023/12/12 19:19:13 [notice] 248#248: OS: Linux 4.4.302+ 2023/12/12 19:19:13 [notice] 248#248: getrlimit(RLIMIT_NOFILE): 1048576:1048576 2023/12/12 19:19:13 [notice] 248#248: start worker processes 2023/12/12 19:19:13 [notice] 248#248: start worker process 252 2023/12/12 19:19:13 [notice] 248#248: start worker process 253 2023/12/12 19:19:13 [notice] 248#248: start worker process 254 2023/12/12 19:19:13 [notice] 248#248: start worker process 255 2023-12-12 19:19:14,252 - startup - [CRITICAL] - Running RQ worker to queue and process givernergy-modbus calls 2023-12-12 19:19:14,252 - startup - [CRITICAL] - Starting Mosquitto on port 1883 2023-12-12 19:19:14,261 - startup - [CRITICAL] - Subscribing MQTT Broker for control 2023-12-12 19:19:14,261 - startup - [CRITICAL] - Starting Gunicorn on port 6345 2023-12-12 19:19:14,271 - startup - [CRITICAL] - Serving Web Dashboard from port 3000 1702408754: mosquitto version 2.0.11 starting 1702408754: Config loaded from /app/GivTCP_1/mqtt.conf. 1702408754: Opening ipv4 listen socket on port 1883. 1702408754: mosquitto version 2.0.11 running [2023-12-12 19:19:15 +0000] [259] [INFO] Starting gunicorn 21.2.0 [2023-12-12 19:19:15 +0000] [259] [INFO] Listening at: http://0.0.0.0:6345 (259) [2023-12-12 19:19:15 +0000] [259] [INFO] Using worker: sync [2023-12-12 19:19:15 +0000] [261] [INFO] Booting worker with pid: 261 [2023-12-12 19:19:15 +0000] [264] [INFO] Booting worker with pid: 264 [2023-12-12 19:19:16 +0000] [271] [INFO] Booting worker with pid: 271 2023-12-12 19:19:16,443 - Inv1 - mqtt_client - [CRITICAL] - Connecting to MQTT broker for control- 127.0.0.1 INFO Accepting connections at http://localhost:3000 HTTP 12/12/2023 7:19:54 PM 172.26.0.1 GET / HTTP 12/12/2023 7:19:54 PM 172.26.0.1 Returned 304 in 16 ms HTTP 12/12/2023 7:19:54 PM 172.26.0.1 GET /css/styles.css HTTP 12/12/2023 7:19:54 PM 172.26.0.1 GET /js/libraries/jquery.js HTTP 12/12/2023 7:19:54 PM 172.26.0.1 Returned 304 in 3 ms HTTP 12/12/2023 7:19:54 PM 172.26.0.1 GET /js/app.js HTTP 12/12/2023 7:19:54 PM 172.26.0.1 Returned 304 in 5 ms HTTP 12/12/2023 7:19:54 PM 172.26.0.1 Returned 200 in 5 ms HTTP 12/12/2023 7:19:54 PM 172.26.0.1 GET /js/helpers.js HTTP 12/12/2023 7:19:54 PM 172.26.0.1 GET /js/sensors.js HTTP 12/12/2023 7:19:54 PM 172.26.0.1 GET /js/enums.js HTTP 12/12/2023 7:19:54 PM 172.26.0.1 Returned 304 in 5 ms HTTP 12/12/2023 7:19:54 PM 172.26.0.1 Returned 304 in 4 ms HTTP 12/12/2023 7:19:54 PM 172.26.0.1 GET /js/converters.js HTTP 12/12/2023 7:19:54 PM 172.26.0.1 GET /js/formatters.js HTTP 12/12/2023 7:19:54 PM 172.26.0.1 Returned 304 in 5 ms HTTP 12/12/2023 7:19:54 PM 172.26.0.1 Returned 304 in 3 ms HTTP 12/12/2023 7:19:54 PM 172.26.0.1 Returned 304 in 3 ms HTTP 12/12/2023 7:19:54 PM 172.26.0.1 GET /app.json HTTP 12/12/2023 7:19:54 PM 172.26.0.1 Returned 200 in 2 ms HTTP 12/12/2023 7:19:55 PM 172.26.0.1 GET / HTTP 12/12/2023 7:19:55 PM 172.26.0.1 Returned 304 in 1 ms HTTP 12/12/2023 7:19:55 PM 172.26.0.1 GET /css/styles.css HTTP 12/12/2023 7:19:55 PM 172.26.0.1 Returned 304 in 1 ms HTTP 12/12/2023 7:19:55 PM 172.26.0.1 GET /js/app.js HTTP 12/12/2023 7:19:55 PM 172.26.0.1 GET /js/libraries/jquery.js HTTP 12/12/2023 7:19:55 PM 172.26.0.1 Returned 304 in 2 ms HTTP 12/12/2023 7:19:55 PM 172.26.0.1 Returned 304 in 1 ms HTTP 12/12/2023 7:19:55 PM 172.26.0.1 GET /js/formatters.js HTTP 12/12/2023 7:19:55 PM 172.26.0.1 GET /js/helpers.js HTTP 12/12/2023 7:19:55 PM 172.26.0.1 GET /js/sensors.js HTTP 12/12/2023 7:19:55 PM 172.26.0.1 GET /js/converters.js HTTP 12/12/2023 7:19:55 PM 172.26.0.1 GET /js/enums.js HTTP 12/12/2023 7:19:55 PM 172.26.0.1 Returned 304 in 2 ms HTTP 12/12/2023 7:19:55 PM 172.26.0.1 Returned 304 in 3 ms HTTP 12/12/2023 7:19:55 PM 172.26.0.1 Returned 304 in 2 ms HTTP 12/12/2023 7:19:55 PM 172.26.0.1 Returned 304 in 3 ms HTTP 12/12/2023 7:19:55 PM 172.26.0.1 Returned 304 in 2 ms HTTP 12/12/2023 7:19:55 PM 172.26.0.1 GET /app.json HTTP 12/12/2023 7:19:55 PM 172.26.0.1 Returned 304 in 1 ms HTTP 12/12/2023 7:19:55 PM 172.26.0.1 GET / HTTP 12/12/2023 7:19:55 PM 172.26.0.1 Returned 304 in 1 ms HTTP 12/12/2023 7:19:55 PM 172.26.0.1 GET /css/styles.css HTTP 12/12/2023 7:19:55 PM 172.26.0.1 GET /js/libraries/jquery.js HTTP 12/12/2023 7:19:55 PM 172.26.0.1 GET /js/app.js HTTP 12/12/2023 7:19:55 PM 172.26.0.1 Returned 304 in 2 ms HTTP 12/12/2023 7:19:55 PM 172.26.0.1 Returned 304 in 2 ms HTTP 12/12/2023 7:19:55 PM 172.26.0.1 Returned 304 in 4 ms HTTP 12/12/2023 7:19:55 PM 172.26.0.1 GET /js/enums.js HTTP 12/12/2023 7:19:55 PM 172.26.0.1 GET /js/helpers.js HTTP 12/12/2023 7:19:55 PM 172.26.0.1 GET /js/formatters.js HTTP 12/12/2023 7:19:55 PM 172.26.0.1 GET /js/sensors.js HTTP 12/12/2023 7:19:55 PM 172.26.0.1 Returned 304 in 3 ms HTTP 12/12/2023 7:19:55 PM 172.26.0.1 Returned 304 in 3 ms HTTP 12/12/2023 7:19:55 PM 172.26.0.1 Returned 304 in 3 ms HTTP 12/12/2023 7:19:55 PM 172.26.0.1 Returned 304 in 2 ms HTTP 12/12/2023 7:19:55 PM 172.26.0.1 GET /js/converters.js HTTP 12/12/2023 7:19:55 PM 172.26.0.1 Returned 304 in 1 ms HTTP 12/12/2023 7:19:55 PM 172.26.0.1 GET /app.json HTTP 12/12/2023 7:19:55 PM 172.26.0.1 Returned 304 in 1 ms HTTP 12/12/2023 7:19:55 PM 172.26.0.1 GET / HTTP 12/12/2023 7:19:55 PM 172.26.0.1 Returned 304 in 1 ms HTTP 12/12/2023 7:19:55 PM 172.26.0.1 GET /css/styles.css HTTP 12/12/2023 7:19:55 PM 172.26.0.1 GET /js/app.js HTTP 12/12/2023 7:19:55 PM 172.26.0.1 GET /js/libraries/jquery.js HTTP 12/12/2023 7:19:55 PM 172.26.0.1 Returned 304 in 2 ms HTTP 12/12/2023 7:19:55 PM 172.26.0.1 Returned 304 in 1 ms HTTP 12/12/2023 7:19:55 PM 172.26.0.1 Returned 304 in 1 ms HTTP 12/12/2023 7:19:55 PM 172.26.0.1 GET /js/formatters.js HTTP 12/12/2023 7:19:55 PM 172.26.0.1 GET /js/converters.js HTTP 12/12/2023 7:19:55 PM 172.26.0.1 GET /js/helpers.js HTTP 12/12/2023 7:19:55 PM 172.26.0.1 GET /js/enums.js HTTP 12/12/2023 7:19:55 PM 172.26.0.1 GET /js/sensors.js HTTP 12/12/2023 7:19:55 PM 172.26.0.1 Returned 304 in 2 ms HTTP 12/12/2023 7:19:55 PM 172.26.0.1 Returned 304 in 3 ms HTTP 12/12/2023 7:19:55 PM 172.26.0.1 Returned 304 in 2 ms HTTP 12/12/2023 7:19:55 PM 172.26.0.1 Returned 304 in 2 ms HTTP 12/12/2023 7:19:55 PM 172.26.0.1 Returned 304 in 2 ms HTTP 12/12/2023 7:19:55 PM 172.26.0.1 GET /app.json HTTP 12/12/2023 7:19:55 PM 172.26.0.1 Returned 304 in 1 ms 2023-12-12 19:20:56,532 - Inv1 - mqtt_client - [ERROR ] - No serial_number found in MQTT queue. MQTT Control not available. 1702408856: New connection from 127.0.0.1:54700 on port 1883. 1702408856: New client connected from 127.0.0.1:54700 as GivEnergy_GivTCP_1_Control (p2, c1, k60). Traceback (most recent call last): File "/app/GivTCP_1/mqtt_client.py", line 402, in client.loop_forever() File "/usr/local/lib/python3.10/site-packages/paho/mqtt/client.py", line 1756, in loop_forever rc = self._loop(timeout) File "/usr/local/lib/python3.10/site-packages/paho/mqtt/client.py", line 1164, in _loop rc = self.loop_read() File "/usr/local/lib/python3.10/site-packages/paho/mqtt/client.py", line 1556, in loop_read rc = self._packet_read() File "/usr/local/lib/python3.10/site-packages/paho/mqtt/client.py", line 2439, in _packet_read rc = self._packet_handle() File "/usr/local/lib/python3.10/site-packages/paho/mqtt/client.py", line 3039, in _packet_handle return self._handle_connack() File "/usr/local/lib/python3.10/site-packages/paho/mqtt/client.py", line 3138, in _handle_connack on_connect( File "/app/GivTCP_1/mqtt_client.py", line 386, in on_connect client.subscribe(MQTT_Topic+"/control/"+GiV_Settings.serial_number+"/#") AttributeError: type object 'GiV_Settings' has no attribute 'serial_number' 1702408856: Client GivEnergy_GivTCP_1_Control closed its connection.

mjburton commented 9 months ago

This is trying to communiate with a G1 Hybrid 3.6 with 1 x 8.2 battery

gcoan commented 9 months ago

I had the "cannot find serial number" error on my gen 1 hybrid in issue #150

It was reported by other people previously and fixed in 2.4.2, but I had it happen in v 2.4.3. I resolved the issue by downgrading to v 2.4.1

mjburton commented 9 months ago

I've tried that image too, same result. I checked /app/GivTCP_1/settings.json and it hasn't picked up the inverter IP from the ENV variables.

invertorIP=""

It's there in settings.py though.

mjburton commented 9 months ago

I changed - SELF_RUN=False to True and this seems to have got it fired up. Using instructions from https://wiki.terravolt.co.uk/docs/givtcp-installation-version-2-0/

screig commented 9 months ago

I had a very similar problem.

I had to additionally set INVERTOR_IP_1 as well as INVERTOR_IP