runi95 / turtle-control-panel

A website for monitoring and controlling ComputerCraft turtle activities
12 stars 2 forks source link

Turtle Dosnt show up on the dashboard #5

Closed flexhd41 closed 6 months ago

flexhd41 commented 6 months ago

The turtle itself says its connected but it dosnt show up could be because i changed the port of the backend but also changed the port in the app.tsx file image image

runi95 commented 6 months ago

Not quite sure what's going on with your portal here, but as a sanity check does your server say the turtle has connected? It should look something like this when a turtle connects to the backend server:

[1] info        28-11-2023 06:29:39     Starting server...
[1] info        28-11-2023 06:29:39     Listening on port 6868
[1] info        28-11-2023 06:33:31     Incoming connection...
[1] info        28-11-2023 06:33:31     Initiating handshake...
[1] info        28-11-2023 06:33:32     Incoming connection...
[1] info        28-11-2023 06:33:32     Initiating handshake...
[1] info        28-11-2023 06:33:32     Sol [0] has connected!
[1] info        28-11-2023 06:33:33     Freia [18] has connected!

And then my portal let's me know they're connected:

Screenshot 2023-11-28 at 18-35-07 TCP

If I change the server port without updating the portal it currently looks like the following:

Screenshot 2023-11-28 at 18-36-06 TCP

If you know how to you could open your browser's developer tools and check the network tab for WebSocket connections and then make sure it manages to establish a proper connection to your server.

flexhd41 commented 6 months ago

the server dosnt mention anything image for the network tab one gets the ip with 25569 that call is just called ws and another one with 25568 is called the domain name i use

flexhd41 commented 6 months ago

also i saw this in the console image

runi95 commented 6 months ago

Oh-yeah, the issue is probably that there's a second WebSocket servers running from server/src/entities/turtle.ts that's supposed to handle the communication with the turtles. I'm honestly not too sure why I've set it up like this, probably just because it was easier to separate the portal and the turtles then.

runi95 commented 6 months ago

I've made some changes to make the second WebSocket server more obvious as well as added an environment variable TURTLE_WSS_PORT that allows you to configure the port for it.

flexhd41 commented 6 months ago

Alright thank you for the help Really like this project it works now image