thevindu-w / clip_share_server

Share Clipboard across devices. Share copied files and screenshots securely. Free and open-source tool that works on Windows, Linux, macOS, and Android.
GNU General Public License v3.0
49 stars 2 forks source link

Running Windows exe only creates this log file #2

Closed JFMugen closed 11 months ago

JFMugen commented 11 months ago

"Can't bind to port 4337 UDP"

Tried to create a new inbound/outbound rule in Firewall but didn't help :/

thevindu-w commented 11 months ago

This probably happens when another instance of the program is running and using the same port. A port can be used by only one process at a time. You can fix it in any of the following ways,

JFMugen commented 11 months ago

Hmm, looks like the reason was having more than one instance. When I just click once, there is no log file.

But I couldn't manage to connect, which might be my lack of knowledge. On phone I just write the number that I use for connecting my modem (192.168.1.1) and then I tried the default number in the app (192.168.1.2) but both of them result "No Servers Found". I am not sure what I am doing wrong, but maybe a tutorial can be helpful for more clueless users :)

thevindu-w commented 11 months ago

When I just click once, there is no log file.

Yes, that's the expected behavior of the app. Note that it doesn't open any visible window. It runs in the background.

On phone I just write the number that I use for connecting my modem (192.168.1.1)

No, this is the IP address of the modem. You should use the IP address of your laptop (or desktop) computer.
First make sure the following things are correctly set up.

The IP address of your machine may look like 192.168.1.\<some number> where \<some number> is not 1 (which is the IP address of the router as you mentioned).

thevindu-w commented 11 months ago

On phone I just write the number that I use for connecting my modem (192.168.1.1) and then I tried the default number in the app (192.168.1.2) but both of them result "No Servers Found".

The scan button is there in the Android app to find the server automatically. If you manually put the IP address, you don't need to scan again. Note that scanning is an optional feature to help find the IP address, which is not essential for clipboard sharing functionalities. You can always set the IP address manually and use the app.

Once you have the IP address entered in the client app (mobile), you can check it by copying some text on your computer and then pressing the GET button on the Android client app. If you see the copied text on the mobile app, it is working. Then, you should be able to paste it on any other place on your mobile (it gets copied into the clipboard when you press the GET button).

maybe a tutorial can be helpful for more clueless users :)

Yes, this looks like a good idea. I'll try to make a tutorial.

JFMugen commented 11 months ago

Yes, that's the expected behavior of the app. Note that it doesn't open any visible window. It runs in the background.

I was expecting a GUI so clicked several times, my bad there.

Other than that, I couldn't make it work :/

Both the phone and the laptop or desktop computer are connected to the same Wi-Fi network (or the computer is connected to the mobile hotspot of your phone)

Done.

The server is allowed through the firewall.

Done. image

You have not changed the port numbers in the clipshare.conf file. If you don't have a clipshare.conf file..

I don't have the file.

Though it's unlikely, your phone may have a firewall, proxy, VPN, other network setting

Not that I know of. Any way I can verify this? I know for sure that I haven't installed any app that should affect the network.

///

If you are using my android app, you can use the scan button. You need the server running on your computer for the scan to work.

Sadly doesn't work :/

Once you have the IP address entered in the client app (mobile), you can check it by copying some text on your computer and then pressing the GET button

Gives "Couldn't Connect" error.

I believe everything should be good but looks like it isn't? Idk :/

thevindu-w commented 11 months ago

Gives "Couldn't Connect" error.

Are both devices (computer and mobile) on the same WiFi network? Did you find the correct IP address of the server? And, did you copied some text on the computer before pressing the GET button on mobile?

JFMugen commented 11 months ago

Alriiiight, I just thought about trying with mobile hotspot and worked instantly. So I think the program works as intended.

But I have no idea what might be the difference between that and my wi-fi

Are both devices (computer and mobile) on the same WiFi network?

Yep

Did you find the correct IP address of the server?

From ipconfig -> image

And, did you copied some text on the computer before pressing the GET button on mobile?

Yep

thevindu-w commented 11 months ago

Now that implies both the server and client are working, but the network was the problem.

Is that IP address, which you found through ipconfig, is the IP address when you connect to the WiFi? or is it the IP address when connected to the mobile hotspot? That IP address looks correct. If the IP address is not the problem, then probably the firewall may be blocking the app. Please check the firewall rules to see if it allows connections

Probably your laptop is treating your WiFi as a public network while you have allowed the app through the firewall only for private networks only. Here is how to fix that,

If that was the case in your WiFi, this should solve the issue.

