Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Unable to connect to Minecraft #48

Open
Kevin-Mattheus-Moerman opened this issue Dec 27, 2022 · 3 comments
Open

Unable to connect to Minecraft #48

Kevin-Mattheus-Moerman opened this issue Dec 27, 2022 · 3 comments

Comments

@Kevin-Mattheus-Moerman
Copy link

I get the following when trying to connect to Minecraft when I execute connectToWorld(), can you help troubleshoot this? @aviks @Ellipse0934 Thanks!

ERROR: Unable to connect to the Minecraft World.
Stacktrace:
 [1] error(s::String)
   @ Base ./error.jl:33
 [2] connectToWorld(address::String, port::Int32)
   @ PiCraft ~/.julia/packages/PiCraft/aYw5Z/src/api.jl:34
 [3] connectToWorld()
   @ PiCraft ~/.julia/packages/PiCraft/aYw5Z/src/api.jl:31
 [4] top-level scope
   @ REPL[2]:1

caused by: IOError: connect: connection refused (ECONNREFUSED)
Stacktrace:
 [1] wait_connected(x::Sockets.TCPSocket)
   @ Sockets /buildworker/worker/package_linuxarmv7l/build/usr/share/julia/stdlib/v1.6/Sockets/src/Sockets.jl:532
 [2] connect(::Sockets.TCPSocket, ::String, ::Int32)
   @ Sockets /buildworker/worker/package_linuxarmv7l/build/usr/share/julia/stdlib/v1.6/Sockets/src/Sockets.jl:567
 [3] connect
   @ /buildworker/worker/package_linuxarmv7l/build/usr/share/julia/stdlib/v1.6/Sockets/src/Sockets.jl:552 [inlined]
 [4] connectToWorld(address::String, port::Int32)
   @ PiCraft ~/.julia/packages/PiCraft/aYw5Z/src/api.jl:32
 [5] connectToWorld()
   @ PiCraft ~/.julia/packages/PiCraft/aYw5Z/src/api.jl:31
 [6] top-level scope
   @ REPL[2]:1

I am using a RaspberryPi 4, 8Gb RAM with:

Julia Version 1.6.3 (2021-09-23)
Output of cat /etc/os-release:

PRETTY_NAME="Raspbian GNU/Linux 10 (buster)"
NAME="Raspbian GNU/Linux"
VERSION_ID="10"
VERSION="10 (buster)"
VERSION_CODENAME=buster
ID=raspbian
ID_LIKE=debian
HOME_URL="http://www.raspbian.org/"
SUPPORT_URL="http://www.raspbian.org/RaspbianForums"
BUG_REPORT_URL="http://www.raspbian.org/RaspbianBugs"
@Kevin-Mattheus-Moerman
Copy link
Author

Note that I can connect when I use Python, by simply using:

from mcpi.minecraft import Minecraft
mc = Minecraft.create()

@Kevin-Mattheus-Moerman
Copy link
Author

@Ellipse0934 @aviks do you have any suggestions? Is this repository still maintained? Thanks

@aviks
Copy link
Member

aviks commented Jan 30, 2023

This is basic functionality that does work for me, so I'm not sure what could be up. It's very strange that python connects, which Julia does not. By default, it tires to connect to localhost port 4711. Can you check if minecraft is actually listening on that port on your machine? Can you telnet to that host/port combination? The code is simply running Sockets.connect("localhost", 4711) -- maybe you can run this from the REPL and see what's up?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants