thefloppydriver / pc2drc

Give your gamepad a new use!
GNU General Public License v2.0
60 stars 3 forks source link

Error- stage-4-start-pc2drc (CConn: unable connect to socket: Connection refused (111)) #12

Open Special-Niewbie opened 2 years ago

Special-Niewbie commented 2 years ago

Describe the bug Once you have started stage-3-pair-with-wiiu.py and followed the whole procedure to connect the Wii U Pad to PC via the Wireless USB key. Premise in my Desktop PC with the files stage-3-pair-with-wiiu.py and stage-4-start-pc2drc, gives me the same error as @Etunts as Error: User directory is not / home / root and i solved / I was able to move on with his modified files from @Etunts here: https://github.com/thefloppydriver/pc2drc/issues/9

So, once I pair the Wii U Pad to the PC and run the stage-4-start-pc2drc.py , I get the error Could not connect to vncserver ERROR 111. Please watch the txt file below: stage-4-start-pc2drc.txt

Some Tips The strange of the Error: User directory is not / home / root, with stage-3 and stage-4 I got only in my Desktop side because on my second Netbook computer with Ubuntu 20.04 LTS I didn't get this error and I can perform all the stages without mod it. So, not sure if it's related to the OS version (because on Desktop side I'm using the Ubuntu 18.04.6) or for some mysterious black magic...

Desktop:

Etunts commented 2 years ago

Hey, figured out that its caused by the modified code. Alongside fixing home/root error, i also fixed some typos/errors. But the "fix" i made for one error causes 111 issue. Here is the updated file with only the home/root fix:

Etunts commented 2 years ago

usethesev2.zip

Special-Niewbie commented 2 years ago

Hi @Etunts , you mean that with this new fix you can connect to the PAD, because you fix the 111 Error? Am I understandand correctly?

Etunts commented 2 years ago

No. Actually this one shows more errors and it only fixes home/root error. I posted this one because its would be more easy to fix, the first one i sent silents the other errors, not fixing them.

Etunts commented 2 years ago

Silenting an error is not a solution, actually it makes it more hard to debug things.

Special-Niewbie commented 2 years ago

I noticed that in these lines, was the user "thefloppydriver", and I changed with mine (cris):


print("Starting VNC server...")
#subprocess.check_call(['tigervncserver', '--kill', ':1']) 

time.sleep(0.5)
#os.system("sudo runuser -u cris -- /bin/bash -c \"echo -e '12345678\\n12345678\\nn' | vncpasswd\"") #unnecessary
#subprocess.check_call(['chmod', '0664', user_dir+'/.vnc/passwd'])
#os.system("sudo runuser -u cris -- tigervncserver :1 -passwd "+user_dir+"/.vnc/passwd -depth 24 -geometry 640x480 -localhost yes")
try:
    os.system("sudo runuser -u cris -- tigervncserver :1 -useold -FrameRate 59.94 -SecurityTypes None -depth 24 -geometry 640x480 -localhost yes -xstartup "+current_working_directory+"/libdrc-vnc/vncconfig-files/Xvnc-session-gnome")
except:
    print("Failed to start tigervncserver, killing and trying again.")
    subprocess.check_call(['tigervncserver', '--kill', ':1'])
    try:
        os.system("sudo runuser -u cris -- tigervncserver :1 -useold -FrameRate 59.94 -SecurityTypes None -depth 24 -geometry 640x480 -localhost yes -xstartup "+current_working_directory+"/libdrc-vnc/vncconfig-files/Xvnc-session-gnome")
    except:
        print("Could not start tigervncserver.")
        input("(press enter to quit)")
        sys.exit(0)

and then the 111 error it doesn't come out, but it come out another error that it say:

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "./stage-4-start-pc2drc_mod2.py", line 233, in <module>
    print(vncserver.before.decode('utf-8'))
NameError: name 'vncserver' is not defined

so, seems the vncserver it is not defined?

Etunts commented 2 years ago

I changed that vncserver to vncviewer which silented all of errors.

Special-Niewbie commented 2 years ago

I changed that vncserver to vncviewer which silented all of errors.

I think there is the miss understanding here , if I go back to the original file of thestage-4-start-pc2drc.sh from @thefloppydriver , there, in the line 236 print(vncserver.before.decode('utf-8')) and in your 233 print(vncserver.before.decode('utf-8')) they are completely the same from the beginning... So, what you changed from the original file it's that you deleted completely the lines from 18 to 21 to fix the home/root error, and it's great. Now, the problem it's that on the line 233 print(vncserver.before.decode('utf-8')), its missing or misspell the vncserver definition , because it gives the error that it's "not defined" instead of the vncviewer it is defined, and that the point of the error. But I don't know how to solve it, @thefloppydriver please man , where are you? We need your help....

Etunts commented 2 years ago

He said this to me on reddit. Lets wait for a while.

Yes, but I'm focusing on school and moving houses right now. I'll return to it very soon. Thank you for your interest in the project :)

Special-Niewbie commented 2 years ago

He said this to me on reddit. Lets wait for a while.

Yes, but I'm focusing on school and moving houses right now. I'll return to it very soon. Thank you for your interest in the project :)

Thank you for the info @Etunts , okay, I will be waiting any news here......

gudenau commented 2 years ago

The problem appears to be the fact that the scripts have a hardcoded username.

gudenau commented 2 years ago

The flags for drcvncclient are also missing -lpthread and -ldl, plus drcvncclient instantly exits.