Alternative solution, If your WiFi network is a home WiFi network or any other WiFi network where only trusted people can connect, you can make it a private network by following the steps in the link I provided above.

JFMugen commented 11 months ago

Is that IP address, which you found through ipconfig, is the IP address when you connect to the WiFi?

Yep, hotspot was different.

then probably the firewall may be blocking the app

Well, now it works. I have no idea whether I didn't see before (I don't think so?) or they appear after trying with hotspot, but I see these 2 now.

image

They were "Block" and after disabling both, now it works as intended.

thevindu-w commented 11 months ago

Great. As I see, the new rules are for public networks. I guess the issue was private vs public networks. If it's now working properly on both networks, we can close this issue. If you have any further doubts, feel free to ask.

JFMugen commented 11 months ago

I guess the issue was private vs public networks.

The screenshot I send above and the last one both "All" actually, I changed them to all myself before you say it, thinking it might be the problem, but it didn't help.

I really have no idea why these 2 appear to be honest but either way the issue was on my side for sure. Thanks for the help and I hope it can help some others as well in future ^^

JFMugen commented 11 months ago

@thevindu-w

Wait for a few days and get the newest version

Just thought about it but how about just creating a tray icon when it is active? I don't know if it is hard to implement but it would be useful for sure. This way you can easily close the program as well when you are done.

thevindu-w commented 11 months ago

Yes, It's a good idea. I'll try to do that. It's good to have some kind of an indicator.

thevindu-w commented 11 months ago

Feature to create a tray icon on Windows is now available in the master branch if you want to compile it yourself. It will be included in the next release v2.2 in a few days*.

Update 2023-08-19: This is now available in releases.

JFMugen commented 11 months ago

Feature to create a tray icon on Windows is now available in the master branch if you want to compile it yourself. It will be included in the next release v2.2 in a few days.

Thanks for the heads-up but I am not very experienced with compiling and stuff, I will wait for the release ^^

thevindu-w commented 11 months ago

@JFMugen Version 2.2 with Windows tray icon support is now available as a release.

JFMugen commented 11 months ago

@thevindu-w Hey, works great ^^

But I just think you should add "Right Click -> Exit" option to the tray icon. I don't think any more than "Exit" is needed.

thevindu-w commented 11 months ago

Ok I'll try to include it in the next release

JFMugen commented 11 months ago

@thevindu-w btw just letting you know that sometimes it doesn't create an icon. I tried yesterday and saw the icon but today it doesn't appear. All I did was moving the file from C/Downloads to E/_Portable Tools, feel free to tell me if there is anything else I can provide like log etc.

thevindu-w commented 11 months ago

sometimes it doesn't create an icon.

Is the server running even when the icon is not displayed? You can check if it's running from the task manager.

All I did was moving the file from C/Downloads to E/_Portable Tools.

Does the tray icon always work when it's in C:\? Does the tray icon sometimes work when it's in E:\?

JFMugen commented 11 months ago

Is the server running even when the icon is not displayed? You can check if it's running from the task manager.

Yep, I was sure it was working from task manager

Does the tray icon always work when it's in C:? Does the tray icon sometimes work when it's in E:?

Right now it doesn't show at all whether its C or E -_-

image

thevindu-w commented 11 months ago

Right now it doesn't show at all whether its C or E -_-

Try to stop all ClipShare processes and re-run it. May be the existing process is removing the tray icon. I have to check that.

JFMugen commented 11 months ago

Try to stop all ClipShare processes and re-run it.

Tried it, restarted PC as well to be sure. Didn't help.

It is weird that I saw yesterday but can't see today. I have no idea what might change, I didn't install sth new.

thevindu-w commented 11 months ago

If you didn't create a config file with tray_icon=false, it should work. I'll try to re-create the issue on my machine.

JFMugen commented 11 months ago

I didn't touch or create any config file :/

thevindu-w commented 11 months ago

I re-created the problem in my machine also. That happened when I moved the exe to another partition. Now I can further check what's wrong. As a temporary solution, copy (not move) the exe file back to where it was working (to the exact same folder. not just the drive). And then run it there. Although it worked for me, I'm not sure if that works always.

JFMugen commented 11 months ago

Either way it is not a huge deal or anything as the program still works great, but I am glad you managed to recreate the issue. Thanks :)

thevindu-w commented 10 months ago

@JFMugen tray icon not showing when exe is moved is now fixed in version 2.3.

But I just think you should add "Right Click -> Exit" option to the tray icon. I don't think any more than "Exit" is needed.

this is also included in that release.

JFMugen commented 10 months ago

Works flawlessly, thanks :)