rstrouse / nodejs-poolController-dashPanel

A dashboard panel for tagyoureit/nodejs-poolController
33 stars 20 forks source link

'Connection Error' reported when connection exists #32

Closed g-unit123 closed 3 years ago

g-unit123 commented 3 years ago

Hi,

I'm running into an odd issue, that I'm hoping you can help me with. When I connect to dashPanel it immediately reports a connection error, but I can still use all the buttons and make changes to settings/relays/circuits with no problems. I've tried restarting my Pi and even reinstalling it but no luck. I've set my system up in docker containers and I'm wondering if that may be playing some part in this. (NJPC and dashPanel are each running in their own container, built from the DockerFiles provided in each repo)

From what I can see in the various logs it appears there may some kind of heartbeat/check-in that is failing to connect from the webpage back to the NJPC server, causing it to think there's a connection error when there isn't really. Any ideas or suggestions on how to fix this issue would be much appreciated. As I said I can still use it, but this is a bit of an annoyance having the grey washout and blinking connection error.

If you need me to provide any additional logs, screenshots, etc to assist in troubleshooting please let me know.

Thanks!

dashPanel Connection Error: image

JS Web Console errors reported: image

NJPC Logs for the connection: image

dashPanel Logs for the connection: image

tagyoureit commented 3 years ago

I'm not an expert in docker, but there is a wiki for setting up both njsPC and dashpanel in the same container. You might want to try that. If it doesn't work, can you open an issue on njsPC and tag one of the docker contributers?

rstrouse commented 3 years ago

I too am not a docker expert but what I am witnessing in your logs is a classic issue where the socket is dropping between the apps. This could be because one container has the most recent changes to socket.io and the other does not.

g-unit123 commented 3 years ago

Thanks for the responses, I appreciate the help!

@rstrouse any ideas how I could fix it? I've tried to rebuild both of the containers on several occasions, which should cause the latest version of socket.io to be pulled, but I've not seen any difference.

rstrouse commented 3 years ago

Which version of node are you running? The socket.io and serial port libraries are currently matched to the node version. You should be running v12.x

g-unit123 commented 3 years ago

Hi, Sorry for the delay in responding, but I haven't had a chance to keep on troubleshooting until now.

@rstrouse your diagnosis led me to the problem. Because I'm using a docker build server I had slightly modified the provided Dockerfile to pull the repos before starting the build; that script was using the next branch of NJPC, rather than master branch - since you moved development to master the next branch is on socket.io 2.3.0 rather than 4.0.1, hence the mismatch to DashPanel. After switching branches I'm getting no more 'connection error' problems.

Thanks for all the great work on this project!