britkat1980 / giv_tcp

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

Resolve influxdb host on docker internal network #190

Closed gpbenton closed 3 months ago

gpbenton commented 3 months ago

I have a docker-compose file with influxdb2 and givtcp as a services.

I should be able to specify influxdb2:8086 as the influxdb url, - INFLUX_URL=influxdb2:8086 # URL of an external Influx instance

but when I do this, I get the error GivTCP | 2024-06-17 16:39:30,758 - Inv1 - write_api - [ERROR ] - The batch item wasn't processed successfully because: No host specified.

I can replace the influxdb2 with the docker internal network ip address of the influxdb service, or use the external host address with success, so the posting all works fine, just the resolution of the internal name of the service.

The MQTT url is also successfully resolved from the service name, so there is no problem with the general process. - MQTT_ADDRESS=mosquitto # IP address of an existing MQTT broker, or leave as "127.0.0.1" to use the internal broker

gpbenton commented 3 months ago

Ah, if I add http:// to the url, it all works fine. User error.