Hello,
I’m working on running OpenEMS using Docker. While the WebSocket connection is successfully established between the edge and the backend(with authentication via an apiKey
), the connection is immediately closed. Interestingly, when I manually test the WebSocket connection using tools like wscat
or curl
from inside and outside the container, the connection remains open and functional. From the logs, the Edge app successfully completes the handshake, but as soon as it attempts to interact with the WebSocket (e.g., sending a message), the backend closes the connection, citing a “Connection refused” error.
Thank you in advance for your help!
1 Like
Edit: When i run openems without docker it works perfectly, i think there is something wrong with the containerization (it’s not a docker network related issue because i can open a websocket using wscat from inside the container).
Any help is appreciated.
Hey alaasoubani, I currently have the exact same problem. Did you find the solution yet?
I had the same issue.
It seems to me that OpenEMS does not use the DNS server which Docker provides to look up the IP of the backend container.
I worked around the issue by manually specifying the IP address. Need to find a more robust way yet.
1 Like
I tried to further troubleshoot the issue, but without success.
Interestingly, I can configure the host of the InfluxDB with the docker hostname in the backend. So it seems that only the edge is affected by the issue.
I also found out that the edge contains functionality to modify the network configuration. Not sure whether the root cause is there. The corresponding component io.openems.edge.core.host
however assumes a Debian/Systemd system, which the docker image is not. Fixing that is probably an issue for itself.