VTuber-Python-Unity icon indicating copy to clipboard operation
VTuber-Python-Unity copied to clipboard

TCP connnect can not connected, unity is runing

Open lucasjinreal opened this issue 2 years ago • 9 comments

INFO: Created TensorFlow Lite XNNPACK delegate for CPU. Traceback (most recent call last): File ".\main.py", line 239, in main() File ".\main.py", line 92, in main socket = init_TCP() File ".\main.py", line 37, in init_TCP s.connect(address) ConnectionRefusedError: [WinError 10061] No connection could be made because the target machine actively refused it [ WARN:[email protected]] global D:\a\opencv-python\opencv-python\opencv\modules\videoio\src\cap_msmf.cpp (539) `anonymous-namespace'::SourceReaderCB::~SourceReaderCB terminating async callback

image

lucasjinreal avatar Mar 13 '22 16:03 lucasjinreal

Is the TCP port in the unity program and the python program the same?

Also, ensure that the TCP connection function is being called when running the program.

Also, ensure that you run the unity program first before running the python program.

I think mainly these are the reasons that caused the error.

mmmmmm44 avatar Mar 14 '22 05:03 mmmmmm44

I had the same problem with you,and I solved it. I only modified the ip address in the main.py file at first, and then the same situation as you occurred. Later, I found that there is also an ip address in the HiyoriController.cs file. The result is that I changed the ip address in the HiyoriController.cs file. After successfully running! As shown in the picture, I hope this will help you!

Bruce-yu199 avatar Mar 14 '22 07:03 Bruce-yu199

@mmmmmm44 I am using the default port without changing, it should be same.

lucasjinreal avatar Mar 14 '22 08:03 lucasjinreal

@Bruce-yu199 I don't understand, doesn't they all using 127.0.01? it was local TCP IP

lucasjinreal avatar Mar 14 '22 08:03 lucasjinreal

@jinfagang no, I mean every computer's local TCP IP may be different. you should find your own ip and modify the ip in both .py and .cs file with your own ip. for example, i modify the ip with my computer's ip"192.168.xxx.xxx"

Bruce-yu199 avatar Mar 14 '22 08:03 Bruce-yu199

@Bruce-yu199 I can 1000% sure that your problem wasn't solved by changing IP address.... 127.0.0.1 is just your local IP, it was same thing...

lucasjinreal avatar Mar 14 '22 08:03 lucasjinreal

@jinfagang sorry, I just reacted suddenly ,you are right. But I truly solve it by changing the ip with "192.168.xxx", maybe you can have a try or see if the port is occupied by another application ...

Bruce-yu199 avatar Mar 14 '22 09:03 Bruce-yu199

@Bruce-yu199 I fonud it was due to c# scripts acutally not fully up:

imag

@mmmmmm44 Can u give me a hand? I droped the cs to unitychan obejct already.. and it can be seen here:

image why give me this error?

lucasjinreal avatar Mar 14 '22 15:03 lucasjinreal

Late reply, but I think you may have already figured it out.

The usage of UI stuff (the Canvas and remaining stuff) is only available and can be figured them out only when you import the sample package downloaded from the dropbox.

There is an App Controller object holding the UI System.cs, which controls the max/min value of the detection from Python and clip them.

There is also an Cavas object which holds the UI stuff (the buttons and sliders).

I don't include them in the tutorial videos as they are unfinished stuff to me (although they work), and also they are developed after I make the complete series.

Anyway, thank you for using my project. Hope you are having fun. ><

mmmmmm44 avatar Mar 19 '22 08:03 mmmmmm44